feat: add CSV, PSV, & TSV

This commit is contained in:
Amaan Qureshi 2023-08-17 04:07:43 -04:00
parent 977e932726
commit 17d3398b5b
7 changed files with 54 additions and 5 deletions

View file

@ -199,6 +199,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [cpon](https://github.com/amaanq/tree-sitter-cpon) (maintained by @amaanq)
- [x] [cpp](https://github.com/tree-sitter/tree-sitter-cpp) (maintained by @theHamsta)
- [x] [css](https://github.com/tree-sitter/tree-sitter-css) (maintained by @TravonteD)
- [x] [csv](https://github.com/amaanq/tree-sitter-csv) (maintained by @amaanq)
- [x] [cuda](https://github.com/theHamsta/tree-sitter-cuda) (maintained by @theHamsta)
- [x] [cue](https://github.com/eonpatapon/tree-sitter-cue) (maintained by @amaanq)
- [x] [d](https://github.com/CyberShadow/tree-sitter-d) (experimental, maintained by @nawordar)
@ -311,6 +312,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [promql](https://github.com/MichaHoffmann/tree-sitter-promql) (maintained by @MichaHoffmann)
- [x] [proto](https://github.com/treywood/tree-sitter-proto) (maintained by @treywood)
- [x] [prql](https://github.com/PRQL/tree-sitter-prql) (maintained by @matthias-Q)
- [x] [psv](https://github.com/amaanq/tree-sitter-csv) (maintained by @amaanq)
- [x] [pug](https://github.com/zealot128/tree-sitter-pug) (experimental, maintained by @zealot128)
- [x] [puppet](https://github.com/amaanq/tree-sitter-puppet) (maintained by @amaanq)
- [x] [PyPA manifest](https://github.com/ObserverOfTime/tree-sitter-pymanifest) (maintained by @ObserverOfTime)
@ -358,6 +360,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) (maintained by @ahelwer, @susliko)
- [x] [todotxt](https://github.com/arnarg/tree-sitter-todotxt.git) (experimental, maintained by @arnarg)
- [x] [toml](https://github.com/ikatyang/tree-sitter-toml) (maintained by @tk-shirasaka)
- [x] [tsv](https://github.com/amaanq/tree-sitter-csv) (maintained by @amaanq)
- [x] [tsx](https://github.com/tree-sitter/tree-sitter-typescript) (maintained by @steelsojka)
- [x] [turtle](https://github.com/BonaBeavis/tree-sitter-turtle) (maintained by @BonaBeavis)
- [x] [twig](https://github.com/gbprod/tree-sitter-twig) (maintained by @gbprod)

View file

@ -77,6 +77,9 @@
"css": {
"revision": "5f2c94b897601b4029fedcce7db4c6d76ce8a128"
},
"csv": {
"revision": "1f584470170b708880b024142d901b05b2b2b602"
},
"cuda": {
"revision": "607851cc524d9f5b5a5cd31ad4044fd431cee54e"
},
@ -413,6 +416,9 @@
"prql": {
"revision": "09e158cd3650581c0af4c49c2e5b10c4834c8646"
},
"psv": {
"revision": "1f584470170b708880b024142d901b05b2b2b602"
},
"pug": {
"revision": "a7ff31a38908df9b9f34828d21d6ca5e12413e18"
},
@ -554,6 +560,9 @@
"toml": {
"revision": "8bd2056818b21860e3d756b5a58c4f6e05fb744e"
},
"tsv": {
"revision": "1f584470170b708880b024142d901b05b2b2b602"
},
"tsx": {
"revision": "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf"
},

View file

@ -289,6 +289,15 @@ list.css = {
maintainers = { "@TravonteD" },
}
list.csv = {
install_info = {
url = "https://github.com/amaanq/tree-sitter-csv",
files = { "src/parser.c" },
location = "csv",
},
maintainers = { "@amaanq" },
}
list.cuda = {
install_info = {
url = "https://github.com/theHamsta/tree-sitter-cuda",
@ -1240,6 +1249,15 @@ list.prql = {
maintainers = { "@matthias-Q" },
}
list.psv = {
install_info = {
url = "https://github.com/amaanq/tree-sitter-csv",
files = { "src/parser.c" },
location = "psv",
},
maintainers = { "@amaanq" },
}
list.pug = {
install_info = {
url = "https://github.com/zealot128/tree-sitter-pug",
@ -1631,6 +1649,15 @@ list.toml = {
maintainers = { "@tk-shirasaka" },
}
list.tsv = {
install_info = {
url = "https://github.com/amaanq/tree-sitter-csv",
files = { "src/parser.c" },
location = "tsv",
},
maintainers = { "@amaanq" },
}
list.tsx = {
install_info = {
url = "https://github.com/tree-sitter/tree-sitter-typescript",

View file

@ -0,0 +1,3 @@
; inherits: tsv
"," @punctuation.delimiter

View file

@ -0,0 +1,3 @@
; inherits: tsv
"|" @punctuation.delimiter

View file

@ -54,11 +54,11 @@
(#eq? @_type "math"))
; TODO: re-add when a parser for csv is added.
; ((directive
; name: (type) @_type
; body: (body (content) @injection.content))
; (#set! injection.language "csv")
; (#eq? @_type "csv-table"))
((directive
name: (type) @_type
body: (body (content) @injection.content))
(#set! injection.language "csv")
(#eq? @_type "csv-table"))
;; Special roles - prefix

View file

@ -0,0 +1,4 @@
(text) @string
(number) @number
(float) @float
(boolean) @boolean