Skip to content

Commit 31dae31

Browse files
Merge pull request #14 from SpontanCombust/dev
2 parents aa89557 + 343a396 commit 31dae31

File tree

5 files changed

+18181
-17477
lines changed

5 files changed

+18181
-17477
lines changed

grammar.js

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,21 @@ const PREC = {
1515
OR: 3,
1616
AND: 4,
1717
BIT_OR: 5,
18-
BIT_AND: 6,
19-
EQ: 7,
20-
RELATION: 8,
21-
SUM: 9,
22-
DIFF: 9,
23-
MULT: 10,
24-
DIV: 10,
25-
MODULO: 10,
26-
NEW: 11,
27-
UNARY: 11,
28-
CAST: 11,
29-
MEMBER: 12,
30-
CALL: 12,
31-
ARRAY: 12
18+
BIT_XOR: 6,
19+
BIT_AND: 7,
20+
EQ: 8,
21+
RELATION: 9,
22+
SUM: 10,
23+
DIFF: 10,
24+
MULT: 11,
25+
DIV: 11,
26+
MODULO: 11,
27+
NEW: 12,
28+
UNARY: 12,
29+
CAST: 12,
30+
MEMBER: 13,
31+
CALL: 13,
32+
ARRAY: 13
3233
};
3334

3435
module.exports = grammar({
@@ -552,7 +553,8 @@ module.exports = grammar({
552553
$.assign_op_diff,
553554
$.assign_op_mult,
554555
$.assign_op_div,
555-
$.assign_op_mod
556+
$.assign_op_bitand,
557+
$.assign_op_bitor
556558
)),
557559
field('right', $._expr)
558560
)),
@@ -562,7 +564,8 @@ module.exports = grammar({
562564
assign_op_diff: $ => '-=',
563565
assign_op_mult: $ => '*=',
564566
assign_op_div: $ => '/=',
565-
assign_op_mod: $ => '%=',
567+
assign_op_bitand: $ => '&=',
568+
assign_op_bitor: $ => '|=',
566569

567570

568571
ternary_cond_expr: $ => prec.right(PREC.TERNARY, seq(
@@ -580,6 +583,7 @@ module.exports = grammar({
580583
[$.binary_op_and, PREC.AND],
581584
[$.binary_op_bitor, PREC.BIT_OR],
582585
[$.binary_op_bitand, PREC.BIT_AND],
586+
[$.binary_op_bitxor, PREC.BIT_XOR],
583587
[$.binary_op_eq, PREC.EQ],
584588
[$.binary_op_neq, PREC.EQ],
585589
[$.binary_op_gt, PREC.RELATION],
@@ -605,6 +609,7 @@ module.exports = grammar({
605609
binary_op_and: $ => '&&',
606610
binary_op_bitor: $ => '|',
607611
binary_op_bitand: $ => '&',
612+
binary_op_bitxor: $ => '^',
608613
binary_op_eq: $ => '==',
609614
binary_op_neq: $ => '!=',
610615
binary_op_gt: $ => '>',

src/grammar.json

Lines changed: 66 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node-types.json

Lines changed: 23 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)