Let a form take a question another shape built
Every other container already extends the courtesy: a table takes a row,
a cell takes a control, a region takes a field, a list takes a row. A
form was the one that did not, so a question two forms share had to be
written out in each.
audiofiles' editor is the site. `span` is the two ends of a trim and
appears twice in one form; `milliseconds` is a bounded position and
appears four times across two. Written out, that is the same four
settings repeated eight times, and the optional ceiling repeated with
them.
2 files changed,
+16 insertions,
-2 deletions
| 1 |
1 |
|
[package]
|
| 2 |
2 |
|
name = "quasi-declare"
|
| 3 |
|
- |
version = "0.1.3"
|
|
3 |
+ |
version = "0.1.4"
|
| 4 |
4 |
|
description = "The declare! form: a screen description compiled to Rust at build time."
|
| 5 |
5 |
|
edition.workspace = true
|
| 6 |
6 |
|
rust-version.workspace = true
|
| 1148 |
1148 |
|
let built = field(kind, name, label, body)?;
|
| 1149 |
1149 |
|
asked.push(quote!(#held.push(#built);));
|
| 1150 |
1150 |
|
}
|
|
1151 |
+ |
// A question another shape built, which is the courtesy every other
|
|
1152 |
+ |
// container already extends: a table takes a row, a cell takes a
|
|
1153 |
+ |
// control, a region takes a field. A form was the one that did not,
|
|
1154 |
+ |
// so two ends of an interval or four bounded millisecond boxes had
|
|
1155 |
+ |
// to be written out per form. audiofiles' editor is the site --
|
|
1156 |
+ |
// `span` twice in one form and `milliseconds` four times across two.
|
|
1157 |
+ |
Item::Emit(Emission::Include(supplier)) => {
|
|
1158 |
+ |
let supplier = self::hole(supplier)?;
|
|
1159 |
+ |
asked.push(quote!(#held.push(::std::convert::Into::into(#supplier));));
|
|
1160 |
+ |
}
|
| 1151 |
1161 |
|
Item::Emit(Emission::Guarded { guard, inner }) => {
|
| 1152 |
1162 |
|
let Emission::Field {
|
| 1153 |
1163 |
|
kind,
|
| 1187 |
1197 |
|
));
|
| 1188 |
1198 |
|
}
|
| 1189 |
1199 |
|
Item::Emit(other) => {
|
| 1190 |
|
- |
return Err(syn::Error::new(emission_span(other), "a form holds fields"));
|
|
1200 |
+ |
return Err(syn::Error::new(
|
|
1201 |
+ |
emission_span(other),
|
|
1202 |
+ |
"a form holds fields: write `field <kind> <name> <label>` or \
|
|
1203 |
+ |
`include <shape>;`",
|
|
1204 |
+ |
));
|
| 1191 |
1205 |
|
}
|
| 1192 |
1206 |
|
}
|
| 1193 |
1207 |
|
}
|