diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -175,7 +175,7 @@ is_punct(const char *p) if (strchr("|=", p[0]) != NULL && p[1] == '>') return 2; - return (strchr("+-*/%()<>,;{}[]=&^|", p[0]) != NULL); + return (strchr("+-*/\\%()<>,;{}[]=&^|", p[0]) != NULL); } static unsigned char @@ -713,6 +713,10 @@ mul(Token **rest, Token *tok) continue; } + if (equal(tok, "\\")) { + node = new_binary(NOD_DIV, tok, primary(&tok, tok->next), node); + } + if (equal(tok, "%")) { node = new_binary(NOD_MOD, tok, node, primary(&tok, tok->next)); continue; |