feat: add PO

This commit is contained in:
Amaan Qureshi 2023-02-28 00:14:08 -05:00
parent d80c99cab0
commit 5b9339f6f4
6 changed files with 55 additions and 0 deletions

View file

@ -282,6 +282,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [php](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka)
- [x] [phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) (experimental, maintained by @mikehaertl)
- [x] [pioasm](https://github.com/leo60228/tree-sitter-pioasm) (maintained by @leo60228)
- [x] [po](https://github.com/erasin/tree-sitter-po) (maintained by @amaanq)
- [x] [Path of Exile item filter](https://github.com/ObserverOfTime/tree-sitter-poe-filter) (experimental, maintained by @ObserverOfTime)
- [x] [prisma](https://github.com/victorhqc/tree-sitter-prisma) (maintained by @elianiva)
- [x] [proto](https://github.com/mitchellh/tree-sitter-proto) (maintained by @fsouza)

View file

@ -326,6 +326,9 @@
"pioasm": {
"revision": "924aadaf5dea2a6074d72027b064f939acf32e20"
},
"po": {
"revision": "d6aed225290bc71a15ab6f06305cb11419360c56"
},
"poe_filter": {
"revision": "80dc10195e26c72598ed1ab02cdf2d8e4c792e7b"
},

View file

@ -1048,6 +1048,14 @@ list.pioasm = {
maintainers = { "@leo60228" },
}
list.po = {
install_info = {
url = "https://github.com/erasin/tree-sitter-po",
files = { "src/parser.c" },
},
maintainers = { "@amaanq" },
}
list.poe_filter = {
install_info = {
url = "https://github.com/ObserverOfTime/tree-sitter-poe-filter",

9
queries/po/folds.scm Normal file
View file

@ -0,0 +1,9 @@
[
(msgctxt)
(msgid)
(msgid_plural)
(msgstr)
(msgstr_plural)
(message)
] @fold

33
queries/po/highlights.scm Normal file
View file

@ -0,0 +1,33 @@
; Keywords
[
"msgctxt"
"msgid"
"msgid_plural"
"msgstr"
"msgstr_plural"
] @keyword
; Punctuation
[ "[" "]" ] @punctuation.bracket
; Literals
(string) @string
(escape_sequence) @string.escape
(number) @number
; Comments
(comment) @comment @spell
(comment (reference (text) @string.special.path))
(comment (flag (text) @preproc))
; Errors
(ERROR) @error

View file

@ -0,0 +1 @@
(comment) @comment