| 58 |
58 |
|
Meter,
|
| 59 |
59 |
|
/// One figure: its body says what it is like, and it emits nothing.
|
| 60 |
60 |
|
Figure,
|
|
61 |
+ |
/// One repeating question: its body says how few may be left, and it emits
|
|
62 |
+ |
/// nothing.
|
|
63 |
+ |
Repeats,
|
| 61 |
64 |
|
}
|
| 62 |
65 |
|
|
| 63 |
66 |
|
pub fn declaration(declaration: &Declaration) -> Result<TokenStream> {
|
| 576 |
579 |
|
panel_member(inner)?,
|
| 577 |
580 |
|
quote!(.with_ranked(#held, ::quasi_router::layout::Priority::#priority)),
|
| 578 |
581 |
|
)),
|
|
582 |
+ |
// The control one slot of a repeating question carries to take itself
|
|
583 |
+ |
// away, and the question the slots are of. Both are `Act`s the region is
|
|
584 |
+ |
// told, and neither could be said at all: written where the vocabulary
|
|
585 |
+ |
// takes them they are expressions in argument position, which no guard
|
|
586 |
+ |
// reaches and no reader of the description sees. audiofiles' rule editor
|
|
587 |
+ |
// is the site for both, twice each.
|
|
588 |
+ |
(
|
|
589 |
+ |
Container::Slot,
|
|
590 |
+ |
Emission::Removes {
|
|
591 |
+ |
label,
|
|
592 |
+ |
action,
|
|
593 |
+ |
body,
|
|
594 |
+ |
},
|
|
595 |
+ |
) => {
|
|
596 |
+ |
let label = arg(label)?;
|
|
597 |
+ |
let called = self::action(action)?;
|
|
598 |
+ |
let taken = accrete(
|
|
599 |
+ |
body,
|
|
600 |
+ |
Container::Act,
|
|
601 |
+ |
"e!(::quasi_router::Act::new(#label, #called)),
|
|
602 |
+ |
)?;
|
|
603 |
+ |
Ok((taken, quote!(.removes(#held))))
|
|
604 |
+ |
}
|
|
605 |
+ |
(
|
|
606 |
+ |
Container::Slot,
|
|
607 |
+ |
Emission::Repeats {
|
|
608 |
+ |
one,
|
|
609 |
+ |
label,
|
|
610 |
+ |
action,
|
|
611 |
+ |
body,
|
|
612 |
+ |
},
|
|
613 |
+ |
) => {
|
|
614 |
+ |
let one = arg(one)?;
|
|
615 |
+ |
let label = arg(label)?;
|
|
616 |
+ |
let called = self::action(action)?;
|
|
617 |
+ |
let question = accrete(
|
|
618 |
+ |
body,
|
|
619 |
+ |
Container::Repeats,
|
|
620 |
+ |
"e!(::quasi_router::Repeating::new(
|
|
621 |
+ |
#one,
|
|
622 |
+ |
::quasi_router::Act::new(#label, #called)
|
|
623 |
+ |
)),
|
|
624 |
+ |
)?;
|
|
625 |
+ |
Ok((question, quote!(.repeating(#held))))
|
|
626 |
+ |
}
|
| 579 |
627 |
|
(Container::Slot, other) => Ok((panel_member(other)?, quote!(.with(#held)))),
|
| 580 |
628 |
|
(Container::Screen, Emission::Region { name, kind, body }) => {
|
| 581 |
629 |
|
Ok((slot(name, kind, body)?, quote!(.with(#held))))
|
| 654 |
702 |
|
emission_span(other),
|
| 655 |
703 |
|
"a meter holds nothing: its body says what it is like",
|
| 656 |
704 |
|
)),
|
|
705 |
+ |
(Container::Repeats, other) => Err(syn::Error::new(
|
|
706 |
+ |
emission_span(other),
|
|
707 |
+ |
"a repeating question holds nothing: its body says how few may be left",
|
|
708 |
+ |
)),
|
| 657 |
709 |
|
(Container::Run, Emission::Beside { priority, inner }) => Ok((
|
| 658 |
710 |
|
node(inner)?,
|
| 659 |
711 |
|
quote!(.beside(#held, ::quasi_router::layout::Priority::#priority)),
|
| 1111 |
1163 |
|
emission_span(inner),
|
| 1112 |
1164 |
|
"`at` places a row on an axis; it needs a `timeline` in scope",
|
| 1113 |
1165 |
|
)),
|
|
1166 |
+ |
Emission::Removes { action, .. } | Emission::Repeats { action, .. } => {
|
|
1167 |
+ |
Err(syn::Error::new(
|
|
1168 |
+ |
action.verb.span(),
|
|
1169 |
+ |
"a repeating question and the control that takes one away are a \
|
|
1170 |
+ |
region's, not a node's",
|
|
1171 |
+ |
))
|
|
1172 |
+ |
}
|
| 1114 |
1173 |
|
}
|
| 1115 |
1174 |
|
}
|
| 1116 |
1175 |
|
|
| 1790 |
1849 |
|
Emission::Row { .. } | Emission::List(_) => Span::call_site(),
|
| 1791 |
1850 |
|
Emission::Form { action, .. } | Emission::Chip { action, .. } => action.verb.span(),
|
| 1792 |
1851 |
|
Emission::Field { kind, .. } => kind.span(),
|
| 1793 |
|
- |
Emission::Act { action, .. } | Emission::Offers { action, .. } => action.verb.span(),
|
|
1852 |
+ |
Emission::Act { action, .. }
|
|
1853 |
+ |
| Emission::Offers { action, .. }
|
|
1854 |
+ |
| Emission::Removes { action, .. }
|
|
1855 |
+ |
| Emission::Repeats { action, .. } => action.verb.span(),
|
| 1794 |
1856 |
|
Emission::Guarded { guard, .. } => guard.span,
|
| 1795 |
1857 |
|
Emission::Given { .. } => Span::call_site(),
|
| 1796 |
1858 |
|
Emission::Region { kind, .. } => match kind {
|