fix lexer/parser bugs, add code in file-thread.sml to handle loading/saving of files (but loading is not completely finished yet)
This commit is contained in:
@@ -17,7 +17,7 @@ struct
|
||||
SOME (lastSpace, acc)
|
||||
else
|
||||
let
|
||||
val str = String.substring (str, min, finish - min)
|
||||
val str = String.substring (str, min, finish - min + 1)
|
||||
in
|
||||
if min = lastInt then
|
||||
case Int.fromString str of
|
||||
@@ -33,14 +33,15 @@ struct
|
||||
end
|
||||
|
||||
fun scanStep (pos, str, acc, dfa, finish) =
|
||||
if AllDfa.areAllDead dfa then
|
||||
if pos < 0 orelse AllDfa.areAllDead dfa then
|
||||
addToken (acc, dfa, str, finish)
|
||||
else
|
||||
let
|
||||
val chr = String.sub (str, pos)
|
||||
val dfa = AllDfa.update (chr, dfa, pos)
|
||||
in
|
||||
scanStep (pos - 1, str, acc, dfa, finish)
|
||||
if AllDfa.areAllDead dfa then addToken (acc, dfa, str, finish)
|
||||
else scanStep (pos - 1, str, acc, dfa, finish)
|
||||
end
|
||||
|
||||
fun scanLoop (pos, str, acc) =
|
||||
|
||||
Reference in New Issue
Block a user