Skip to content

Commit

Permalink
feat: update prql parser (#7771)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-Q authored Jul 28, 2023
1 parent 9a4890f commit 224fd5f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2460,7 +2460,7 @@ indent = { tab-width = 4, unit = " " }

[[grammar]]
name = "prql"
source = { git = "https://github.com/PRQL/tree-sitter-prql", rev = "3f27cac466f030ee7d985d91eba5470e01dd21ea" }
source = { git = "https://github.com/PRQL/tree-sitter-prql", rev = "09e158cd3650581c0af4c49c2e5b10c4834c8646" }

[[language]]
name = "po"
Expand Down
31 changes: 19 additions & 12 deletions runtime/queries/prql/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
(keyword_window)
(keyword_join)
(keyword_select)
(keyword_switch)
(keyword_case)
(keyword_append)
(keyword_remove)
(keyword_intersect)
Expand All @@ -19,6 +19,7 @@
(keyword_let)
(keyword_prql)
(keyword_from_text)
(keyword_loop)
] @keyword

(literal) @string
Expand All @@ -33,8 +34,6 @@ alias: (identifier) @variable.other.member

(comment) @comment

(keyword_func) @keyword.function

(function_call
(identifier) @function)

Expand All @@ -50,21 +49,25 @@ alias: (identifier) @variable.other.member
"!="
">="
">"
"->"
"&&"
"||"
"//"
"~="
(bang)
] @operator

[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket

[
","
"."
(pipe)
"->"
] @punctuation.delimiter

(literal
Expand All @@ -87,6 +90,15 @@ alias: (identifier) @variable.other.member
(keyword_sum)
(keyword_stddev)
(keyword_count)
(keyword_lag)
(keyword_lead)
(keyword_first)
(keyword_last)
(keyword_rank)
(keyword_row_number)
(keyword_round)
(keyword_all)
(keyword_map)
] @function

[
Expand Down Expand Up @@ -119,13 +131,8 @@ alias: (identifier) @variable.other.member
(keyword_false)
] @constant.builtin.boolean

[
(keyword_and)
(keyword_or)
] @keyword.operator

(function_definition
(keyword_func)
(keyword_let)
name: (identifier) @function)

(parameter
Expand Down

0 comments on commit 224fd5f

Please sign in to comment.