-
Notifications
You must be signed in to change notification settings - Fork 3
fixup line number reporting and simplify implementation: part 1 #157
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
Merged
Conversation
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
didn't manage to pass it to the Context yet...
…once" This reverts commit 8dec9f2.
maltek
approved these changes
May 30, 2024
Comment on lines
42
to
43
| val predefCode = "" // TODO drop | ||
| val scriptContent = wrapForMainargs(predefCode, Files.readString(scriptFile)) |
Collaborator
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.
Suggested change
| val predefCode = "" // TODO drop | |
| val scriptContent = wrapForMainargs(predefCode, Files.readString(scriptFile)) | |
| val scriptContent = wrapForMainargs("", Files.readString(scriptFile)) |
(or is this still used somewhere else I haven't seen?)
Owner
Author
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.
forgot to cleanup - done now
re scripts: default predef only contain imports, so with the new model of compiling other predef code, and also to simplify everything, we don't want to make them available in scripts
mpollmeier
added a commit
that referenced
this pull request
Nov 19, 2024
Prior to 0.1.92 we concatenated and executed all predef code. That was very simple but had quite a few downsides, including incorrect line number reporting and some edge cases when handling complex compilation units, e.g. ordering of imports etc. #157 changed this behaviour to instead compile the given files and add the results to the classpath. At the same time we unintendedly broke the ability to execute code on startup of the repl - that's reintroduced as a new parameter `--runBefore` now.
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.
Part 1 (this PR): predef files. Prior to this we concatenated all predef files
and handed that over to the REPL/script/embedded driver for interpretation.
That worked, but the line numbers were wrong, and the implementation more
complicated than necessary.
A followup PR will address the issue for scripts as well. That's somewhat
different because we need to embed the script content in some wrapper code..