The error messages we get from yacc/parser.rs are really helpful, but if the text gets through to ctbuilder.rs the errors are less helpful. Consider:
FuncAttrs -> Result<Vec<AstFuncAttr>, Box<dyn Error>>:
FuncAttrs FuncAttr { flattenr($1, $) }
The error one gets is:
Unknown text following '$' operator: $)
without a line number (and also repeating the $ character; I think the relevant code &pre_action[last + off..] is missing a +1). That can make tracking the problem down a little frustrating. Given we have token_span in YaccGrammar can we also record and pass through the span of action text? Then ctbuilder.rs could give line/column warnings for such errors.