Skip to content

Commit

Permalink
Fix unquoted command args with leading + (#134)
Browse files Browse the repository at this point in the history
This PR fixes #131  by grouping "+/-" and digits in decimals.
Related test cases in `cmd-026-unquoted-string-with-leading-plus`.
  • Loading branch information
blindFS authored Nov 7, 2024
1 parent d8b3356 commit 60de625
Show file tree
Hide file tree
Showing 4 changed files with 498,818 additions and 526,293 deletions.
22 changes: 14 additions & 8 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1496,8 +1496,9 @@ function _decimal_rule(immediate) {
choice(
seq(head_token(/[\d_]*\d[\d_]*/), optional(exponent)),
seq(
choice(head_token(OPR().minus), head_token(OPR().plus)),
digits,
token(
seq(choice(head_token(OPR().minus), head_token(OPR().plus)), digits),
),
optional(exponent),
),
seq(
Expand All @@ -1507,18 +1508,23 @@ function _decimal_rule(immediate) {
optional(exponent),
),
seq(
choice(head_token(OPR().minus), head_token(OPR().plus)),
digits,
token(
seq(choice(head_token(OPR().minus), head_token(OPR().plus)), digits),
),
token.immediate(PUNC().dot),
optional(digits),
optional(exponent),
),
seq(head_token(PUNC().dot), digits, optional(exponent)),
seq(
choice(head_token(OPR().minus), head_token(OPR().plus)),
optional(token.immediate(/_+/)),
token.immediate(PUNC().dot),
digits,
token(
seq(
choice(head_token(OPR().minus), head_token(OPR().plus)),
optional(token.immediate(/_+/)),
token.immediate(PUNC().dot),
digits,
),
),
optional(exponent),
),
);
Expand Down
Loading

0 comments on commit 60de625

Please sign in to comment.