diff options
Diffstat (limited to 'Source/Core/Scanner.cs')
-rw-r--r-- | Source/Core/Scanner.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/Core/Scanner.cs b/Source/Core/Scanner.cs index 7c3522ca..e3d131e0 100644 --- a/Source/Core/Scanner.cs +++ b/Source/Core/Scanner.cs @@ -232,6 +232,7 @@ public class Scanner { Token/*!*/ t; // current token
int ch; // current input character
int pos; // byte position of current character
+ int charPos;
int col; // column number of current character
int line; // line number of current character
int oldEols; // EOLs that appeared in a comment;
@@ -440,7 +441,7 @@ public class Scanner { bool Comment0() {
- int level = 1, pos0 = pos, line0 = line, col0 = col;
+ int level = 1, pos0 = pos, line0 = line, col0 = col, charPos0 = charPos;
NextCh();
if (ch == '/') {
NextCh();
@@ -453,13 +454,13 @@ public class Scanner { else NextCh();
}
} else {
- buffer.Pos = pos0; NextCh(); line = line0; col = col0;
+ buffer.Pos = pos0; NextCh(); line = line0; col = col0; charPos = charPos0;
}
return false;
}
bool Comment1() {
- int level = 1, pos0 = pos, line0 = line, col0 = col;
+ int level = 1, pos0 = pos, line0 = line, col0 = col, charPos0 = charPos;
NextCh();
if (ch == '*') {
NextCh();
@@ -480,7 +481,7 @@ public class Scanner { else NextCh();
}
} else {
- buffer.Pos = pos0; NextCh(); line = line0; col = col0;
+ buffer.Pos = pos0; NextCh(); line = line0; col = col0; charPos = charPos0;
}
return false;
}
|