-
Notifications
You must be signed in to change notification settings - Fork 514
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
🔥 Assignments and aliases conflicts with default arguments #379
Comments
export
with arguments
The reason this happens is because both The solution that I'm now leaning towards is to change
Settings would also use
Changing the token that introduces a default argument is also possible, but I don't know of any alternatives to The new However, a phased introduction might be more user friendly:
Combining phases 1 and 2 is reasonable, as is skipping phase 3. A misplaced |
I like the idea of being friendly with the phases but in all honesty who is it for? I'm still waiting on v0.4.0 to drop in Homebrew. I'd imagine people jumping on |
But I'd personally rather see the parser updated for those two cases. Oh, yeah, forcing |
Yeah, the phase-out of It would be pretty easy to supply a |
Just updated the issue with my comments from the PR, so that if people follow the link in the deprecation warning, they'll find this issue. |
Update Justfile due to casey/just#379
It is done! I just released |
Recent versions of Just choke on this justfile with this message: ``` error: `=` in assignments, exports, and aliases has been phased out on favor of `:=` Please see this issue for more details: casey/just#379 ``` This PR fixes that. Cheers, and thanks for your work !
:=
has been added as a synonym for=
in assignments, aliases and exports, and=
is deprecated in those same contexts and will be removed in a future update, most likelyv0.5.0
.Since this is a disruptive change, I think it's a good idea to explain the rationale.
Currently,
=
is used in assignments, aliases, exports, and default arguments:The just language doesn't have keywords in the conventional sense, so the parser uses lookahead to disambiguate conflicting constructs.
However, lookahead is limited and messy, and some conflicts cannot be resolved. So for example, these constructs fail to parse:
Also, there are additional constructs that I'd like to add that will produce further conflicts, like settings:
set setting = value
.In order to fix this, there are a few options:
A. Use more lookahead to disambiguate expressions
B. Use a token other than
=
to introduce default arguments to recipesC. Use a token other than
=
in assignments, exports and aliasesUsing more lookahead, as in A, gets messy very quickly, especially as it's extended to longer and more complex constructs, which would limit extension of the grammar in the future, so I think ruling that out is reasonable.
B is reasonable, but I don't think that there is a good alternative to
=
for default argument values.:
is already used to end recipe argument lists.On the other hand,
:=
is a good alternative for assignments, exports, aliases, and a futureset setting := value
notation.:=
is used inmake
, whichjust
is most similar to, and is also used for assignment in Go and Algol. So, I think C is the best choice.My current plan is to release this as
v0.4.3
, and follow up after some time has passed with a version, probablyv0.5.0
that removes the old meaning of=
. I don't know what the most popular ways of getting just are, but I'd like to give v0.4.3 a chance to appear in package managers so that nobody is in the unfortunate situation of needing to run the same justfile on< 0.4.3
and>= 0.5.0
, and not having a construct available that will work on both.The text was updated successfully, but these errors were encountered: