Quellcode durchsuchen

[FIX] Bug where non-const declaration would have a wrong type assigned

Lucas de Souza vor 6 Jahren
Ursprung
Commit
72281d9f7e
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      js/ast/ivprogParser.js

+ 2 - 2
js/ast/ivprogParser.js

@@ -220,8 +220,8 @@ export class IVProgParser {
       const typeString = this.parseType();
       return this.parseDeclararion(typeString, true);
     } else if(this.isVariableType(constToken)) {
-      this.pos++;
-      return this.parseDeclararion(constToken);
+      const typeString = this.parseType();
+      return this.parseDeclararion(typeString);
     } else {
       throw SyntaxError.createError(this.lexer.literalNames[this.lexerClass.RK_CONST] + ' or ' + this.getTypesAsString(), constToken);
     }