highlights(lua): next as builtin function

This commit is contained in:
numToStr 2021-12-13 22:18:00 +05:30 committed by Stephan Seitz
parent 143ef2f066
commit 63630ec082
2 changed files with 16 additions and 0 deletions

View file

@ -150,6 +150,9 @@
"rawequal" "rawget" "rawset" "require" "select" "setfenv" "setmetatable"
"tonumber" "tostring" "type" "unpack" "xpcall"))
;; built-in next function
(next) @function.builtin
;; Parameters
(parameters
(identifier) @parameter)

View file

@ -0,0 +1,13 @@
local a = { 1, 2, 3, 4, 5 }
-- ^ TSNumber ^ TSPunctBracket
-- ^ TSVariable
local _ = next(a)
-- ^ TSFuncBuiltin
-- ^ TSKeyword
_ = next(a)
-- ^ TSFuncBuiltin
next(a)
-- ^ TSFuncBuiltin