Created
October 26, 2016 03:28
-
-
Save toptensoftware/d8b0bf3eb85e6b7bf0d52c9743de3dbd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Identifier - starts with letter or underscore | |
| if (char.IsLetter(_currentChar) || _currentChar == '_') | |
| { | |
| var sb = new StringBuilder(); | |
| // Accept letter, digit or underscore | |
| while (char.IsLetterOrDigit(_currentChar) || _currentChar == '_') | |
| { | |
| sb.Append(_currentChar); | |
| NextChar(); | |
| } | |
| // Setup token | |
| _identifier = sb.ToString(); | |
| _currentToken = Token.Identifier; | |
| return; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment