Add built-in functions
All checks were successful
continuous-integration/drone/push Build is passing

This is a good proxy test to ensure that scope queries work correctly.
This commit is contained in:
Bruno BELANYI 2022-06-03 21:04:40 +02:00
parent 073ff80adb
commit 2d89ec8b20
2 changed files with 26 additions and 0 deletions

View file

@ -1,3 +1,10 @@
; Built-ins {{{
((function_call
function: (identifier) @function.builtin)
(#match? @function.builtin "^(chr|concat|exit|flush|getchar|not|ord|print|print_err|print_int|size|strcmp|streq|substring)$")
(#is-not? local))
; }}}
; Keywords {{{
[
"function"

View file

@ -0,0 +1,19 @@
let
var a := exit(0)
/* ^ function.builtin */
primitive exit(ret: int) /* Shadowing the prelude-included built-in */
var b := exit(0)
/* ^ function */
in
exit(1);
/* <- function */
print("shadowing is fun");
/* <- function.builtin */
b := print
/* ^ variable */
end