-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up super errors in syntax #6246
Merged
+26
−403
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried a callback to remove the dependency on the
Ext_io
module, but it's hard to implement. Here's the problem. Since it uses%a
, I can't omit it even if I use an optional arg with a defalt value, and I think I'll have to use something like~src:Ext_io.load_file
if we use a callback. That means we cann't remove theExt_io
dependency anyway.And since Jsoo_main and Jsoo_playground are already using Location.report_error function, I'd like to check with @ryyppy about the dependency on Ext_io.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recalled that I had to copy / paste some syntax diagnostics code to the playground so I can circumvent the IO issue. I am sure JSOO has a way to replace the Ext_io module with a different impl somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so referencing
Ext_io
is indeed an issue. Good to know, I wasn't sure.One could also do something like
on (non-JSOO) compiler startup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about skip Ext io.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or make it platform independent. (After checking if there's some actually observable perf difference).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the code I essentially copied and adapted to get rid of the IO call: https://github.com/rescript-lang/rescript-compiler/blob/5fef8d33fd29bf6ddb3905a687a13c0c9ea147bd/jscomp/jsoo/jsoo_playground_main.ml#L222-L243
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
I'm looking into the Jsoo_playground_main. It is already dependent to the previous
Super_errors
. I'm still not sure if copy/pasting that part would have avoided the IO call.I think the playground stuff in CONTRIBUTING.md is a bit out of date, but I'll follow it and give the post-build js a spin to check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I found this #6201
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryyppy I applied the changes from PR #6201 to this PR and replaced
Res_diagnostics_printing_utils.Super_location.super_error_reporter
withLocation.report_error
. Then I built the playground and ran the tests, which resulted in a stack overflow first. When I commented out the part using React.useState, the tests passed.Does this mean we can consider there are no issues related to the Ext_io dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if you get to this point, it means the playground compiled successfully. The stack overflow issue is unrelated.