From 6fae6e62330e2384f9e872adf59d7b9542a8dc43 Mon Sep 17 00:00:00 2001 From: ronny Date: Wed, 25 Jul 2001 18:49:10 +0000 Subject: bug fix operator like =:= are now allowed git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@586 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- frontend/scanner.icl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'frontend') diff --git a/frontend/scanner.icl b/frontend/scanner.icl index 5ea3e50..c608d95 100644 --- a/frontend/scanner.icl +++ b/frontend/scanner.icl @@ -687,8 +687,8 @@ Scan c0=:'+' input co Scan c0=:'=' input co # (eof, c, input) = ReadNormalChar input | eof = (EqualToken, input) - | c == ':' = (DefinesColonToken, input) - | c == '>' = (DoubleArrowToken, input) + | c == ':' = possibleKeyToken DefinesColonToken [c, c0] co input + | c == '>' = possibleKeyToken DoubleArrowToken [c, c0] co input | isSpecialChar c = ScanOperator 1 input [c, c0] co = (EqualToken, charBack input) Scan c0=:':' input co @@ -726,6 +726,13 @@ Scan c input co | isSpecialChar c = ScanOperator 0 input [c] co = (ErrorToken ScanErrIllegal, input) +possibleKeyToken :: !Token ![Char] !Context !Input -> (!Token, !Input) +possibleKeyToken token reversedPrefix context input + # (eof, c, input) = ReadNormalChar input + | eof = (token, input) + | isSpecialChar c = ScanOperator 2 input [c : reversedPrefix] context + = (token, charBack input) + new_exp_char ',' = True new_exp_char '[' = True new_exp_char '(' = True -- cgit v1.2.3