| 54 |
54 |
|
Tag,
|
| 55 |
55 |
|
/// An axis: its members are `at`, each a placement and the row on it.
|
| 56 |
56 |
|
Timeline,
|
|
57 |
+ |
/// One meter: its body says what it is like, and it emits nothing.
|
|
58 |
+ |
Meter,
|
| 57 |
59 |
|
}
|
| 58 |
60 |
|
|
| 59 |
61 |
|
pub fn declaration(declaration: &Declaration) -> Result<TokenStream> {
|
| 598 |
600 |
|
emission_span(other),
|
| 599 |
601 |
|
"a tag holds nothing: its body says what it is like",
|
| 600 |
602 |
|
)),
|
|
603 |
+ |
(Container::Meter, other) => Err(syn::Error::new(
|
|
604 |
+ |
emission_span(other),
|
|
605 |
+ |
"a meter holds nothing: its body says what it is like",
|
|
606 |
+ |
)),
|
| 601 |
607 |
|
(Container::Run, Emission::Beside { priority, inner }) => Ok((
|
| 602 |
608 |
|
node(inner)?,
|
| 603 |
609 |
|
quote!(.beside(#held, ::quasi_router::layout::Priority::#priority)),
|
| 869 |
875 |
|
)?;
|
| 870 |
876 |
|
Ok(quote!(::quasi_router::Node::token(#tag)))
|
| 871 |
877 |
|
}
|
|
878 |
+ |
Emission::Simple { member, args, body } if member == "proportion" => {
|
|
879 |
+ |
// A meter standing on its own. `Node::Meter` holds a `Meter`, so
|
|
880 |
+ |
// the body sets on the meter the way `badge`'s sets on a `Tag`, and
|
|
881 |
+ |
// the member is named for the row part rather than for the type:
|
|
882 |
+ |
// `meter` is a setting on `Row` and on `Cell`, so it cannot also be
|
|
883 |
+ |
// a member.
|
|
884 |
+ |
let args = args.iter().map(self::arg).collect::<Result<Vec<_>>>()?;
|
|
885 |
+ |
let meter = accrete(
|
|
886 |
+ |
body,
|
|
887 |
+ |
Container::Meter,
|
|
888 |
+ |
"e!(::quasi_router::screen::Meter::new(#(#args),*)),
|
|
889 |
+ |
)?;
|
|
890 |
+ |
Ok(quote!(::quasi_router::Node::Meter(#meter)))
|
|
891 |
+ |
}
|
| 872 |
892 |
|
Emission::Simple { member, args, body } if member == "underway" => {
|
| 873 |
893 |
|
// The one member whose name is not its constructor's. `Node::pending`
|
| 874 |
894 |
|
// is the third `StandIn` state, beside `empty` and `failed`, and
|