We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
According to postgres and sqlite doc this sql is valid (key is a column name)
CREATE TABLE public.test ( id bigint NOT NULL, key char(255) NOT NULL );
But key is a keyword so the rule $._key_constraint is choosed instead of $.column_definition.
$._key_constraint
$.column_definition
I add to change the grammar.js to :
modified grammar.js @@ -12,6 +12,7 @@ module.exports = grammar({ [$.object_reference, $._qualified_field], [$.object_reference], [$.between_expression, $.binary_expression], + [$._column, $._key_constraint], ], precedences: $ => [ @@ -1918,6 +1919,7 @@ module.exports = grammar({ _column_list: $ => paren_list(alias($._column, $.column), true), _column: $ => choice( + $.keyword_key, $.identifier, alias($._literal_string, $.literal), ),
The conflict was mentioned at compile time when I added the $.keyword_key to $._column.
$.keyword_key
$._column
In SQL many keyword are not reserved (https://www.postgresql.org/docs/current/sql-keywords-appendix.html) and could be used as identifier, should we add :
_non_reserved_keyword: $ => choice( $.keyword_key, $.keyword_delete ... ), _identifier_keyword: $ => choice( $._identifier, $._non_reserved_keyword, ),
and replace $._identifier by $._identifier_keyword ?
$._identifier
$._identifier_keyword
Maybe there is a better solution with word ?
word
The text was updated successfully, but these errors were encountered:
No branches or pull requests
According to postgres and sqlite doc this sql is valid (key is a column name)
But key is a keyword so the rule
$._key_constraint
is choosed instead of$.column_definition
.I add to change the grammar.js to :
The conflict was mentioned at compile time when I added the
$.keyword_key
to$._column
.In SQL many keyword are not reserved
(https://www.postgresql.org/docs/current/sql-keywords-appendix.html) and could
be used as identifier, should we add :
and replace
$._identifier
by$._identifier_keyword
?Maybe there is a better solution with
word
?The text was updated successfully, but these errors were encountered: