Skip to content

Commit

Permalink
improving reserved words
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaptista committed Apr 2, 2022
1 parent d553afb commit f2aaa75
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Fennel.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,15 @@ contexts:
1: storage.type.auto_gensym.fennel
- match: '{{constants}}'
scope: entity.other.inherited-class.constant.fennel
- match: '{{lua_variables}}|{{lua_functions}}'
scope: variable.language.lua_constant.fennel
# - match: '({{lua_variables}}|{{lua_functions}})+[\d\-\_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]'
# scope: source.fennel
- match: '({{lua_variables}}|{{lua_functions}})[\s\n]'
captures:
1: variable.language.lua_constant.fennel
- match: '({{lua_variables}}|{{lua_functions}})(\))'
captures:
0: punctuation.section.parens.end.fennel
1: variable.language.lua_constant.fennel
- match: '\?'
scope: variable.function.optional.fennel
push: pop-expr
Expand Down
40 changes: 40 additions & 0 deletions tests/syntax_test_fennel_reference_110.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,46 @@ _1 7/8 1_
; ^ entity.name.tag.lua_support.fennel
; ^^^ source.fennel

(if error2 true false)
; <- punctuation.section.parens.begin.fennel
;^^ entity.name.tag.lua_support.fennel
; ^^^^^^ source.fennel
; ^^^^ constant.language.fennel
; ^^^^^ constant.language.fennel
; ^ punctuation.section.parens.end.fennel

(if has-error true false)
; <- punctuation.section.parens.begin.fennel
;^^ entity.name.tag.lua_support.fennel
; ^^^^^^^^^ source.fennel
; ^^^^ constant.language.fennel
; ^^^^^ constant.language.fennel
; ^ punctuation.section.parens.end.fennel

(if has_error true false)
; <- punctuation.section.parens.begin.fennel
;^^ entity.name.tag.lua_support.fennel
; ^^^^^^^^^ source.fennel
; ^^^^ constant.language.fennel
; ^^^^^ constant.language.fennel
; ^ punctuation.section.parens.end.fennel

(if hasError true false)
; <- punctuation.section.parens.begin.fennel
;^^ entity.name.tag.lua_support.fennel
; ^^^^^^^^ source.fennel
; ^^^^ constant.language.fennel
; ^^^^^ constant.language.fennel
; ^ punctuation.section.parens.end.fennel

(if errorMessage true false)
; <- punctuation.section.parens.begin.fennel
;^^ entity.name.tag.lua_support.fennel
; ^^^^^^^^^^^^ source.fennel
; ^^^^ constant.language.fennel
; ^^^^^ constant.language.fennel
; ^ punctuation.section.parens.end.fennel

(match-try a
; <- punctuation.section.parens.begin.fennel
;^^^^^^^^^ entity.name.tag.fennel_support.fennel
Expand Down
7 changes: 7 additions & 0 deletions tests/syntax_test_lua.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
; ^ constant.numeric.integer.decimal.fennel
; ^^ punctuation.section.parens.end.fennel

(print assert
; <- punctuation.section.parens.begin.fennel
;^^^^^ entity.name.tag.lua_support.fennel
; ^^^^^^ variable.language.lua_constant.fennel
)
; <- punctuation.section.parens.end.fennel

(print assert)
; <- punctuation.section.parens.begin.fennel
;^^^^^ entity.name.tag.lua_support.fennel
Expand Down

0 comments on commit f2aaa75

Please sign in to comment.