diff options
| author | Kathy Gray | 2016-02-04 13:25:35 +0000 |
|---|---|---|
| committer | Kathy Gray | 2016-02-04 13:25:35 +0000 |
| commit | bc663454a3273fe1fb9c150caf7e3849c3fbd2ea (patch) | |
| tree | 47d862ff33b87817489d2cf765ba0c3b8c3d8d4b /src | |
| parent | 18df38a268b17d9a9b9b284efd8065951a702040 (diff) | |
add mod_s to lexer and parser
Diffstat (limited to 'src')
| -rw-r--r-- | src/lexer.mll | 1 | ||||
| -rw-r--r-- | src/parser.mly | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/lexer.mll b/src/lexer.mll index a6b1bcfa..341b2197 100644 --- a/src/lexer.mll +++ b/src/lexer.mll @@ -108,6 +108,7 @@ let kw_table = ("div", (fun x -> Div_)); ("mod", (fun x -> Mod)); + ("mod_s", (fun x -> ModUnderS)); ("quot", (fun x -> Quot)); ("quot_s", (fun x -> QuotUnderS)); ("rem", (fun x -> Rem)); diff --git a/src/parser.mly b/src/parser.mly index 7bd0a72f..27bc249a 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -142,7 +142,7 @@ let make_vector_sugar order_set is_inc typ typ1 = %nonassoc Then %nonassoc Else -%token Div_ Mod Quot Rem QuotUnderS +%token Div_ Mod ModUnderS Quot Rem QuotUnderS %token Bar Comma Dot Eof Minus Semi Under %token Lcurly Rcurly Lparen Rparen Lsquare Rsquare @@ -686,7 +686,9 @@ star_exp: | star_exp Rem starstar_exp { eloc (E_app_infix($1,Id_aux(Id("rem"), locn 2 2), $3)) } | star_exp Mod starstar_exp - { eloc (E_app_infix($1,Id_aux(Id("mod"), locn 2 2), $3)) } + { eloc (E_app_infix($1,Id_aux(Id("mod"), locn 2 2), $3)) } + | star_exp ModUnderS starstar_exp + { eloc (E_app_infix($1,Id_aux(Id("mod_s"), locn 2 2), $3)) } | star_exp StarUnderS starstar_exp { eloc (E_app_infix($1,Id_aux(Id($2), locn 2 2), $3)) } | star_exp StarUnderSi starstar_exp @@ -713,6 +715,8 @@ star_right_atomic_exp: { eloc (E_app_infix($1,Id_aux(Id("rem"), locn 2 2), $3)) } | star_exp Mod starstar_right_atomic_exp { eloc (E_app_infix($1,Id_aux(Id("mod"), locn 2 2), $3)) } + | star_exp ModUnderS starstar_right_atomic_exp + { eloc (E_app_infix($1,Id_aux(Id("mod_s"), locn 2 2), $3)) } | star_exp StarUnderS starstar_right_atomic_exp { eloc (E_app_infix($1,Id_aux(Id($2), locn 2 2), $3)) } | star_exp StarUnderSi starstar_right_atomic_exp |
