JuliaSyntax.jl
JuliaSyntax.jl copied to clipboard
Experiment: Make macros bind stronger than commas within parentheses
As discussed in https://github.com/JuliaLang/julia/issues/36547
That is, f(@x a, b) parses as
(call f (macrocall a) b)
rather than
(call f (macrocall (tupel a b)))
Unfortunately, this is mildly breaking, due to such strange syntax as (@unpack a,b = c)
Codecov Report
Attention: Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
Project coverage is 96.68%. Comparing base (
2a0efad) to head (0a0ffa3). Report is 85 commits behind head on main.
| Files | Patch % | Lines |
|---|---|---|
| src/parse_stream.jl | 86.66% | 2 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #212 +/- ##
=======================================
Coverage 96.68% 96.68%
=======================================
Files 14 14
Lines 4007 4008 +1
=======================================
+ Hits 3874 3875 +1
Misses 133 133
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Perhaps it'd make sense to deprecate f(@x a, b) and/or introduce warnings, but changing the semantics from one valid interpretation to another would be horrible. Please don't do it before Julia v2.
changing the semantics from one valid interpretation to another would be horrible
It's "horrible", but evidence suggests that users don't understand the existing precedence and actively write bugs with the existing semantics. Look at the analysis here
If we fix more cases in the ecosystem than we break by making this change, is that actually "horrible"? There's no right answer, only tradeoffs.