summaryrefslogtreecommitdiff
path: root/src/process_file.ml
diff options
context:
space:
mode:
authorKathy Gray2013-11-28 17:07:32 +0000
committerKathy Gray2013-11-28 17:07:32 +0000
commitdcc2ec2e4e6a3fd9a393af64d45bdf659201da03 (patch)
tree86ae08b56d12ed2e073ea984daee637b3f1afbb1 /src/process_file.ml
parent2b30446b6d2c5ae4accb7e4d00e9af5426990aee (diff)
Updated syntax with working examples
Diffstat (limited to 'src/process_file.ml')
-rw-r--r--src/process_file.ml5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/process_file.ml b/src/process_file.ml
index 35a84b21..b07caca4 100644
--- a/src/process_file.ml
+++ b/src/process_file.ml
@@ -62,6 +62,7 @@ let get_lexbuf fn =
let parse_file (f : string) : Parse_ast.defs =
let scanbuf = get_lexbuf f in
+ let default_type_names = ["bool";"unit";"vector";"enum";"list";"bit";"nat"] in
let type_names =
try
Pre_parser.file Pre_lexer.token scanbuf
@@ -73,14 +74,14 @@ let parse_file (f : string) : Parse_ast.defs =
raise (Reporting_basic.Fatal_error (Reporting_basic.Err_syntax_locn (l, m)))
| Lexer.LexError(s,p) ->
raise (Reporting_basic.Fatal_error (Reporting_basic.Err_lex (p, s))) in
- let _ = Lexer.type_names != ref type_names in
+ let _ = Lexer.type_names := (default_type_names@type_names) in
let lexbuf = get_lexbuf f in
try
Parser.file Lexer.token lexbuf
with
| Parsing.Parse_error ->
let pos = Lexing.lexeme_start_p lexbuf in
- raise (Reporting_basic.Fatal_error (Reporting_basic.Err_syntax (pos, "")))
+ raise (Reporting_basic.Fatal_error (Reporting_basic.Err_syntax (pos, "main")))
| Parse_ast.Parse_error_locn(l,m) ->
raise (Reporting_basic.Fatal_error (Reporting_basic.Err_syntax_locn (l, m)))
| Lexer.LexError(s,p) ->