Skip to content

fix: keep a space between a unary operator and an argument with the same sign - #909

Merged
dsherret merged 1 commit into
mainfrom
fix-unary-same-sign
Nov 9, 2026
Merged

dsherret merged 1 commit into
mainfrom
fix-unary-same-sign

Conversation

@dsherret

@dsherret dsherret commented Nov 9, 2026

Copy link
Copy Markdown
Member

Formatting - -1 produced --1, which is a decrement operator and fails to parse (+ +a and - --a had the same problem). A space is now kept when the argument starts with the same sign as the operator.

Found while comparing formatting on the Deno repo for #908.

…ame sign

Formatting `- -1` produced `--1`, which is a decrement and doesn't parse.
@dsherret
dsherret merged commit ec7a5dd into main Nov 9, 2026
1 check passed
@dsherret
dsherret deleted the fix-unary-same-sign branch November 9, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant