diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2015-11-13 15:20:12 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2015-11-13 15:20:12 +0100 |
commit | 3f24b362f5ac2aa252ee14f1b793ebbf2f69ff08 (patch) | |
tree | fe290a38c7675f965d0ffb67cde20d161ce4444e /cparser/deLexer.ml | |
parent | 4fad3b8da1227d4f5f7ff7d6cd2dbd2565d06ce4 (diff) | |
parent | d90ba4443294b80bd940daedfdcdc3d4334fdc7c (diff) | |
download | compcert-3f24b362f5ac2aa252ee14f1b793ebbf2f69ff08.tar.gz compcert-3f24b362f5ac2aa252ee14f1b793ebbf2f69ff08.zip |
Merge branch 'master' of ssh://github.com/AbsInt/CompCert
Diffstat (limited to 'cparser/deLexer.ml')
-rw-r--r-- | cparser/deLexer.ml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cparser/deLexer.ml b/cparser/deLexer.ml index 00308e4b..3aa168da 100644 --- a/cparser/deLexer.ml +++ b/cparser/deLexer.ml @@ -65,6 +65,7 @@ let delex (symbol : string) : string = | "WHILE" -> "while" | "TYPEDEF_NAME" -> "t" (* this should be a type name *) | "VAR_NAME" -> "x" (* this should be a variable name *) + | "PRE_NAME" -> "" | "CONSTANT" -> "42" | "STRING_LITERAL" -> "\"\"" | "ELLIPSIS" -> "..." @@ -121,6 +122,8 @@ let delex (symbol : string) : string = let delex sentence = let symbols = Str.split (Str.regexp " ") sentence in + if List.nth symbols (List.length symbols - 1) = "PRE_NAME" then + failwith "token sequence terminating with PRE_NAME"; let symbols = List.map delex symbols in List.iter (fun symbol -> Printf.printf "%s " symbol |