Skip to content

Commit

Permalink
[Lua] Add _ENV and warn
Browse files Browse the repository at this point in the history
  • Loading branch information
mbartlett21 committed Feb 6, 2025
1 parent d83a550 commit daae3de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lua/Lua.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ contexts:

support:
- match: |-
(?x:_G|_VERSION){{identifier_break}}
(?x:_G|_VERSION|_ENV){{identifier_break}}
scope: support.constant.builtin.lua
pop: 1
Expand All @@ -566,7 +566,7 @@ contexts:
assert|collectgarbage|dofile|error|getmetatable|ipairs|load|loadfile
|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|select
|setmetatable|tonumber|tostring|type|xpcall
|require|getfenv|module|setfenv|unpack
|require|getfenv|module|setfenv|unpack|warn
){{function_call_ahead}}
scope: meta.function-call.lua support.function.builtin.lua
pop: 1
Expand Down
6 changes: 6 additions & 0 deletions Lua/tests/syntax_test_lua_support.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
_G;
-- ^^ support.constant.builtin

_ENV;
-- ^^^^ support.constant.builtin

_VERSION;
-- ^^^^^^^^ support.constant.builtin

Expand All @@ -18,6 +21,9 @@
error();
-- ^^^^^ support.function.builtin

warn();
-- ^^^^ support.function.builtin

getfenv();
-- ^^^^^^^ support.function.builtin

Expand Down

0 comments on commit daae3de

Please sign in to comment.