Fix JSX parser to validate matching opening/closing tags#152
Merged
trueadm merged 6 commits intoRipple-TS:mainfrom Sep 11, 2025
Merged
Fix JSX parser to validate matching opening/closing tags#152trueadm merged 6 commits intoRipple-TS:mainfrom
trueadm merged 6 commits intoRipple-TS:mainfrom
Conversation
|
@WebEferen is attempting to deploy a commit to the Ripple Team Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
| Playground | Link |
|---|---|
| Ripple Playground: d1ff54b | https://ripple.livecodes.pages.dev?x=code/N4Igxgrg... |
See documentations for usage instructions.
trueadm
approved these changes
Sep 11, 2025
Collaborator
trueadm
left a comment
There was a problem hiding this comment.
This is great, thank you!
trueadm
requested changes
Sep 11, 2025
Collaborator
trueadm
left a comment
There was a problem hiding this comment.
Just realised some tests were failing.
Collaborator
Author
|
Looking at the tests, it was post merge so need to update them. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Overview
This PR fixes a critical bug in the Ripple compiler's JSX parser where unclosed and mismatched tags were silently accepted instead of throwing compilation errors.
Problem
Malformed JSX like
<div></span>would compile successfully, potentially causing runtime issuesSolution
parseTemplateBody()to ensure closing tags match their corresponding opening tagsImplemented
getElementName()helper to extract tag names from JSX nodes for comparison<div></span>) and unclosed tags (<div>content)The compiler now throws descriptive errors:
</div>but found</span><div>. Expected</div>before end of component.Referencing the issue #147