diff --git a/README.md b/README.md index cb16f3c77..d11ffd833 100644 --- a/README.md +++ b/README.md @@ -261,6 +261,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [ledger](https://github.com/cbarrete/tree-sitter-ledger) (maintained by @cbarrete) - [x] [llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) (maintained by @benwilliamgraham) - [x] [lua](https://github.com/MunifTanjim/tree-sitter-lua) (maintained by @muniftanjim) +- [x] [lua patterns](https://github.com/vhyrro/tree-sitter-luap) (maintained by @amaanq) - [x] [m68k](https://github.com/grahambates/tree-sitter-m68k) (maintained by @grahambates) - [x] [make](https://github.com/alemuller/tree-sitter-make) (maintained by @lewis6991) - [x] [markdown](https://github.com/MDeiml/tree-sitter-markdown) (experimental, maintained by @MDeiml) diff --git a/lockfile.json b/lockfile.json index f1f630267..ddef7a391 100644 --- a/lockfile.json +++ b/lockfile.json @@ -263,6 +263,9 @@ "lua": { "revision": "0fc89962b7ff5c7d676b8592c1cbce1ceaa806fd" }, + "luap": { + "revision": "ebc6739bf8900a0191a386ef53371fc556c662a8" + }, "m68k": { "revision": "d097b123f19c6eaba2bf181c05420d88b9fc489d" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 179513d9b..4c873df81 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -855,6 +855,15 @@ list.lua = { maintainers = { "@muniftanjim" }, } +list.luap = { + install_info = { + url = "https://github.com/amaanq/tree-sitter-luap", + files = { "src/parser.c" }, + readme_name = "lua patterns", + }, + maintainers = { "@amaanq" }, +} + list.m68k = { install_info = { url = "https://github.com/grahambates/tree-sitter-m68k", diff --git a/queries/luap/highlights.scm b/queries/luap/highlights.scm new file mode 100644 index 000000000..62d2b3182 --- /dev/null +++ b/queries/luap/highlights.scm @@ -0,0 +1,35 @@ +"." @character + +[ + (anchor_begin) + (anchor_end) +] @string.escape + +[ + "[" "]" + "(" ")" +] @punctuation.bracket + +[ + (zero_or_more) + (shortest_zero_or_more) + (one_or_more) + (zero_or_one) +] @operator + +(range + from: (character) @constant + "-" @punctuation.delimiter + to: (character) @constant) + +(set + (character) @constant) + +(class) @keyword + +(negated_set + "^" @operator + (character) @constant) + +(balanced_match + (character) @parameter)