1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-08 17:54:40 +00:00

Fixed bresenham array again

This commit is contained in:
jespergravgaard 2017-05-31 01:12:23 +02:00
parent 0bdd9d2f2e
commit 0f3da0ea3e
3 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,9 @@
lda #<{cowo1}
clc
adc {zpwo1}
sta !s+ +1
lda #>{cowo1}
adc {zpwo1}+1
sta !s+ +2
lda #{coby2}
!s: sta {cowo1}

View File

@ -88,6 +88,11 @@ public class PassTypeInference {
if(type1==null && type2 instanceof SymbolTypePointer) {
return ((SymbolTypePointer) type2).getElementType();
}
if (SymbolTypeBasic.WORD.equals(type1) || SymbolTypeBasic.WORD.equals(type2)) {
return SymbolTypeBasic.WORD;
} else if (SymbolTypeBasic.BYTE.equals(type1) && SymbolTypeBasic.BYTE.equals(type2)) {
return SymbolTypeBasic.BYTE;
}
throw new RuntimeException("Type inference case not handled " + type1 + " " + operator + " " + type2);
case "/":
if (SymbolTypeBasic.WORD.equals(type1) || SymbolTypeBasic.WORD.equals(type2)) {

View File

@ -13,7 +13,7 @@ import java.util.List;
/** Test my KickC Grammar */
public class Main {
public static void main(String[] args) throws IOException {
final String fileName = "src/dk/camelot64/kickc/test/sprtabs.kc";
final String fileName = "src/dk/camelot64/kickc/test/bresenhamarr.kc";
final CharStream input = CharStreams.fromFileName(fileName);
System.out.println(input.toString());
KickCLexer lexer = new KickCLexer(input);