Skip to main content

parse_module

Function parse_module 

Source
pub fn parse_module(input: &str) -> Result<Module, ParseError>
Expand description

Parses a complete PTX module.

The input must contain the module directives required by the PTX grammar supported by this crate. Leading and trailing whitespace is accepted, but any non-whitespace input left after the parsed module is reported as ParseErrorKind::TrailingInput. Other parse failures report the byte offset of the unexpected token.

This parser is intentionally syntax-focused: it builds the AST and reports parse errors, but it does not validate target-specific instruction semantics.

ยงErrors

Returns an error if input is not a complete PTX module accepted by this parser or if non-whitespace trailing input remains.