소스 검색

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

Lucas de Souza 6 년 전
부모
커밋
72281d9f7e
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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);
     }