Fix: dot-index reattaches to multi-arg call result#583
Closed
danieljohnmorris wants to merge 1 commit into
Closed
Conversation
…are ident Closes ILO-52. Previously `spl s d .1` parsed as Call(spl, [s, Index(d,1)]) because parse_atom greedily attached .N to bare Ref idents. Now suppressed inside call-args context — outer parse_field_chain wraps the whole call.
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Collaborator
Author
|
Superseded by #572 (already merged — same fix for call-result dot-index reattach) |
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.
Summary
Closes ILO-52.
spl s d .1(where both args are bare variable references) previously parsed asCall(spl, [Ref(s), Index(Ref(d), 1)])— the.1was stolen by the bare-ident arm ofparse_atom_bodybefore the outer call loop could claim it.Root cause
parse_atom_body's bare-Identbranch unconditionally calledparse_field_chain, greedily consuming.Neven while inside the arg collection loop of an outer call.Fix
Added an
in_call_args: boolcontext flag toParser. Set totruefor the duration of every greedy arg loop inparse_call_or_atomandparse_call_arg(save/restore pattern). Inparse_atom_body's bare-ident branch, whenin_call_argsis true, field-chain consumption is suppressed — the outerparse_field_chaincall at the end of each loop then attaches the.Nto the assembled call result.Before / After
Verified no-regression cases
spl "1.2.3" "." .1— literal last arg (already worked)(spl s d).1— explicit parens (always worked)x.1standalone — bare ident not in call args (still works)at xs 0 .1— literal last arg (already worked)Changes
src/parser/mod.rs—in_call_argsflag + save/restore in 4 arg loops + suppression in bare-ident atom branchtests/parser_call_index.rs— new regression test file covering the broken and no-regression casesexamples/call-dot-index.ilo— new example demonstrating the fixexamples/call-result-dot-index.ilo— removed the now-obsolete "heads-up" note about bare-ident last args🤖 Generated with Claude Code