mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-02-21 22:29:07 +00:00
Added example of cast error giving an exception. #260
This commit is contained in:
parent
c10d646a5d
commit
88cc028285
@ -115,7 +115,6 @@ switchCase:
|
||||
'case' expr ':' stmtSeq?
|
||||
;
|
||||
|
||||
|
||||
forLoop
|
||||
: forClassicInit ';' commaExpr ';' commaExpr? #forClassic
|
||||
| declTypes? NAME ':' expr ( '..' ) expr #forRange
|
||||
|
@ -4,6 +4,7 @@ import dk.camelot64.kickc.Compiler;
|
||||
import dk.camelot64.kickc.NumberParser;
|
||||
import dk.camelot64.kickc.asm.AsmClobber;
|
||||
import dk.camelot64.kickc.model.*;
|
||||
import dk.camelot64.kickc.model.InternalError;
|
||||
import dk.camelot64.kickc.model.operators.*;
|
||||
import dk.camelot64.kickc.model.statements.*;
|
||||
import dk.camelot64.kickc.model.symbols.*;
|
||||
@ -972,6 +973,11 @@ public class Pass0GenerateStatementSequence extends KickCBaseVisitor<Object> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object visitStmtSwitch(KickCParser.StmtSwitchContext ctx) {
|
||||
throw new InternalError("switch() is not supported in this version of the compiler.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object visitStmtFor(KickCParser.StmtForContext ctx) {
|
||||
this.visit(ctx.forLoop());
|
||||
|
6
src/test/kc/cast-error.kc
Normal file
6
src/test/kc/cast-error.kc
Normal file
@ -0,0 +1,6 @@
|
||||
// Results in exception instead of a nice error message
|
||||
// Reported by Paul Gardner-Stephen
|
||||
|
||||
void main() {
|
||||
*$d020 = $01;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user