aboutsummaryrefslogtreecommitdiff
path: root/frontend/scanner.icl
diff options
context:
space:
mode:
authormartinw2000-01-18 12:25:01 +0000
committermartinw2000-01-18 12:25:01 +0000
commit4dec98e1bc794649a7d873413f475040aa4ad2e8 (patch)
treea04a039c401b2e9825dcba859d0250f2c50425a1 /frontend/scanner.icl
parentBug fixes (diff)
bugfix: TryScanComment did not work when a single slash was followed by a newline
character git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@78 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/scanner.icl')
-rw-r--r--frontend/scanner.icl9
1 files changed, 8 insertions, 1 deletions
diff --git a/frontend/scanner.icl b/frontend/scanner.icl
index 8ee980c..dafb68c 100644
--- a/frontend/scanner.icl
+++ b/frontend/scanner.icl
@@ -271,7 +271,7 @@ where
}
scanState.ss_tokenBuffer
, ss_input = Input inp
- } // -->> (EndOfFileToken,pos)
+ } // -->> ("Token", EndOfFileToken,pos)
// otherwise // ~ (eof && c == NewLineChar)
# (token, inp) = Scan c inp /* {inp & inp_curToken = [c]}*/ context
// # (chars, inp) = inp!inp_curToken
@@ -354,6 +354,7 @@ SkipWhites input
TryScanComment :: !Char !Input -> (!Optional String, !Char, !Input)
TryScanComment c1=:'/' input
+ #! pos = input.inp_pos // MW++
# (eof,c2, input) = ReadChar input
| eof = (No, c1, input)
= case c2 of
@@ -361,7 +362,13 @@ TryScanComment c1=:'/' input
'*' -> case ScanComment input of
(No,input) -> SkipWhites input
(er,input) -> (er, c1, input)
+// MW..
+ NewLineChar
+ # input = charBack input
+ -> (No, c1, { input & inp_pos = pos })
+// ..MW
_ -> (No, c1, charBack input)
+
TryScanComment c input
= (No, c, input)