ptx-syntax-proc-macros 0.1.0

Procedural macros used by PTX syntax parser implementations.
Documentation
  • Coverage
  • 100%
    8 out of 8 items documented0 out of 7 items with examples
  • Size
  • Source code size: 18.37 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 190.84 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jialunzhang-psu

ptx-syntax-proc-macros

ptx-syntax-proc-macros contains the procedural macros used to implement ptx-syntax. It is an implementation dependency rather than a standalone parsing API.

The crate provides:

  • 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.
  • #[derive(Spanned)] – implement the parser's Spanned trait for an AST struct or enum containing a named span field.
use ptx_syntax_proc_macros::{c, ok};

fn parse_operand(symbol: Symbol, span: Span) -> Result<Operand, PtxParseError> {
    ok!(Operand::Symbol { symbol })
}