Skip to content

Commit

Permalink
comment about builtin function call ast node type
Browse files Browse the repository at this point in the history
  • Loading branch information
irmen committed Oct 1, 2024
1 parent 70a2b11 commit ea3871d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions compiler/res/prog8lib/cx16/graphics.p8
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
%import syslib
%import textio

; Bitmap pixel graphics module for the CommanderX16
; Wraps the graphics functions that are in ROM.
Expand Down Expand Up @@ -35,7 +34,7 @@ graphics {
sub disable_bitmap_mode() {
; enables text mode, erase the text screen, color white
void cx16.screen_mode(0, false)
txt.clear_screen()
cbm.CHROUT(147)
}


Expand Down
4 changes: 4 additions & 0 deletions compiler/src/prog8/compiler/astprocessing/AstChecker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1272,11 +1272,15 @@ internal class AstChecker(private val program: Program,
}

override fun visit(bfc: BuiltinFunctionCall) {
// most function calls, even to builtin functions, are still regular FunctionCall nodes here.
// they get converted to the more specialized node type in BeforeAsmTypecastCleaner
checkLongType(bfc)
super.visit(bfc)
}

override fun visit(functionCallStatement: FunctionCallStatement) {
// most function calls, even to builtin functions, are still regular FunctionCall nodes here.
// they get converted to the more specialized node type in BeforeAsmTypecastCleaner
val targetStatement = functionCallStatement.target.checkFunctionOrLabelExists(program, functionCallStatement, errors)
if(targetStatement!=null) {
checkFunctionCall(targetStatement, functionCallStatement.args, functionCallStatement.position)
Expand Down
1 change: 1 addition & 0 deletions compiler/test/TestCompilerOnExamples.kt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ class TestCompilerOnExamplesBothC64andCx16: FunSpec({
"cube3d-gfx",
"dirlist",
"fibonacci",
"fractal-tree",
"line-circle-gfx",
"line-circle-txt",
"maze",
Expand Down
1 change: 0 additions & 1 deletion docs/source/todo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Future Things and Ideas

- Add a new SublimeText syntax file for prog8, and also install this for bat: https://github.com/sharkdp/bat?tab=readme-ov-file#adding-new-syntaxes--language-definitions
- callfar() should allow setting an argument in the X register as well?
- AST weirdness: why is call(...) a normal FunctionCallStatement and not a BuiltinFunctionCall? What does ror() produce for instance?
- Can we support signed % (remainder) somehow?
- Don't add "random" rts to %asm blocks but instead give a warning about it? (but this breaks existing behavior that others already depend on... command line switch? block directive?)
- IR: implement missing operators in AssignmentGen (array shifts etc)
Expand Down
2 changes: 1 addition & 1 deletion examples/test.p8
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

main {
sub start() {
word x1 = -118
word @shared x1 = -118
floats.print(x1 as float)
txt.nl()
floats.print(x1 as float/1.9)
Expand Down

0 comments on commit ea3871d

Please sign in to comment.