mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-11-20 02:32:36 +00:00
Aligned error messages.
This commit is contained in:
parent
23a91ef3d3
commit
c33794f776
@ -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));
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user