diff options
author | johnvg | 2011-02-15 15:26:16 +0000 |
---|---|---|
committer | johnvg | 2011-02-15 15:26:16 +0000 |
commit | a5d08a6f053efb86c3f42b8f395e598f7795424f (patch) | |
tree | 0dd8bd77fa2a490a33428188d63ef399e45ed624 /frontend/scanner.icl | |
parent | use ClassInstanceMember array for ins_members instead of DefinedSymbol array, (diff) |
fix bug in scanning 'a'..
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1841 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/scanner.icl')
-rw-r--r-- | frontend/scanner.icl | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/frontend/scanner.icl b/frontend/scanner.icl index 8d671fb..e553d10 100644 --- a/frontend/scanner.icl +++ b/frontend/scanner.icl @@ -996,7 +996,8 @@ ScanNumeral n input chars | IsDigit c = ScanNumeral (n + 1) input [c:chars] | c == 'E' = ScanExponentSign (n + 1) input [c:chars] | c == '.' = TestFraction n input chars - = (IntToken (revCharListToString n chars), charBack input) + #! s = revCharListToString n chars + = (IntToken s, charBack input) TestFraction :: !Int !Input ![Char] -> (!Token, !Input) TestFraction n input chars @@ -1005,7 +1006,6 @@ TestFraction n input chars | IsDigit c = ScanFraction (n + 2) input [c,'.':chars] = (IntToken (revCharListToString n chars), charBack (charBack input)) - ScanFraction :: !Int !Input ![Char] -> (!Token, !Input) ScanFraction n input chars # (eof, c, input) = ReadNormalChar input @@ -1136,7 +1136,7 @@ ScanEndOfNoBSChar c1 input = scan_CharList_or_qualified_ident c1 c input where qualified_ident_or_CharToken :: !Char !Input -> (!Token,!Input) - qualified_ident_or_CharToken c input=:{inp_stream=OldLine i line stream,inp_pos} + qualified_ident_or_CharToken c1 input=:{inp_stream=OldLine i line stream,inp_pos} | i+1<size line && line.[i]=='.' # c=line.[i+1] | is_ident_char c @@ -1144,17 +1144,17 @@ where ident_name = line % (i+1,end_i-1) pos = {inp_pos & fp_col = inp_pos.fp_col + (end_i-i)} input = {input & inp_stream=OldLine end_i line stream,inp_pos=pos} - = (QualifiedIdentToken {c} ident_name,input) + = (QualifiedIdentToken {c1} ident_name,input) | c==' ' && i+2<size line && isSpecialChar line.[i+2] # end_i = scan_special_chars_in_string (i+3) line ident_name = line % (i+1,end_i-1) pos = {inp_pos & fp_col = inp_pos.fp_col + (end_i-i)} input = {input & inp_stream=OldLine end_i line stream,inp_pos=pos} - = (QualifiedIdentToken {c} ident_name,input) - = scan_char c input - = scan_char c input - qualified_ident_or_CharToken c input - = scan_char c input + = (QualifiedIdentToken {c1} ident_name,input) + = scan_char c1 input + = scan_char c1 input + qualified_ident_or_CharToken c1 input + = scan_char c1 input scan_CharList_or_qualified_ident :: !Char !Char !Input -> (!Token, !Input) scan_CharList_or_qualified_ident c1 c2 input=:{inp_stream=OldLine i line _} @@ -1937,4 +1937,3 @@ where (-->>) val _ :== val //(-->>) val message :== val ---> ("Scanner",message) - |