Add built-in functions
All checks were successful
continuous-integration/drone/push Build is passing
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:
parent
073ff80adb
commit
2d89ec8b20
|
@ -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"
|
||||
|
|
19
test/highlight/built-ins.tig
Normal file
19
test/highlight/built-ins.tig
Normal 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
|
Loading…
Reference in a new issue