Fix negative number syntax. Add a unary '-' operator.

Closes #63.
This commit is contained in:
Stephen Dolan committed 2013-01-03 12:53:23 +00:00
1 parent c013b557a2
commit 925ec3751f
4 files changed
+28 -1

No files matched your search

+4
View File
@@ -260,6 +260,10 @@ Exp "+=" Exp {
$$ = gen_update($1, $3, '+');
} |
'-' Exp {
$$ = BLOCK($2, gen_call("_negate", gen_noop()));
} |
Exp '-' Exp {
$$ = gen_binop($1, $3, '-');
} |