diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Parser/Parser.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Parser/Parser.cc b/lib/Parser/Parser.cc index ee94b36..998d50b 100644 --- a/lib/Parser/Parser.cc +++ b/lib/Parser/Parser.cc @@ -9,12 +9,18 @@ Parser::Parser(Lexer &L) : Lex(L) { BinopPrecedence[tok_ne] = 10; BinopPrecedence[tok_le] = 10; BinopPrecedence[tok_ge] = 10; + BinopPrecedence['<'] = 10; BinopPrecedence['>'] = 10; + + BinopPrecedence['+'] = 20; + BinopPrecedence['-'] = 20; + BinopPrecedence['*'] = 40; + BinopPrecedence['/'] = 40; } int Parser::GetTokPrecedence() { - if (!isascii(CurTok)) return -1; + if (BinopPrecedence.find(CurTok) == BinopPrecedence.end()) return -1; int TokPrec = BinopPrecedence[CurTok]; if (TokPrec <= 0) return -1; return TokPrec; |
