-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: removed unused keyword #179
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
(keyword_spgist) | ||
(keyword_gin) | ||
(keyword_brin) | ||
(keyword_float) | ||
(keyword_array) | ||
] @function.call | ||
|
||
|
@@ -68,6 +67,13 @@ | |
(keyword_following) | ||
(keyword_first) | ||
(keyword_current_timestamp) | ||
(keyword_immutable) | ||
(keyword_atomic) | ||
(keyword_parallel) | ||
(keyword_leakproof) | ||
(keyword_safe) | ||
(keyword_cost) | ||
(keyword_strict) | ||
] @attribute | ||
|
||
[ | ||
|
@@ -85,6 +91,7 @@ | |
(keyword_avro) | ||
(keyword_jsonfile) | ||
(keyword_sequencefile) | ||
(keyword_volatile) | ||
] @storageclass | ||
|
||
[ | ||
|
@@ -191,21 +198,44 @@ | |
(keyword_sort) | ||
(keyword_compute) | ||
(keyword_comment) | ||
(keyword_partitioned) | ||
(keyword_location) | ||
(keyword_cached) | ||
(keyword_uncached) | ||
(keyword_lines) | ||
(keyword_stored) | ||
(keyword_location) | ||
(keyword_partitioned) | ||
(keyword_cached) | ||
(keyword_analyze) | ||
(keyword_rewrite) | ||
(keyword_statistics) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed these from here because they were duplicated in |
||
(keyword_optimize) | ||
(keyword_vacuum) | ||
(keyword_cache) | ||
(keyword_language) | ||
(keyword_sql) | ||
(keyword_called) | ||
(keyword_conflict) | ||
(keyword_declare) | ||
(keyword_filter) | ||
(keyword_function) | ||
(keyword_input) | ||
(keyword_name) | ||
(keyword_oid) | ||
(keyword_options) | ||
(keyword_plpgsql) | ||
(keyword_precision) | ||
(keyword_regclass) | ||
(keyword_regnamespace) | ||
(keyword_regproc) | ||
(keyword_regtype) | ||
(keyword_restricted) | ||
(keyword_return) | ||
(keyword_returns) | ||
(keyword_separator) | ||
(keyword_setof) | ||
(keyword_stable) | ||
(keyword_support) | ||
(keyword_tblproperties) | ||
(keyword_trigger) | ||
(keyword_unsafe) | ||
] @keyword | ||
|
||
[ | ||
|
@@ -244,10 +274,12 @@ | |
(keyword_serial) | ||
(keyword_bigserial) | ||
(keyword_smallint) | ||
(keyword_mediumint) | ||
(keyword_bigint) | ||
(keyword_tinyint) | ||
(keyword_decimal) | ||
(keyword_float) | ||
(keyword_double) | ||
(keyword_numeric) | ||
(keyword_real) | ||
(double) | ||
|
@@ -291,6 +323,7 @@ | |
"/" | ||
"%" | ||
"^" | ||
":=" | ||
"=" | ||
"<" | ||
"<=" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p tmp/tree-sitter-sql/ | ||
|
||
cat src/grammar.json | | ||
jq '.rules | to_entries[] | select(.key | contains("keyword")) | .key' | | ||
tr -d '"' | | ||
sort > tmp/tree-sitter-sql/keywords.txt | ||
|
||
cat queries/highlights.scm | | ||
grep -o "keyword\w\+" | | ||
sort > tmp/tree-sitter-sql/highlights.txt | ||
|
||
keywords=$(comm -3 tmp/tree-sitter-sql/keywords.txt tmp/tree-sitter-sql/highlights.txt) | ||
|
||
if [[ "$keywords" ]]; then | ||
echo "ERROR: keywords in grammar.json are not in sync with queries/highlights.scm" | ||
echo $keywords | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
float
can be a@function.call
and a@type.builtin
So I would keep it there. in nvim-treesitter - the last match wins, thus the order matters here (which makes things unnecessarily complicated imo.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have
float
in@type.builtin
and the rule forinvocation
should cover the@function.call
case.