get diagnostics

This commit is contained in:
Christian De la Hoz 2021-09-01 17:47:59 +02:00
parent 7fdee6f9f0
commit fa4317ba96
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,25 @@
================================================================================
get diagnostics
================================================================================
DO $$
BEGIN
get current diagnostics foo = ROW_COUNT;
get diagnostics bar := ROW_COUNT;
END
$$;
--------------------------------------------------------------------------------
(source_file
(do_block
(block
(dollar_quote)
(body
(get_diagnostics_statement
(assign_statement
(identifier)
(identifier)))
(get_diagnostics_statement
(assign_statement
(identifier)
(identifier))))
(dollar_quote))))

View file

@ -410,6 +410,7 @@ module.exports = grammar({
choice( choice(
$._statement, $._statement,
$.assign_statement, $.assign_statement,
$.get_diagnostics_statement,
$.return_statement, $.return_statement,
$.raise_statement, $.raise_statement,
$.if_statement, $.if_statement,
@ -420,6 +421,8 @@ module.exports = grammar({
";", ";",
), ),
get_diagnostics_statement: $ => seq(kw("get"), optional(kw("current")), kw("diagnostics"), $.assign_statement),
for_statement: $ => seq( for_statement: $ => seq(
kw("for"), commaSep1($.identifier), kw("in"), choice( kw("for"), commaSep1($.identifier), kw("in"), choice(
seq( seq(