Skip to content
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: check option as extra keyword nodes (for better highlighting) #125

Merged
merged 1 commit into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ module.exports = grammar({
keyword_cascaded: _ => make_keyword("cascaded"),
keyword_local: _ => make_keyword("local"),
keyword_current_timestamp: _ => make_keyword("current_timestamp"),
keyword_check: _ => make_keyword("check"),
keyword_option: _ => make_keyword("option"),

// Hive Keywords
keyword_external: _ => make_keyword("external"),
Expand Down Expand Up @@ -226,7 +228,7 @@ module.exports = grammar({
_exclude_group: $ => seq($.keyword_exclude, $.keyword_group),
_exclude_no_others: $ => seq($.keyword_exclude, $.keyword_no, $.keyword_others),
_exclude_ties: $ => seq($.keyword_exclude, $.keyword_ties),
_check_option: $ => seq(make_keyword("check"), make_keyword("option")),
_check_option: $ => seq($.keyword_check, $.keyword_option),
direction: $ => choice($.keyword_desc, $.keyword_asc),

// Types
Expand Down
12 changes: 9 additions & 3 deletions test/corpus/create.txt
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,9 @@ CREATE VIEW foo AS SELECT 1 WITH CASCADED CHECK OPTION;
(select_expression
(term
(literal))))
(keyword_with)))
(keyword_with)
(keyword_check)
(keyword_option)))
(statement
(create_view
(keyword_create)
Expand All @@ -666,7 +668,9 @@ CREATE VIEW foo AS SELECT 1 WITH CASCADED CHECK OPTION;
(term
(literal))))
(keyword_with)
(keyword_local)))
(keyword_local)
(keyword_check)
(keyword_option)))
(statement
(create_view
(keyword_create)
Expand All @@ -680,7 +684,9 @@ CREATE VIEW foo AS SELECT 1 WITH CASCADED CHECK OPTION;
(term
(literal))))
(keyword_with)
(keyword_cascaded))))
(keyword_cascaded)
(keyword_check)
(keyword_option))))

================================================================================
Create matview
Expand Down