Fixed issue #1 Scanner Bug where the start of comment would become part of an identifier or throw off number parsing.
This commit is contained in:
+2
-2
@@ -128,7 +128,7 @@ Token* ParseNumber(void) {
|
||||
if ((ahead >= 'a' && ahead <= 'f') || isdigit(ahead)) {
|
||||
AdvanceScanner(); //Consume the 'x'
|
||||
|
||||
while(!ScannerAtEnd() && PeekScanner() != '\n' && !IsWhiteSpace(PeekScanner())) {
|
||||
while(!ScannerAtEnd() && PeekScanner() != '\n' && !IsWhiteSpace(PeekScanner()) && PeekScanner() != ';') {
|
||||
if (isdigit(PeekScanner())) {
|
||||
AdvanceScanner();
|
||||
continue;
|
||||
@@ -243,7 +243,7 @@ Token* ParseString(void) {
|
||||
Token* ParseIdentifier(void) {
|
||||
int start = Position;
|
||||
|
||||
while(!ScannerAtEnd() && !IsPunctuation(PeekScanner()) && PeekScanner() != ' ' && PeekScanner() != '\n') {
|
||||
while(!ScannerAtEnd() && !IsPunctuation(PeekScanner()) && PeekScanner() != ' ' && PeekScanner() != '\n' && PeekScanner() != ';') {
|
||||
AdvanceScanner();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user