summaryrefslogtreecommitdiff
path: root/Source/Core/Scanner.cs
diff options
context:
space:
mode:
authorGravatar wuestholz <unknown>2011-07-15 15:02:52 +0200
committerGravatar wuestholz <unknown>2011-07-15 15:02:52 +0200
commitd844ae4047f8a4cd9aa8729fd1132155beaf5d8d (patch)
tree8d9af7003a8e54063025e9aac51066190aea828a /Source/Core/Scanner.cs
parentd0ebfc7319653b36b91a6f27fc66b1328fbf096e (diff)
Updated the Parser.cs and Scanner.cs files in Boogie and Dafny and removed some trailing whitespace.
Diffstat (limited to 'Source/Core/Scanner.cs')
-rw-r--r--Source/Core/Scanner.cs9
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;
}