diff options
author | Simon Van Casteren <simonvancasteren@localhost.localdomain> | 2019-12-12 22:44:50 +0100 |
---|---|---|
committer | Simon Van Casteren <simonvancasteren@localhost.localdomain> | 2019-12-13 11:46:57 +0100 |
commit | faff2d8ac927fd49f13fbaf9b84ffc99bbb6f9b8 (patch) | |
tree | 557c53bb80d4cbf286149504580886cd4259b3f2 /src/json.sml | |
parent | 9b00dc724363ac7b0a31687f14cc3bb2f2460f9b (diff) |
Added tracking of text of source files and autocomplete
Diffstat (limited to 'src/json.sml')
-rw-r--r-- | src/json.sml | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/json.sml b/src/json.sml index 656d28ff..4f604cc4 100644 --- a/src/json.sml +++ b/src/json.sml @@ -113,13 +113,20 @@ struct and parseChars () = let + val escapedchars = ["n", "r", "b", "f", "t"] fun pickChars s = - if peek () = #"\"" (* " *) + if peek () = #"\"" (* " = end of string *) then s else if peek () = #"\\" andalso (String.sub (!inputData, 1)) = #"\"" then (consume "\\\""; pickChars (s ^ "\"")) - else pickChars (s ^ String.str (take ())) + else + if peek () = #"\\" andalso (String.sub (!inputData, 1)) = #"n" + then (consume "\\n"; pickChars (s ^ "\n")) + else + if peek () = #"\\" andalso (String.sub (!inputData, 1)) = #"r" + then (consume "\\r"; pickChars (s ^ "\r")) + else pickChars (s ^ String.str (take ())) in pickChars "" end |