diff options
| author | Alasdair Armstrong | 2018-12-07 21:53:29 +0000 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-12-07 21:53:29 +0000 |
| commit | 2c25110ad2f5e636239ba65a2154aae79ffa253c (patch) | |
| tree | 51cdd81ea260dacd0faa1aed476ae95a2f3cc322 /src/parser.mly | |
| parent | 25ab845211e3df24386a0573b517a01dab879b03 (diff) | |
Working on better flow typing for ASL
On a new branch because it's completely broken everything for now
Diffstat (limited to 'src/parser.mly')
| -rw-r--r-- | src/parser.mly | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/parser.mly b/src/parser.mly index bb5aa5f1..fa36591c 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -175,7 +175,7 @@ let rec desugar_rchain chain s e = /*Terminals with no content*/ %token And As Assert Bitzero Bitone By Match Clause Dec Default Effect End Op Where -%token Enum Else False Forall Foreach Overload Function_ Mapping If_ In Inc Let_ Int Order Cast +%token Enum Else False Forall Foreach Overload Function_ Mapping If_ In Inc Let_ Int Order Bool Cast %token Pure Register Return Scattered Sizeof Struct Then True TwoCaret TYPE Typedef %token Undefined Union Newtype With Val Constant Constraint Throw Try Catch Exit Bitfield %token Barr Depend Rreg Wreg Rmem Rmemt Wmem Wmv Wmvt Eamem Exmem Undef Unspec Nondet Escape @@ -563,6 +563,8 @@ kind: { K_aux (K_type, loc $startpos $endpos) } | Order { K_aux (K_order, loc $startpos $endpos) } + | Bool + { K_aux (K_bool, loc $startpos $endpos) } kopt: | Lparen kid Colon kind Rparen @@ -1154,9 +1156,13 @@ typaram: type_def: | Typedef id typaram Eq typ - { mk_td (TD_abbrev ($2, mk_namesectn, mk_typschm $3 $5 $startpos($3) $endpos)) $startpos $endpos } + { mk_td (TD_abbrev ($2, $3, K_aux (K_type, Parse_ast.Unknown), $5)) $startpos $endpos } | Typedef id Eq typ - { mk_td (TD_abbrev ($2, mk_namesectn, mk_typschm mk_typqn $4 $startpos($4) $endpos)) $startpos $endpos } + { mk_td (TD_abbrev ($2, mk_typqn, K_aux (K_type, Parse_ast.Unknown), $4)) $startpos $endpos } + | Typedef id typaram MinusGt kind Eq typ + { mk_td (TD_abbrev ($2, $3, $5, $7)) $startpos $endpos } + | Typedef id Colon kind Eq typ + { mk_td (TD_abbrev ($2, mk_typqn, $4, $6)) $startpos $endpos } | Struct id Eq Lcurly struct_fields Rcurly { mk_td (TD_record ($2, mk_namesectn, TypQ_aux (TypQ_tq [], loc $endpos($2) $startpos($3)), $5, false)) $startpos $endpos } | Struct id typaram Eq Lcurly struct_fields Rcurly |
