Conversation
Signed-off-by: Christoph Knittel <ck@cca.io> # Conflicts: # CHANGELOG.md # Conflicts: # CHANGELOG.md
Signed-off-by: Christoph Knittel <ck@cca.io> ^ Conflicts: ^ tests/ounit_tests/ounit_lambda_constant_tests.ml
Signed-off-by: Christoph Knittel <ck@cca.io>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8634 +/- ##
==========================================
+ Coverage 77.58% 77.63% +0.04%
==========================================
Files 475 475
Lines 64062 64270 +208
==========================================
+ Hits 49704 49894 +190
- Misses 14358 14376 +18
🚀 New features to boost your workflow:
|
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-8634 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Represent regexp literals explicitly and remove
%resyntaxAdd
Pexp_regexpto represent regexp literals directly, preserving their pattern, escapes, flag order, attributes, and location. Literals lower to the existing typed raw-JavaScript representation, so Typedtree, Lambda, and runtime behavior remain unchanged.Remove
%resource syntax with a targeted migration diagnostic. ReScript 12’s formatter already rewrites it to regexp literals. The legacy"re"encoding remains confined to the frozen AST0 bridge for PPX compatibility: supported payloads becomePexp_regexp, payload attributes are retained, and malformed payloads are rejected at the bridge.Why JSX recovery changes too
Previously, a missing JSX prop value before
/>could be misread as an unterminated regexp. Editor completion recognized the resulting empty regexp and missing location as a recovery sentinel. Introducing a properly located regexp node requires removing that dependency.The parser now produces an expression hole for missing prop values. Disambiguation still needs care: a valid regexp can begin with
/>, and an enclosing JSX closing tag can supply an apparent regexp delimiter.Recovery checkpoints let the parser keep the regexp interpretation unless the element cannot close structurally. It can then restore the latest ambiguous boundary and recover it as a self-closing tag. This preserves earlier valid regexps despite later errors and avoids repeatedly parsing the remaining element.
Validation