Done — all green (9 tests, clippy -D warnings, fmt). #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "pr-9-followup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Interactive clause entry and :load now share one path: the Clause dispatch arm
calls session.load_source(&c), which validates-whole → splits → appends
individual ordered entries. So:
exactly like consulting a file with those two clauses — the inconsistency
review #1 flagged is gone.
entry), so nothing changes for the common case.
parse fails → Err → hint on the leading identifier), and error line/col stays
relative to what was typed since the entry is the whole text.
Session::add_clause is removed — load_source fully subsumes it, so there's now
a single, well-tested clause-ingestion path instead of two that could drift
(which was the underlying smell). Its doc note records that it serves both
:load and interactive entry.
That closes out the PR #9 review: block-comment test added, the false 0'. doc
claim corrected, and the add_clause/load_source divergence unified. The
remaining review notes (#4 fallback, #5 list width) I'm deliberately leaving
as-is per the earlier assessment.
Review —
:load/interactive unification (PR #9 follow-up)Small, focused, and the right call.
add_clauseandload_sourcewere doing nearly the same work via two paths — exactly the drift smell that the PR #9 review flagged. Collapsing the Clause arm ontoload_sourceremoves one of those paths instead of patching it, which is the better fix.What's right
foo. bar.and a:loaded file with those two clauses now produce identical buffer state.:listreads consistently from both sources.add_clauseremoved, not deprecated. No lingering second path to drift against. Theload_sourcedoc explicitly records that it serves both consumers — future-you will see that and not be tempted to add a new shortcut.block_comment_does_not_split_and_rides_with_clausecovers both the between-clauses and the inside-paren cases. The behavior I asked for is now pinned.0'.claim. Rather than asserting it with a test (which would have failed) or quietly ignoring it, the doc comment was rewritten to drop the unfounded claim. That's the right call — keep the contract honest, expand it only when there's a test to back it up.load_sourceparses the whole text first, soFact(1).still errors with line/col relative to what was typed, andcapitalization_hintstill fires. Verified inapp.rs:217-220.Small observations
1.
dirtyis now conditional onn > 0.load_sourcesetsdirty = trueonly ifsplit_clausesreturned at least one chunk. The oldadd_clauseset dirty unconditionally on a successful parse. Difference is observable only when a typed entry parses cleanly andsplit_clausesreturns empty — e.g. comment-only input like% just a note.that classify routes toClause. That input now: parses OK → returnsOk(0)→ no clause added, no dirty, no recompile, no log line about "defined" (the!self.session.dirtybranch fires and printsdefined. (N in session)). Probably fine, but worth a deliberate test or a one-line comment inload_sourcedocumenting that 0 clauses is a no-op rather than a quiet success.2.
split_clausesdoc still mentions only line/block comments and floats. The new doc trimmed0'.(good) but the doc comment now reads like a complete enumeration of "things the tokenizer handles correctly." A reader might assume e.g. backquoted strings or0'\nliterals are also fine. Either say "via the real tokenizer, so anything the tokenizer treats as a non-Dot token doesn't split" (the actual invariant) or leave it implicit. Pedantic.3.
:listwidth and the unreachablesplit_clausesfallback — explicitly deferred per the commit note. Fine. Both remain in the followup pile from PR #9's review.Net
The underlying smell (two clause-ingestion paths) is gone, the new path is exercised by the existing
:loadtests and every interactive Clause submission, and the one new test pins the case the prior review identified as untested. Ready to merge as-is; thedirty-when-empty edge case is the only thing I'd consider documenting before moving on.