Add array concat operator

This commit is contained in:
2026-06-19 01:01:04 +09:00
parent 6da0ec4c77
commit 01ad6dca52
17 changed files with 6365 additions and 5138 deletions
+11 -5
View File
@@ -5,11 +5,12 @@ const PREC = {
OR: 4,
LOGICAL_AND: 5,
COMPARE: 6,
ADD: 7,
MUL: 8,
UNARY: 9,
CALL: 10,
PATH: 11,
CONCAT: 7,
ADD: 8,
MUL: 9,
UNARY: 10,
CALL: 11,
PATH: 12,
};
function commaSep(rule) {
@@ -192,6 +193,11 @@ module.exports = grammar({
field('operator', choice('==', '!=', '>', '>=', '<', '<=')),
field('right', $._expression),
)),
prec.left(PREC.CONCAT, seq(
field('left', $._expression),
field('operator', token(prec(2, '++'))),
field('right', $._expression),
)),
prec.left(PREC.ADD, seq(
field('left', $._expression),
field('operator', choice('+', '-')),