summaryrefslogtreecommitdiff
path: root/tokenizer.fun
diff options
context:
space:
mode:
Diffstat (limited to 'tokenizer.fun')
-rw-r--r--tokenizer.fun21
1 files changed, 21 insertions, 0 deletions
diff --git a/tokenizer.fun b/tokenizer.fun
index cce6bea..80200d5 100644
--- a/tokenizer.fun
+++ b/tokenizer.fun
@@ -253,6 +253,9 @@ struct
fun clKw tk (ppc, NONE) = (ppc, SOME tk)
| clKw _ _ = raise Unreachable
+
+ val res = ST.getId symtab "0"
+ val () = if res <> 0 then raise Unreachable else ()
in
app (fn (tk, repr) =>
if ?repr = ppcPrefix then
@@ -576,6 +579,24 @@ struct
| _ => (c, stream)
end
+ fun strlit2charList (s: string) =
+ let
+ val s = String.substring (s, 1, size s - 2)
+ val stream = S.createFromString s
+
+ fun collect acc stream =
+ let
+ val (c, stream) = getMaybeBackslashed stream
+ in
+ case c of
+ Reg #"\000" => rev $ #"\000" :: acc
+ | Reg c | EscSeqed c => collect (c :: acc) stream
+ | NoChar => raise Unreachable
+ end
+ in
+ collect [] stream
+ end
+
fun parseCharConst symtab stream =
let
val startOff = S.getOffset stream - 1