|
@@ -358,6 +358,14 @@ export class IVProgParser {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if(dimensions === 1 && !initial.isVector) {
|
|
|
+ const expString = initial.toString();
|
|
|
+ throw SyntaxErrorFactory.matrix_to_vector_attr(idString, expString, initial.sourceInfo);
|
|
|
+ } else if (dimensions > 1 && initial.isVector) {
|
|
|
+ const expString = initial.toString();
|
|
|
+ throw SyntaxErrorFactory.vector_to_matrix_attr(idString, expString, initial.sourceInfo);
|
|
|
+ }
|
|
|
+
|
|
|
if(dim1 == null) {
|
|
|
n_lines = new Expressions.IntLiteral(toInt(initial.lines));
|
|
|
n_lines.sourceInfo = sourceInfo;
|
|
@@ -478,6 +486,8 @@ export class IVProgParser {
|
|
|
let dataDim = 1;
|
|
|
if(data[0] instanceof Expressions.ArrayLiteral) {
|
|
|
dataDim += 1;
|
|
|
+ } else if(data.length == 1) {
|
|
|
+ console.log("Talvez uma variável seja uma melhor opção");
|
|
|
}
|
|
|
const type = new CompoundType(typeString, dataDim);
|
|
|
const exp = new Expressions.ArrayLiteral(type, data);
|
|
@@ -525,6 +535,9 @@ export class IVProgParser {
|
|
|
this.pos += 1;
|
|
|
this.consumeNewLines();
|
|
|
}
|
|
|
+ if(list.length == 1) {
|
|
|
+ console.log("Talvez um vetor seja uma melhor opção");
|
|
|
+ }
|
|
|
return list
|
|
|
}
|
|
|
|