1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-26 18:29:54 +00:00

Aligned error messages.

This commit is contained in:
jespergravgaard 2019-12-25 17:10:40 +01:00
parent 23a91ef3d3
commit c33794f776
2 changed files with 2 additions and 2 deletions

View File

@ -1609,7 +1609,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
public Object visitExprAssignment(KickCParser.ExprAssignmentContext ctx) {
Object val = visit(ctx.expr(0));
if(val instanceof ConstantRef) {
throw new CompileError("Error! Constants can not be modified " + val.toString(), new StatementSource(ctx));
throw new CompileError("const variable may not be modified " + val.toString(), new StatementSource(ctx));
}
if(!(val instanceof LValue)) {
throw new CompileError("Error! Illegal assignment Lvalue " + val.toString(), new StatementSource(ctx));

View File

@ -64,7 +64,7 @@ public class TestPrograms {
@Test
public void testNomodify0() throws IOException, URISyntaxException {
assertError("nomodify-0", "Constants can not be modified");
assertError("nomodify-0", "const variable may not be modified");
}
@Test