diff options
Diffstat (limited to 'calc1.pas')
| -rw-r--r-- | calc1.pas | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -180,12 +180,19 @@ begin Eat(TT_Integer); Op := Current; - Eat(TT_Minus); + + if Op.TokenType = TT_Plus then + Eat(TT_Plus) + else + Eat(TT_Minus); Right := Current; Eat(TT_Integer); - Result := TokenInteger(Left).Val - TokenInteger(Right).Val; + if Op.TokenType = TT_Plus then + Result := TokenInteger(Left).Val + TokenInteger(Right).Val + else + Result := TokenInteger(Left).Val - TokenInteger(Right).Val; end; var |
