|
@@ -246,7 +246,7 @@ export class IVProgParser {
|
|
|
const eosToken = this.getToken();
|
|
|
if (eosToken.type === this.lexerClass.EOS && eosToken.text.match(';')) {
|
|
|
this.pos++;
|
|
|
- return;
|
|
|
+ return;
|
|
|
}
|
|
|
throw SyntaxErrorFactory.token_missing_one(';', eosToken);
|
|
|
}
|
|
@@ -294,7 +294,7 @@ export class IVProgParser {
|
|
|
// Check for array or vector
|
|
|
// ID[int/IDi?][int/IDj?]
|
|
|
if (this.checkOpenBrace(true)) {
|
|
|
- this.pos += 1;
|
|
|
+ this.pos += 1;
|
|
|
this.consumeNewLines();
|
|
|
dim1 = this.parseArrayDimension();
|
|
|
this.consumeNewLines();
|
|
@@ -389,7 +389,7 @@ export class IVProgParser {
|
|
|
if(dim2 == null) {
|
|
|
n_columns = new Expressions.IntLiteral(toInt(initial.columns));
|
|
|
n_columns.sourceInfo = sourceInfo;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
const declaration = new Commands.ArrayDeclaration(idString,
|
|
|
new ArrayType(typeString, dimensions), n_lines, n_columns, initial, isConst);
|
|
@@ -512,7 +512,7 @@ export class IVProgParser {
|
|
|
return exp;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
+ /**
|
|
|
* Returns a list of ArrayLiterals. Helper function for parsing matrices
|
|
|
*/
|
|
|
parseVectorList (typeString) {
|
|
@@ -547,7 +547,7 @@ export class IVProgParser {
|
|
|
const commaToken = this.getToken();
|
|
|
if(commaToken.type !== this.lexerClass.COMMA) {
|
|
|
break;
|
|
|
- }
|
|
|
+ }
|
|
|
this.pos += 1;
|
|
|
this.consumeNewLines();
|
|
|
}
|
|
@@ -603,7 +603,7 @@ export class IVProgParser {
|
|
|
this.pos++;
|
|
|
this.consumeNewLines();
|
|
|
if (!this.checkCloseParenthesis(true)) {
|
|
|
- formalParams = this.parseFormalParameters(); // formal parameters
|
|
|
+ formalParams = this.parseFormalParameters(); // formal parameters
|
|
|
this.consumeNewLines();
|
|
|
this.checkCloseParenthesis();
|
|
|
this.pos++;
|
|
@@ -694,7 +694,7 @@ export class IVProgParser {
|
|
|
const token = this.getToken();
|
|
|
if(token.type !== this.lexerClass.ID && token.type !== this.lexerClass.LIB_ID) {
|
|
|
throw SyntaxErrorFactory.id_missing(token);
|
|
|
- }
|
|
|
+ }
|
|
|
this.pos++;
|
|
|
return token.text;
|
|
|
}
|
|
@@ -721,7 +721,7 @@ export class IVProgParser {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
throw SyntaxErrorFactory.invalid_type(this.getTypeArray(), token);
|
|
|
}
|
|
|
|
|
@@ -1041,7 +1041,7 @@ export class IVProgParser {
|
|
|
}
|
|
|
if (for_from == null) {
|
|
|
// TODO better error message
|
|
|
- const keyword = this.lexer.literalNames[keyword_code];
|
|
|
+ const keyword = this.lexer.literalNames[keyword_code];
|
|
|
throw new Error("Error de sintaxe no comando repeita_para: "+ int_or_id.text + " não é compativel com o esperado para o paramentro "+ keyword + ". O valor deve ser um inteiro ou variável.");
|
|
|
}
|
|
|
if (is_unary_op) {
|
|
@@ -1146,7 +1146,7 @@ export class IVProgParser {
|
|
|
const finalExp = new Expressions.UnaryApp(not, exp1);
|
|
|
finalExp.sourceInfo = SourceInfo.createSourceInfo(opToken);
|
|
|
return finalExp;
|
|
|
-
|
|
|
+
|
|
|
} else {
|
|
|
return this.parseExpressionRel();
|
|
|
}
|
|
@@ -1253,7 +1253,7 @@ export class IVProgParser {
|
|
|
tokenB = this.getToken();
|
|
|
this.pos++;
|
|
|
}
|
|
|
- const sourceInfo = SourceInfo.createSourceInfoFromList(tokenA, tokenB);
|
|
|
+ const sourceInfo = SourceInfo.createSourceInfoFromList(tokenA, tokenB);
|
|
|
const exp = new Expressions.ArrayAccess(id, firstIndex, secondIndex);
|
|
|
exp.sourceInfo = sourceInfo;
|
|
|
return exp;
|