diff options
author | johnvg | 2009-11-26 15:16:58 +0000 |
---|---|---|
committer | johnvg | 2009-11-26 15:16:58 +0000 |
commit | 2b61d4894c10efd6db1a9250771f9a827cc3b424 (patch) | |
tree | e859bc620c6b2b1f8f9e8057fe82ac79b4511c8f /frontend/scanner.icl | |
parent | fix bug in fusion that may occur if a recursive function that contains (diff) |
remove preprocessor for Clean 1.3 code
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1754 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/scanner.icl')
-rw-r--r-- | frontend/scanner.icl | 45 |
1 files changed, 3 insertions, 42 deletions
diff --git a/frontend/scanner.icl b/frontend/scanner.icl index a5df19b..7983ab3 100644 --- a/frontend/scanner.icl +++ b/frontend/scanner.icl @@ -1253,8 +1253,7 @@ ReadNormalChar {inp_stream = OldLine i line stream,inp_pos,inp_tabsize,inp_filen ) = ReadNormalChar {inp_filename=inp_filename,inp_tabsize=inp_tabsize,inp_pos=inp_pos,inp_stream = stream} ReadNormalChar {inp_stream = InFile file, inp_pos, inp_tabsize, inp_filename} -// MW8 was: #! (s, file) = freadline file - #! (s, file) = (SwitchPreprocessor freadPreprocessedLine freadline) file + #! (s, file) = freadline file | size s==0 # c = NewLineChar // pos = NextPos c inp_pos inp_tabsize @@ -1296,8 +1295,7 @@ ReadChar {inp_stream = OldLine i line stream,inp_pos,inp_tabsize,inp_filename} inp_stream = stream} //ReadChar input=:{inp_stream = InFile file, inp_pos, inp_tabsize} ReadChar {inp_stream = InFile file, inp_pos, inp_tabsize, inp_filename} -// MW8 was: #! (s, file) = freadline file - #! (s, file) = (SwitchPreprocessor freadPreprocessedLine freadline) file + #! (s, file) = freadline file | size s==0 # c = NewLineChar pos = NextPos c inp_pos inp_tabsize @@ -1326,8 +1324,7 @@ ReadLine input=:{inp_stream = OldLine i line oldfile, inp_pos} ReadLine input=:{inp_stream = InFile infile,inp_pos} # (eof, file) = fend infile | eof = ("", {input & inp_stream = InFile file}) -//MW8 was # (l, file ) = freadline file - # (l, file ) = (SwitchPreprocessor freadPreprocessedLine freadline) file + # (l, file ) = freadline file = (l, {input & inp_stream = InFile file, inp_pos = NextPos CRChar inp_pos 0}) ReadLine input = ("", input) @@ -1836,39 +1833,3 @@ where (-->>) val _ :== val //(-->>) val message :== val ---> ("Scanner",message) - -// MW8.. - //--------------------// - //--- Preprocessor ---// -//--------------------// - -freadPreprocessedLine :: !*File -> (!.{#Char},!*File) -freadPreprocessedLine file - #! (line, file) = freadline file - | begins_with "/*2.0" line - = (replace_beginning_with "/***/" line, file) - | begins_with "0.2*/" line - = (replace_beginning_with "/***/" line, file) - | begins_with "//1.3" line - = (replace_beginning_with "/*1.3" line, file) - | begins_with "//3.1" line - = (replace_beginning_with "3.1*/" line, file) - = (line, file) - where - begins_with :: !String !String -> Bool - begins_with pattern line - # size_pattern = size pattern - | size line<size_pattern - = False - = loop pattern line (size_pattern-1) - loop :: !String !String !Int -> Bool - loop pattern line i - | i<0 - = True - | line.[i]<>pattern.[i] - = False - = loop pattern line (i-1) - replace_beginning_with :: !String !*String -> .String - replace_beginning_with replacement string - = { string & [i] = replacement.[i] \\ i<-[0..size replacement-1] } -// ..MW8 |