ptx-90-parser-construct

Crates.ioptx-90-parser-construct
lib.rsptx-90-parser-construct
version0.1.0
created_at2025-11-20 00:21:44.489043+00
updated_at2025-11-20 00:21:44.489043+00
descriptionConstructor helper macros used by the PTX 9.0 parser.
homepagehttps://github.com/jialunzhang-psu/ptx-90-parser
repositoryhttps://github.com/jialunzhang-psu/ptx-90-parser
max_upload_size
id1940984
size14,940
Jialun Zhang (jialunzhang-psu)

documentation

https://docs.rs/ptx-90-parser-construct

README

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 its span field.
  • ok! / err! – convenience constructors for Result-producing parser code.
  • cclosure! / okmap! – turn tuples of parser outputs into AST values while threading spans.
  • func! – append a span argument 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 })
}
Commit count: 0

cargo fmt