-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
shopt parse_equals should only be on in config mode #937
Comments
A user brought this same issue up here. So I agree we need to address this |
Current behavior
Proposal
So does that mean we need Does it enforce some kind of sandboxing? I think it can change the "first word lookup" #453 Maybe |
Another Idea: Only allow it within blocks ? #631 So it's disallowed at the top level and within procs. But we could silently turn the option on for
However then it's also on in
That's perhaps confusing I wonder if we can do
Is that awkward? |
Another issue: So maybe we should
The
|
This addresses #937, which was also noted by a user. Bare assignment like 'x = 42' was equivalent to 'const x = 42'. However this causes inconsistency in programs. We only want bare assignment for config dialects like: server www.example.com { root = '/' port = 8080 } On the other hand we don't want proc p { const x = 42 y = 43 # inconsistent } Also add a failing test for bare assignment in blocks. This is another issue -- some blocks will introduce a new scope, and some won't. So we don't want the static check for 'const already defined in scope'. Instead bare assignment will only do DYNAMIC checks (similar to the top level), and 'const' will do STATIC checks.
Unlike 'const', it doesn't do static checks for 'const' already defined. Updated doc/variables. Related to #937.
Related to #937. Fixed a syntax error that wasn't hidden behind parse_equals!
const
.The text was updated successfully, but these errors were encountered: