Skip to content

Commit

Permalink
[Lua] Use detailed scope for true/false
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <[email protected]>
  • Loading branch information
jfcherng committed Jul 13, 2024
1 parent 7c8b22d commit 9224f35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions Lua/Lua.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,11 @@ contexts:
pop: 1

builtin:
- match: (?:true|false){{identifier_break}}
scope: constant.language.boolean.lua
- match: false{{identifier_break}}
scope: constant.language.boolean.false.lua
pop: 1
- match: true{{identifier_break}}
scope: constant.language.boolean.true.lua
pop: 1
- match: nil{{identifier_break}}
scope: constant.language.null.lua
Expand Down
10 changes: 5 additions & 5 deletions Lua/tests/syntax_test_lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@
--CONSTANTS

true;
-- ^^^^ constant.language.boolean.lua
-- ^^^^ constant.language.boolean.true

false;
-- ^^^^^ constant.language.boolean.lua
-- ^^^^^ constant.language.boolean.false

nil;
-- ^^^ constant.language.null
Expand Down Expand Up @@ -342,7 +342,7 @@

not true;
-- ^^^ keyword.operator.logical
-- ^^^^ constant.language.boolean.lua
-- ^^^^ constant.language.boolean.true

2 + 2 - 2 * 2 / 2 // 2 % 2 ^ 2;
-- ^ keyword.operator.arithmetic
Expand Down Expand Up @@ -490,7 +490,7 @@
foo[return] foo[false]
-- ^^^^^^ invalid.unexpected-keyword.lua
-- ^ - meta.brackets
-- ^^^^^ constant.language.boolean.lua
-- ^^^^^ constant.language.boolean.false

some.return
-- ^^^^^^ invalid.unexpected-keyword.lua
Expand Down Expand Up @@ -648,7 +648,7 @@
-- ^^^ invalid.illegal.unexpected-end
until true;
-- ^^^^^ keyword.control.loop
-- ^^^^ constant.language.boolean.lua
-- ^^^^ constant.language.boolean.true

for x = 1, y, z do end
-- ^^^ keyword.control.loop
Expand Down

0 comments on commit 9224f35

Please sign in to comment.