Use explicit 'nil_literal' rule

Makes the dumped AST more readable, and will probably help in writing
future queries.
This commit is contained in:
Bruno BELANYI 2022-06-01 19:40:44 +02:00
parent 0bc7e59fc7
commit 02f83784b1
5 changed files with 54 additions and 29 deletions

View file

@ -26,7 +26,7 @@ module.exports = grammar({
),
_expr: ($) => choice(
"nil",
$.nil_literal,
$.integer_literal,
$.string_literal,
@ -35,6 +35,8 @@ module.exports = grammar({
$.sequence_expression,
),
nil_literal: (_) => "nil",
integer_literal: (_) => /[0-9]+/,
string_literal: ($) => seq(