Ver código fonte

Fix negative numbers raising SyntaxError

Lucas de Souza 6 anos atrás
pai
commit
ccb29bd2e2
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      js/ast/ivprogParser.js

+ 3 - 0
js/ast/ivprogParser.js

@@ -860,6 +860,9 @@ export class IVProgParser {
   parseTerm () {
     const token = this.getToken();
     switch(token.type) {
+      case this.lexerClass.SUM_OP:
+        this.pos++;
+        return new Expressions.UnaryApp(token.text, this.parseTerm());
       case this.lexerClass.INTEGER:
         this.pos++;
         return this.getIntLiteral(token);