|
@@ -70,16 +70,23 @@ module.exports = grammar({
|
|
|
const_value: $ => seq(':=', choice($.native, $.expr)),
|
|
|
expr: $ => seq($.term, optional($.pipeline)),
|
|
|
pipeline: $ => seq($.pipe, optional($.pipeline)),
|
|
|
- pipe: $ => choice($.pipe_func, $.pipe_get, $.pipe_cast, $.pipe_switch),
|
|
|
+ pipe: $ => choice (
|
|
|
+ $.pipe_func, $.pipe_cast,
|
|
|
+ $.pipe_get, $.pipe_field_ref,
|
|
|
+ $.pipe_switch, $.pipe_branch_ref
|
|
|
+ ),
|
|
|
pipe_func: $ => seq('.', '{', $.callee, optional($.expr), '}'),
|
|
|
callee: $ => seq($.expr),
|
|
|
- pipe_get: $ => seq('.', $.name),
|
|
|
pipe_cast: $ => seq('.', '[', $.type, ']'),
|
|
|
+ pipe_get: $ => seq('.', $.name),
|
|
|
+ pipe_field_ref: $ => seq('.', '&', $.name),
|
|
|
pipe_switch: $ => seq('.', '(', $.type_ref, ')'),
|
|
|
+ pipe_branch_ref: $ => seq('.', '&', '(', $.type_ref, ')'),
|
|
|
term: $ => choice (
|
|
|
$.call, $.lambda, $.multi_switch, $.switch, $.if,
|
|
|
$.block, $.cps, $.bundle, $.tuple, $.inline_ref,
|
|
|
- $.array, $.int, $.float, $.formatter, $.string, $.char),
|
|
|
+ $.array, $.int, $.float, $.formatter, $.string, $.char
|
|
|
+ ),
|
|
|
call: $ => choice($.call_prefix, $.call_infix),
|
|
|
call_prefix: $ => seq('{', $.callee, $.expr, '}'),
|
|
|
call_infix: $ => seq('(', $.infix_left, $.operator, $.infix_right, ')'),
|