Skip to content

Commit

Permalink
examples
Browse files Browse the repository at this point in the history
  • Loading branch information
irmen committed Aug 24, 2019
1 parent 7caa0da commit 59a4388
Show file tree
Hide file tree
Showing 4 changed files with 788 additions and 384 deletions.
1 change: 1 addition & 0 deletions compiler/src/prog8/ast/processing/AstChecker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ internal class AstChecker(private val program: Program,
checkResult.add(ExpressionError("uword loop variable can only loop over unsigned bytes, words or strings", forLoop.position))
}
DataType.BYTE -> {
// TODO fix this, it should allow: for bb in [1,2,3]
if(iterableDt!= DataType.BYTE && iterableDt!= DataType.ARRAY_B)
checkResult.add(ExpressionError("byte loop variable can only loop over bytes", forLoop.position))
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/prog8/compiler/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fun compileProgram(filepath: Path,
programAst.checkValid(compilerOptions) // check if final tree is valid
programAst.checkRecursion() // check if there are recursive subroutine calls

printAst(programAst)
// printAst(programAst)

if(writeAssembly) {
// asm generation directly from the Ast, no need for intermediate code
Expand Down
Loading

0 comments on commit 59a4388

Please sign in to comment.