1 unstable release
| 0.1.0 | Nov 20, 2025 |
|---|
#7 in #ptx
Used in ptx-90-parser
14KB
226 lines
ptx-90-parser-construct
ptx-90-parser-construct (imported as ptx_90_parser_construct) bundles the procedural macros that shorten AST construction in ptx-90-parser.
The main helpers are:
c!– construct a struct and automatically fill itsspanfield.ok!/err!– convenience constructors forResult-producing parser code.cclosure!/okmap!– turn tuples of parser outputs into AST values while threading spans.func!– append aspanargument to an existing closure.
use ptx_90_parser_construct::{c, ok};
fn parse_operand(symbol: Symbol, span: Span) -> Result<Operand, PtxParseError> {
ok!(Operand::Symbol { symbol })
}
Dependencies
~130–520KB
~12K SLoC