diff options
author | ronny | 2001-07-25 18:49:10 +0000 |
---|---|---|
committer | ronny | 2001-07-25 18:49:10 +0000 |
commit | 6fae6e62330e2384f9e872adf59d7b9542a8dc43 (patch) | |
tree | 68882a3ae75dd828bc914654beae2d9cbfa437af /frontend/scanner.icl | |
parent | bug fix scanning [''] (diff) |
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
Diffstat (limited to 'frontend/scanner.icl')
-rw-r--r-- | frontend/scanner.icl | 11 |
1 files changed, 9 insertions, 2 deletions
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 |