diff options
-rw-r--r-- | lib/lexer.mll | 1 | ||||
-rw-r--r-- | lib/qsp_instruction.mly | 2 | ||||
-rw-r--r-- | lib/tokens.mly | 1 | ||||
-rw-r--r-- | syntax/t.ml | 2 |
4 files changed, 5 insertions, 1 deletions
diff --git a/lib/lexer.mll b/lib/lexer.mll index 7d5b867..d3d5e5b 100644 --- a/lib/lexer.mll +++ b/lib/lexer.mll @@ -245,6 +245,7 @@ rule token = parse | '-' { MINUS } | "+=" { INCR } | "-=" { DECR } +| "*=" { MULT_EQUAL } | '/' { DIV } | '*' { STAR } | ':' { diff --git a/lib/qsp_instruction.mly b/lib/qsp_instruction.mly index cfc6124..cc0520f 100644 --- a/lib/qsp_instruction.mly +++ b/lib/qsp_instruction.mly @@ -64,6 +64,8 @@ assignation_operator: | EQUAL { T.Eq' } | INCR { T.Inc } | DECR { T.Decr } + | DECR { T.Decr } + | MULT_EQUAL { T.Mult } inline_instruction: | hd = inline_instruction diff --git a/lib/tokens.mly b/lib/tokens.mly index 7720440..1c199fa 100644 --- a/lib/tokens.mly +++ b/lib/tokens.mly @@ -4,6 +4,7 @@ %token PLUS %token MINUS %token INCR DECR +%token MULT_EQUAL %token STAR %token DIV %token MOD diff --git a/syntax/t.ml b/syntax/t.ml index 0014d47..9c25647 100644 --- a/syntax/t.ml +++ b/syntax/t.ml @@ -20,7 +20,7 @@ type boperator = and uoperator = No | Neg | Add [@@deriving eq, show] -and assignation_operator = Eq' | Inc (** += *) | Decr (** -= *) +and assignation_operator = Eq' | Inc (** += *) | Decr (** -= *) | Mult [@@deriving eq, show] type function_ = |