|
|
|
@ -298,7 +298,8 @@ module.exports = grammar({
|
|
|
|
binaryExpr(prec.left, 7, "*.", $._expression),
|
|
|
|
binaryExpr(prec.left, 7, "*.", $._expression),
|
|
|
|
binaryExpr(prec.left, 7, "/", $._expression),
|
|
|
|
binaryExpr(prec.left, 7, "/", $._expression),
|
|
|
|
binaryExpr(prec.left, 7, "/.", $._expression),
|
|
|
|
binaryExpr(prec.left, 7, "/.", $._expression),
|
|
|
|
binaryExpr(prec.left, 7, "%", $._expression)
|
|
|
|
binaryExpr(prec.left, 7, "%", $._expression),
|
|
|
|
|
|
|
|
binaryExpr(prec.left, 7, "<>", $._expression)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// The way that this function is written in the Gleam parser is essentially
|
|
|
|
// The way that this function is written in the Gleam parser is essentially
|
|
|
|
// incompatible with tree-sitter. It first parses some base expression,
|
|
|
|
// incompatible with tree-sitter. It first parses some base expression,
|
|
|
|
@ -541,19 +542,24 @@ module.exports = grammar({
|
|
|
|
field("function", $._maybe_function_expression),
|
|
|
|
field("function", $._maybe_function_expression),
|
|
|
|
field("arguments", $.arguments)
|
|
|
|
field("arguments", $.arguments)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
_pattern_expression: ($) =>
|
|
|
|
|
|
|
|
choice(
|
|
|
|
|
|
|
|
$.identifier,
|
|
|
|
|
|
|
|
$.discard,
|
|
|
|
|
|
|
|
$.record_pattern,
|
|
|
|
|
|
|
|
$.string,
|
|
|
|
|
|
|
|
$.integer,
|
|
|
|
|
|
|
|
$.float,
|
|
|
|
|
|
|
|
$.tuple_pattern,
|
|
|
|
|
|
|
|
alias($._pattern_bit_string, $.bit_string_pattern),
|
|
|
|
|
|
|
|
$.list_pattern,
|
|
|
|
|
|
|
|
alias($._pattern_binary_expression, $.binary_expression)
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
_pattern_binary_expression: ($) =>
|
|
|
|
|
|
|
|
binaryExpr(prec.left, 1, "<>", $._pattern_expression),
|
|
|
|
_pattern: ($) =>
|
|
|
|
_pattern: ($) =>
|
|
|
|
seq(
|
|
|
|
seq(
|
|
|
|
choice(
|
|
|
|
$._pattern_expression,
|
|
|
|
$.identifier,
|
|
|
|
|
|
|
|
$.discard,
|
|
|
|
|
|
|
|
$.record_pattern,
|
|
|
|
|
|
|
|
$.string,
|
|
|
|
|
|
|
|
$.integer,
|
|
|
|
|
|
|
|
$.float,
|
|
|
|
|
|
|
|
$.tuple_pattern,
|
|
|
|
|
|
|
|
alias($._pattern_bit_string, $.bit_string_pattern),
|
|
|
|
|
|
|
|
$.list_pattern
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
optional(field("assign", seq("as", $.identifier)))
|
|
|
|
optional(field("assign", seq("as", $.identifier)))
|
|
|
|
),
|
|
|
|
),
|
|
|
|
record_pattern: ($) =>
|
|
|
|
record_pattern: ($) =>
|
|
|
|
|