bug fixes

This commit is contained in:
Christian De la Hoz 2021-09-01 17:47:14 +02:00
parent 1ce5cc3928
commit 7fdee6f9f0
6 changed files with 12 additions and 14 deletions

View File

@ -222,7 +222,6 @@ owned by none;
(as
(identifier))
(sequence_increment
(ERROR)
(number))
(sequence_min
(number))

View File

@ -15,7 +15,7 @@ grant all on table foo to postgres;
================================================================================
all privileges
================================================================================
grant all privileges on table foo.bar to postgres;
GRANT ALL PRIVILEGES ON TABLE FOO.BAR TO POSTGRES;
--------------------------------------------------------------------------------
(source_file

View File

@ -11,7 +11,7 @@ end $$;
(block
(dollar_quote)
(body
(ERROR))
(raise_statement))
(dollar_quote))))
================================================================================

View File

@ -33,9 +33,7 @@ SELECT 1234, -25, TRUE, FALSE, NULL, *;
(select_item
(number))
(select_item
(op_expression
(minus)
(number)))
(number))
(select_item
(true))
(select_item
@ -89,9 +87,7 @@ SELECT -22 + - (5 + 1);
(select_statement
(select_item
(op_expression
(op_expression
(minus)
(number))
(number)
(op_expression
(minus)
(op_expression

View File

@ -297,7 +297,7 @@ module.exports = grammar({
grant_privileges: $ => choice(
seq(kw("all"), optional("privileges")),
seq(kw("all"), optional(kw("privileges"))),
commaSep1($.identifier),
),
@ -437,9 +437,12 @@ module.exports = grammar({
// TODO(chrde): https://www.postgresql.org/docs/13/plpgsql-errors-and-messages.html
raise_statement: $ => seq(
kw("raise"), optional($.identifier),
$.string,
optional(seq(",", commaSep($._value_expression)))
kw("raise"),
optional(seq(
optional($.identifier),
$.string,
optional(seq(",", commaSep($._value_expression)))
)),
),
if_statement: $ => seq(
@ -810,7 +813,7 @@ module.exports = grammar({
null: $ => kw("null"),
star: $ => "*",
any: $ => /.*/,
number: $ => /\d+/,
number: $ => /-?\d+/,
identifier: $ => $._identifier,
_identifier: $ => /[a-zA-Z0-9_]+(\.?[a-zA-Z0-9_]+)*/,
// ^