Ver código fonte

Implement Declarations and Parameters type check (partially)

-Refactor commands & expressions to include line/column information
-Still missing function body semantic check
Lucas de Souza 6 anos atrás
pai
commit
9a01ef980d
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      js/ast/ivprogParser.js

+ 2 - 2
js/ast/ivprogParser.js

@@ -3,6 +3,7 @@ import * as Expressions from './expressions/';
 import * as Commands from './commands/';
 import { SourceInfo } from './sourceInfo';
 import { Types, toInt, toString, toBool } from './types';
+import { SourceInfo } from './sourceInfo';
 import { convertFromString } from './operators';
 import { SyntaxErrorFactory } from './error/syntaxErrorFactory';
 import { LanguageDefinedFunction } from './../processor/definedFunctions';
@@ -351,9 +352,8 @@ export class IVProgParser {
 
   getBoolLiteral (token) {
     const val = toBool(token.text);
-    const sourceInfo = SourceInfo.createSourceInfo(token);
     const exp = new Expressions.BoolLiteral(val);
-    exp.sourceInfo = sourceInfo;
+    exp.sourceInfo = SourceInfo.createSourceInfo(token);;
     return exp;
   }