You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The arithmetic command parser now preserves adjacent compound operator tokens, including when the lexer puts the equals sign and its operand in the same token. Source positions keep separated operators such as > = distinct.
Verified compact and spaced forms of >=, <=, and >>= against GNU Bash. Regression tests also cover invalid separated comparisons. Typecheck, lint, 1,528 parser/interpreter/limit tests (one skipped), and 1,059 comparison tests passed locally.
Automated, advisory triage for @Prasad-178's PR. Facts below are read from the GitHub API.
Check
Result
Author's merged PRs (this repo)
0 — ⚠️ first-time contributor
Account established
✅ (age 1794d · 20 followers · 75 public repos)
Commits signed/verified
✅ 2/2
Changeset included
✅ (.changeset/compact-arithmetic-operators.md)
Review panel: 🟡 medium highest severity
just-bash maintainer code review: 🟡 medium
The source-aware operator fix regresses arithmetic parsing through the parser's pre-tokenized-input API.
packages/just-bash/src/parser/parser.ts:1167 — `parseTokens()` has no matching `_input`, so slicing it returns an empty gap and marks every token pair adjacent. Pre-tokenized `((i > =3))` is therefore reconstructed as valid `i >=3`; reused parsers may instead consult stale source text. Determine adjacency from token offsets when raw input is unavailable.
General code review: 🟡 medium
The source-aware operator fix breaks arithmetic parsing through the existing pre-tokenized parser path.
packages/just-bash/src/parser/parser.ts:1167 — `parseArithmeticCommand` now derives adjacency from `_input`, but `parseTokens()` never initializes it. Parsing tokens for `((i > =3))` with a fresh Parser therefore slices an empty string, treats the separated tokens as adjacent, and incorrectly accepts them as `>=`; reused parsers can instead consult stale source text.
Adversarial security: 🟢 low
No actionable security issues found in the complete diff.
Adversarial security (second opinion): 🟢 low
Parser-only change with no new I/O, execution, or dependency surface; offset arithmetic is in-bounds and failure modes fall back to the prior conservative spacing behavior, so no actionable security findings.
Standard Bash and host portability: 🟡 medium
The operator fix introduces a Bash-incompatible acceptance of adjacent single-quoted expressions.
packages/just-bash/src/parser/parser.ts:1174 — Adjacent fully single-quoted operands such as `((4>'=3'))` are incorrectly joined into `4>=3`. Bash preserves single quotes in arithmetic and rejects this syntax, but the lexer exposes the token value as `=3`, so `startsWith("=")` accepts it. Require the token to be unquoted before joining.
Posted by auto-maintain. This automated code review is advisory; a human maintainer makes the call.
privatenumber
added
awaiting-review
Maintainer review or re-review is next. Does not imply approval or merge readiness.
bug
Something isn't working
p2
Normal backlog action. Priority is not acceptance or a delivery promise.
shell
Parsing, quoting, expansion, pipelines, redirection, and shell execution
labels
Dec 1, 2026
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awaiting-reviewMaintainer review or re-review is next. Does not imply approval or merge readiness.bugSomething isn't workingp2Normal backlog action. Priority is not acceptance or a delivery promise.shellParsing, quoting, expansion, pipelines, redirection, and shell execution
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses item 1 of #758.
The arithmetic command parser now preserves adjacent compound operator tokens, including when the lexer puts the equals sign and its operand in the same token. Source positions keep separated operators such as
> =distinct.Verified compact and spaced forms of
>=,<=, and>>=against GNU Bash. Regression tests also cover invalid separated comparisons. Typecheck, lint, 1,528 parser/interpreter/limit tests (one skipped), and 1,059 comparison tests passed locally.