Put keyword arguments after ; in function calls - #231
Draft
fredrikekre wants to merge 1 commit into
Draft
fredrikekre wants to merge 1 commit into
fredrikekre wants to merge 1 commit into
Conversation
Keyword arguments in calls written with a `,` are now separated from the positional arguments with a `;`, e.g. `f(x, a = 1)` becomes `f(x; a = 1)` and `f(a = 1)` becomes `f(; a = 1)`. Comma-kwargs are merged into an existing `;` group (`f(x, a = 1; b = 2)` -> `f(x; a = 1, b = 2)`). Arguments are never reordered since Julia evaluates them in source order, so calls with a positional argument after a keyword argument (`f(a = 1, x)`) are left as is. The rule applies to calls only, including calls inside macro calls and quoted expressions, but not to function or macro definition signatures, macro calls, tuples, indexing, or curly braces. Definition signatures are identified by a new TAG_FUNCTION_SIGNATURE tag set top-down from the `function`/`macro` node since the lineage alone can not distinguish the signature call from the body call in `f(x, a = 1) = g(y, b = 2)`. This is a new formatting rule (Runic 2.0), not a spec-bug fix. Runic's own sources are reformatted accordingly. Closes #33. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #231 +/- ##
==========================================
+ Coverage 90.60% 90.85% +0.24%
==========================================
Files 9 9
Lines 4088 4231 +143
==========================================
+ Hits 3704 3844 +140
- Misses 384 387 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Keyword arguments in calls written with a
,are now separated from thepositional arguments with a
;, e.g.f(x, a = 1)becomesf(x; a = 1)and
f(a = 1)becomesf(; a = 1). Comma-kwargs are merged into anexisting
;group (f(x, a = 1; b = 2)->f(x; a = 1, b = 2)).Arguments are never reordered since Julia evaluates them in source order,
so calls with a positional argument after a keyword argument
(
f(a = 1, x)) are left as is. The rule applies to calls only, includingcalls inside macro calls and quoted expressions, but not to function or
macro definition signatures, macro calls, tuples, indexing, or curly
braces. Definition signatures are identified by a new
TAG_FUNCTION_SIGNATURE tag set top-down from the
function/macronodesince the lineage alone can not distinguish the signature call from the
body call in
f(x, a = 1) = g(y, b = 2).Closes #33.