update and skip accepts check in lexers
We think we're getting away with this because our tokens never go from legal to illegal to legal again, right? Change-Id: Iaaef797f7c4b487ba7b1d0e018846bd13086b34c Reviewed-on: https://skia-review.googlesource.com/138275 Auto-Submit: Mike Klein <mtklein@chromium.org> Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
parent
7197e05eae
commit
38f118a2e7
@ -542,7 +542,8 @@ LayoutToken LayoutLexer::next() {
|
||||
if (!state) {
|
||||
break;
|
||||
}
|
||||
if (accepts[state]) {
|
||||
// We seem to be getting away without doing this check.
|
||||
/*if (accepts[state] != -1)*/ {
|
||||
lastAccept = (LayoutToken::Kind)accepts[state];
|
||||
lastAcceptEnd = offset;
|
||||
}
|
||||
@ -551,4 +552,4 @@ LayoutToken LayoutLexer::next() {
|
||||
return LayoutToken(lastAccept, startOffset, lastAcceptEnd - startOffset);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace SkSL
|
||||
|
@ -123,5 +123,5 @@ private:
|
||||
int fOffset;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace SkSL
|
||||
#endif
|
||||
|
@ -957,7 +957,8 @@ Token Lexer::next() {
|
||||
if (!state) {
|
||||
break;
|
||||
}
|
||||
if (accepts[state]) {
|
||||
// We seem to be getting away without doing this check.
|
||||
/*if (accepts[state] != -1)*/ {
|
||||
lastAccept = (Token::Kind)accepts[state];
|
||||
lastAcceptEnd = offset;
|
||||
}
|
||||
@ -966,4 +967,4 @@ Token Lexer::next() {
|
||||
return Token(lastAccept, startOffset, lastAcceptEnd - startOffset);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace SkSL
|
||||
|
@ -238,5 +238,5 @@ private:
|
||||
int fOffset;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace SkSL
|
||||
#endif
|
||||
|
@ -149,7 +149,8 @@ void writeCPP(const DFA& dfa, const char* lexer, const char* token, const char*
|
||||
out << " if (!state) {\n";
|
||||
out << " break;\n";
|
||||
out << " }\n";
|
||||
out << " if (accepts[state]) {\n";
|
||||
out << " // We seem to be getting away without doing this check.\n";
|
||||
out << " /*if (accepts[state] != -1)*/ {\n";
|
||||
out << " lastAccept = (" << token << "::Kind) accepts[state];\n";
|
||||
out << " lastAcceptEnd = offset;\n";
|
||||
out << " }\n";
|
||||
|
Loading…
Reference in New Issue
Block a user