Open antoineB opened 1 year ago
Maybe what is wanted is removing rules $.list
and wrapped_in_parenthesis($._expression)
_unwrapped_expression: $ => prec(1,
choice(
$.literal,
alias(
$._qualified_field,
$.field,
),
$.parameter,
$.case,
$.window_function,
$.cast,
alias($.implicit_cast, $.cast),
$.exists,
$.invocation,
$.binary_expression,
$.unary_expression,
$.array,
$.interval,
$.between_expression,
)
),
_expression: $ => choice(
$._unwrapped_expression_without_starting_subquery,
$.subquery,
wrapped_in_parenthesis($._expression),
$.list
),
function_declaration: $ => seq(
$.identifier,
$._type,
optional(
seq(
':=',
choice(
wrapped_in_parenthesis($.statement),
wrapped_in_parenthesis($._unwrapped_expression_without_starting_subquery),
$._unwrapped_expression_without_starting_subquery,
$.list,
),
),
),
';',
),
Work in progress
Is it the right way to do it ? Is it worth the trouble ? Does it at complexity too much complexity to the grammar (N° of states, time, maintainability) ?