File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -857,7 +857,12 @@ extension Definition {
857
857
" value cannot be assigned a name "
858
858
)
859
859
}
860
- } else if context. name. isEmpty {
860
+ } else if context. name. isEmpty,
861
+ // Manage backwards compatibility for blocks that return
862
+ // multiple meshes to be used inside difference block
863
+ !children. contains ( where: { $0. type == . mesh } ) ||
864
+ children. contains ( where: { ![ . mesh, . path] . contains ( $0. type) } )
865
+ {
861
866
return . tuple( children. map {
862
867
switch $0 {
863
868
case let . path( path) :
Original file line number Diff line number Diff line change @@ -1388,6 +1388,19 @@ class InterpreterTests: XCTestCase {
1388
1388
}
1389
1389
}
1390
1390
1391
+ func testBlockReturnsGroupedMeshes( ) throws {
1392
+ let program = try parse ( """
1393
+ define foo {
1394
+ cube { size 0.5 }
1395
+ cube { size 0.8 }
1396
+ }
1397
+ foo
1398
+ """ )
1399
+ let context = EvaluationContext ( source: program. source, delegate: nil )
1400
+ XCTAssertNoThrow ( try program. evaluate ( in: context) )
1401
+ XCTAssertEqual ( context. children. count, 1 )
1402
+ }
1403
+
1391
1404
// MARK: Ranges
1392
1405
1393
1406
func testRange( ) {
You can’t perform that action at this time.
0 commit comments