diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/parser.mly | 7 | ||||
| -rw-r--r-- | src/sail_lib.ml | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/parser.mly b/src/parser.mly index 416d4d92..aa6c853d 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -163,12 +163,12 @@ let make_vector_sugar typ typ1 = %token <string> LtEqUnderUiI LtUnderSI LtUnderSiI LtUnderUI LtUnderUiI StarStarUnderSI StarStarUnderSiI StarUnderSI %token <string> StarUnderSiI StarUnderUI StarUnderUiI TwoCarrotI -%start file exp semi_exps +%start file nonempty_exp_list %type <Parse_ast.defs> defs %type <Parse_ast.atyp> typ %type <Parse_ast.pat> pat %type <Parse_ast.exp> exp -%type <Parse_ast.exp list> semi_exps +%type <Parse_ast.exp list> nonempty_exp_list %type <Parse_ast.defs> file @@ -1198,3 +1198,6 @@ file: | defs Eof { $1 } +nonempty_exp_list: + | semi_exps_help Eof { $1 } + diff --git a/src/sail_lib.ml b/src/sail_lib.ml index fca6e412..66db451a 100644 --- a/src/sail_lib.ml +++ b/src/sail_lib.ml @@ -11,7 +11,7 @@ module Pretty = Pretty_print let parse_exps s = let lexbuf = Lexing.from_string s in try - let pre_exps = Parser.semi_exps Lexer.token lexbuf in + let pre_exps = Parser.nonempty_exp_list Lexer.token lexbuf in List.map (Initial_check.to_ast_exp Type_internal.initial_kind_env) pre_exps with | Parsing.Parse_error -> |
