Replace print/println keywords with generic function call mechanism
- Add NODE_CALL with name, args, and arg_count to parser - Add TOK_COMMA token and tokenize (, ), , in lexer - Remove TOK_PRINT/TOK_PRINTLN keywords; print/println are now regular identifiers resolved as built-in functions in the evaluator - Add NODE_CALL debug output in ast_print
This commit is contained in:
11
projects/functions.j
Normal file
11
projects/functions.j
Normal file
@@ -0,0 +1,11 @@
|
||||
x = "Hello world!"
|
||||
y = 21
|
||||
println()
|
||||
println(x)
|
||||
print("y=")
|
||||
println(y)
|
||||
|
||||
dummy()
|
||||
|
||||
if y > 1:
|
||||
println("OK!")
|
||||
Reference in New Issue
Block a user