Created
March 22, 2017 08:45
-
-
Save Interfere/6c42d1969aa71bfa2049458981fb152c to your computer and use it in GitHub Desktop.
lexIdentifier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// lexIdentifier - Match [a-zA-Z_][a-zA-Z_$0-9]* | |
void Lexer::lexIdentifier() { | |
const char *TokStart = CurPtr-1; | |
CurPtr = TokStart; | |
advanceIfValidStartOfIdentifier(CurPtr, BufferEnd); | |
// Lex [a-zA-Z_$0-9[[:XID_Continue:]]]* | |
while (advanceIfValidContinuationOfIdentifier(CurPtr, BufferEnd)); | |
tok Kind = kindOfIdentifier(StringRef(TokStart, CurPtr-TokStart)); | |
return formToken(Kind, TokStart); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment