Repository navigation
Don't parse __autoconcat__ to sconcat in strict mode - #1225
Merged
Merged
Conversation
Pieter12345
force-pushed
the
optimize_autoconcat
branch
from
July 22, 2020 02:15
5c60821 to
c6b0ced
Compare
Contributor
Author
|
This change fixes the following issues in strict mode, but does not affect them in non-strict mode:
|
Contributor
|
Note that #814 already has a workaround implemented for procedures. The main sconcat is executed but not returned in procedures. |
Pieter12345
force-pushed
the
optimize_autoconcat
branch
3 times, most recently
from
July 26, 2020 01:33
b61f095 to
3469744
Compare
Member
|
The code here looks good, but let's add something about this in the documentation, since this will break traditional use of aliases if strict mode is enabled. Probably need to make some changes in the introductory documentation to ensure that the best practice (using run()) is mentioned (though we can still show examples of the standard alias syntax). |
Contributor
Author
|
I believe that leaves us with the following things to do/consider/realize:
|
Parse `__autoconcat__()` to the new `__statements__()` instead of `sconcat()` in strict mode. `__statements__()` takes arguments of any type and returns `void` for typechecking, so compile errors will be generated in cases where `__autoconcat__()` used to insert `sconcat()`s, or in other words, where the user has either forgotten to put some `.` concat, or where the user has made a mistake. This change does not affect non-strict mode, as automatically inserting concats is a feature there. Alias syntax should also remain possible in strict mode, but only when the whole alias is nicely concatenated together by the user. Inserting multiple arguments/statements will cause the code block to be interpreted as a statements block and not as an alias redirect.
Pieter12345
force-pushed
the
optimize_autoconcat
branch
from
November 30, 2020 14:37
3469744 to
64d8180
Compare
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.
Parse
__autoconcat__()to the new__statements__()instead ofsconcat()in strict mode.__statements__()takes arguments of any type and returnsvoidfor typechecking, so compile errors will be generated in cases where__autoconcat__()used to insertsconcat()s, or in other words, where the user has either forgotten to put some.concat, or where the user has made a mistake.This change does not affect non-strict mode, as automatically inserting concats is a feature there.
Alias syntax should also remain possible in strict mode, but only when the whole alias is nicely concatenated together by the user. Inserting multiple arguments/statements will cause the code block to be interpreted as a statements block and not as an alias redirect.