summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2013-11-19 13:46:24 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2013-11-19 13:46:24 +0100
commit18c57ed99f55c999080000ebe12ffbae68357eee (patch)
tree70bd7df003f5f379cc086862594dcf7854ed3f38
parentf20d043f9d9ace0ed6cd1359c8308c0eb39e0919 (diff)
downloadLPC-Projet-18c57ed99f55c999080000ebe12ffbae68357eee.tar.gz
LPC-Projet-18c57ed99f55c999080000ebe12ffbae68357eee.zip
Corrected parsing problem...
-rw-r--r--src/parser.mly12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/parser.mly b/src/parser.mly
index 307a679..eb0a959 100644
--- a/src/parser.mly
+++ b/src/parser.mly
@@ -224,7 +224,7 @@ expression:
| e1 = expression ASSIGN e2 = expression { EAssign(e1, e2) }
| a = expression b = binop c = expression { EBinary(a, b, c) }
| a = expression LPAREN arg = separated_list(COMMA, expression) RPAREN { ECall(a, arg) }
-| a = unop { a }
+| a = lunop { a }
| NEW c = TIDENT LPAREN args = separated_list(COMMA, expression) RPAREN { ENew(c, args) }
;
@@ -256,10 +256,10 @@ primary:
| a = primary DOT b = IDENT { EMember(a, b) }
;
-unop:
-| e = lunop { e }
-| e = unop INCR { EUnary(PostIncr, e) }
-| e = unop DECR { EUnary(PostDecr, e) }
+runop:
+| e = primary { e }
+| e = runop INCR { EUnary(PostIncr, e) }
+| e = runop DECR { EUnary(PostDecr, e) }
;
lunop:
@@ -270,7 +270,7 @@ lunop:
| TIMES e = lunop { EUnary(Deref, e) }
| INCR e = lunop { EUnary(PreIncr, e) }
| DECR e = lunop { EUnary(PreDecr, e) }
-| e = primary { e }
+| e = runop { e }
;
str_expression: