children(separate=true) stops at the module boundary - #111
Merged
Conversation
0.42.0 let the separateness ride outward: because the marks live on the
CSGNodes, a module whose body forwarded children separately passed that
through its own splice to whatever enclosed the call.
module pass() { children(separate=true); }
difference() pass() { a; b; } // subtracted -- wrong
A module is its own shape. That it forwards its children separately is its
business, not its caller's, and a caller reading `difference() pass()` has
no way to know pass() will reinterpret it.
Only the children() call's OWN splice now honours the marks. A user module's
splice wraps as usual, and the wrapper hides the marks from the group walk,
which is all it takes -- no clearing pass, no extra state. That is
spliceModuleChildren's new honorSeparateMarks, false by default so user
modules keep exactly today's behaviour.
The feature is unchanged where it is asked for: put the operator and the
children(separate=true) call in the same module and it works however deeply
that module is nested. Both halves are pinned by tests.
1006 tests pass under both engines; verified end-to-end through the CLI
(nested 123000, across a boundary 125000).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Follow-up to #110, narrowing a corner case of the feature it added.
The problem
The marks live on the
CSGNodes, so separateness rode outward through an enclosing user module's own splice:A module is its own shape. That it forwards its children separately is its business, not its caller's — and a caller reading
difference() pass()has no way to knowpass()will reinterpret it.The fix
Only the
children()call's own splice honours the marks. A user module's splice wraps its children as usual, and the wrapper hides the marks from the group walk — that is all it takes. No clearing pass, no extra state.spliceModuleChildrengainshonorSeparateMarks, defaulting tofalse, so every user-module splice keeps exactly today's behaviour.Unchanged where it is asked for
Put the operator and the
children(separate=true)call in the same module and it works however deeply that module is itself nested:Both halves are pinned by tests (
StillWorksInsideTheModuleThatAsksForIt,StopsAtAUserModuleBoundary), replacing #110'sPropagatesThroughAUserModuleWrapper, which pinned the behaviour being removed here.1006 tests pass under both engines; verified end-to-end through the CLI under
OSCAD_BYTECODE_VM=0and=1.🤖 Generated with Claude Code