max / quasi
- Co-Authored-By
- Claude Opus 5 (1M context) <noreply@anthropic.com>
- Claude-Session
- https://claude.ai/code/session_01MptwXZ8k65v19rFmdGAyki
1 file changed,
+16 insertions,
-1 deletion
| @@ -1207,9 +1207,24 @@ | |||
| 1207 | 1207 | let value = panel_member(emission)?; | |
| 1208 | 1208 | Ok(quote!(#nodes.push(#value);)) | |
| 1209 | 1209 | } | |
| 1210 | + | // The one attribute a panel takes, and it means in a panel what it | |
| 1211 | + | // means on a region: splice another shape's nodes in here. A panel | |
| 1212 | + | // built out of panels had no spelling until goingson's Sharing | |
| 1213 | + | // section, which is eight of them under one heading. | |
| 1214 | + | Item::Attribute { name, args, guard } if name == "extend" => { | |
| 1215 | + | let spliced = args.iter().map(arg).collect::<Result<Vec<_>>>()?; | |
| 1216 | + | let extending = quote!(#(#nodes.extend(#spliced);)*); | |
| 1217 | + | guard.as_ref().map_or_else( | |
| 1218 | + | || Ok(extending.clone()), | |
| 1219 | + | |guard| { | |
| 1220 | + | let test = predicate(guard)?; | |
| 1221 | + | Ok(quote!(if #test { #extending })) | |
| 1222 | + | }, | |
| 1223 | + | ) | |
| 1224 | + | } | |
| 1210 | 1225 | Item::Attribute { name, .. } => Err(syn::Error::new( | |
| 1211 | 1226 | name.span(), | |
| 1212 | - | "a panel has nothing to set: say it on the member it belongs to", | |
| 1227 | + | "a panel sets nothing but `extend`: say it on the member it belongs to", | |
| 1213 | 1228 | )), | |
| 1214 | 1229 | }) | |
| 1215 | 1230 | .collect() |