feat!: drop modules, general refactor and cleanup

This commit is contained in:
Christian Clason 2023-06-12 09:54:30 -06:00
parent c13e28f894
commit 2c8f2f2fad
829 changed files with 4905 additions and 8010 deletions

View file

@ -0,0 +1,10 @@
[
(field)
(object)
(array)
(parenthesis)
(bind)
; (params)
; (args)
; (conditional)
] @fold

View file

@ -0,0 +1,121 @@
(id) @variable
(comment) @comment
; Literals
(null) @constant.builtin
(string) @string
(number) @number
[
(true)
(false)
] @boolean
; Keywords
"for" @repeat
"in" @keyword.operator
"function" @keyword.function
[
"if"
"then"
"else"
] @conditional
[
(local)
(tailstrict)
"function"
] @keyword
[
"assert"
"error"
] @exception
[
(dollar)
(self)
(super)
] @variable.builtin
((id) @variable.builtin
(#eq? @variable.builtin "std"))
; Operators
[
(multiplicative)
(additive)
(bitshift)
(comparison)
(equality)
(bitand)
(bitxor)
(bitor)
(and)
(or)
(unaryop)
] @operator
; Punctuation
[
"["
"]"
"{"
"}"
"("
")"
] @punctuation.bracket
[
"."
","
";"
":"
] @punctuation.delimiter
[
"::"
":::"
] @punctuation.special
(field
(fieldname) "+" @punctuation.special)
; Imports
[
(import)
(importstr)
] @include
; Fields
(fieldname (id) @field)
(fieldname (string (string_content) @field))
; Functions
(field
function: (fieldname (id) @function))
(field
function: (fieldname
(string (string_content) @function)))
(param
identifier: (id) @parameter)
(bind (id) @variable.local)
(bind function: (id) @function)
; Function call
(functioncall
(fieldaccess
last: (id) @function.call)?
(fieldaccess_super
(id) @function.call)?
(id)? @function.call
"("
(args
(named_argument
(id) @parameter
))?
")")
; ERROR
(ERROR) @error

View file

@ -0,0 +1,17 @@
(parenthesis) @scope
(anonymous_function) @scope
(object) @scope
(field) @scope
(local_bind) @scope
(field
function: (fieldname (id) @definition.function)
(#set! "definition.function.scope" "parent"))
(bind (id) @definition.var)
(bind function: (id) @definition.function)
(param (id) @definition.parameter)
(id) @reference
;(fieldname (id) (#is-not? local)) ; (#is-not?) not supported yet