Repository navigation
Keep _-prefixed exotic identifiers escaped, reject \"_\" - #8795
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8795 +/- ##
=======================================
Coverage 80.38% 80.38%
=======================================
Files 447 447
Lines 60979 60991 +12
=======================================
+ Hits 49016 49026 +10
- Misses 11963 11965 +2
🚀 New features to boost your workflow:
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8795 |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Escape names like \"_'\" and \"_\" that the scanner would read as a wildcard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
It couldn't be told apart from the wildcard and the placeholder of underscore apply sugar, e.g. f(\"_\") was parsed as f(_). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NrGqwcpQ2sF3RiHA48TxmU Signed-off-by: Christoph Knittel <ck@cca.io>
933ffa5 to
b8e5d07
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The printer printed escaped identifiers that start with
_bare even when the scanner can't read them back. The scanner treats_as an identifier only when a letter, digit,_or$follows, so these became syntax errors after formatting:classify_ident_contentnow mirrors the scanner, and editor completion uses the same rule for polyvariant tags.Breaking:
\"_"is now rejected as a quoted identifier ("_can't be used as a quoted identifier."). It couldn't be told apart from the_wildcard and the placeholder of underscore apply sugar:f(\"_")was parsed asf(_), i.e.__x => f(__x), andlet \"_" = 1was printed aslet _ = 1. Nothing in the repo used it; a JS name_is still reachable through@as("_")or an external's string name, and the tag#"_"stays valid.New tests:
printer/expr/underscoreExoticIdent.res,parsing/errors/scanner/quotedUnderscore.res, and a#"_"tag in theCompletionExpressionsanalysis test.🤖 Generated with Claude Code
https://claude.ai/code/session_01NrGqwcpQ2sF3RiHA48TxmU