Skip to content

Commit

Permalink
fix: fix precedence between signed int and infix op
Browse files Browse the repository at this point in the history
Closes #80
  • Loading branch information
Nsidorenco committed Aug 7, 2024
1 parent 01c19ed commit cff87bc
Show file tree
Hide file tree
Showing 5 changed files with 280,435 additions and 278,243 deletions.
3 changes: 2 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,7 @@ module.exports = grammar({
PREC.INFIX_OP,
choice(
$._infix_or_prefix_op,
token.immediate(prec(1, /[+-]/)),
/[-+<>|&^*/'%@][!%&*+./<=>@^|~?-]*/,
"||",
"=",
Expand All @@ -1719,7 +1720,7 @@ module.exports = grammar({
),

// Numbers
int: (_) => /[+-]?([0-9]_?)+/,
int: (_) => token(/[+-]?([0-9]_?)+/),
xint: (_) =>
token(
choice(/0[xX]([0-9a-fA-F]_?)+/, /0[oO]([0-7]_?)+/, /0[bB]([0-1]_?)+/),
Expand Down
18 changes: 16 additions & 2 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cff87bc

Please sign in to comment.