Update Lua parser

Closes #701
pull/708/head
Wilfred Hughes 2024-04-28 22:36:23 +07:00
parent 50d90f6736
commit c2df185d49
3 changed files with 3 additions and 78 deletions

@ -12,7 +12,7 @@ Since difftastic is now conservative with parse errors
(DFT_PARSE_ERROR_LIMIT is 0 by default), this seems like a better
tradeoff.
Updated CSS parser.
Updated CSS and Lua parsers.
### Diffing

@ -221,7 +221,7 @@ fn main() {
TreeSitterParser {
name: "tree-sitter-lua",
src_dir: "vendored_parsers/tree-sitter-lua-src",
extra_files: vec!["scanner.cc"],
extra_files: vec!["scanner.c"],
},
TreeSitterParser {
name: "tree-sitter-make",

@ -1,76 +0,0 @@
;; Keywords
[
"goto"
"in"
"local"
"return"
"and"
"not"
"or"
"function"
"if"
"elseif"
"else"
"then"
"for"
"do"
"end"
"repeat"
"until"
"while"
] @keyword
[
"+"
"-"
"*"
"/"
"%"
"^"
"#"
"=="
"~="
"<="
">="
"<"
">"
"="
"&"
"~"
"|"
"<<"
">>"
"//"
".."
] @operator
;; Variables
(identifier) @variable
((identifier) @variable.builtin
(#match? @variable.builtin "self"))
;; Constants
((identifier) @constant
(#match? @constant "^[A-Z][A-Z_0-9]*$"))
(nil) @constant.builtin
[
(false)
(true)
] @boolean
;; Others
(comment) @comment
(number) @number
(string) @string
;; Error
(ERROR) @error

@ -0,0 +1 @@
../tree-sitter-lua/queries/highlights.scm