Skip to main content

parse_source

Function parse_source 

Source
pub fn parse_source<R: Resolver>(
    file_name: &str,
    src: &str,
    resolver: R,
    cfg: &ParserConfig,
) -> Result<Specification, Error>
Expand description

Full front-end path for an IDL source: preprocessor + parser + key-pragma application in a single call.

In contrast to parse (which expects pre-processed input and does not see pragmas), here the preprocessor runs first — incl. #include via the resolver —, then the parser, and finally apply_key_pragmas, which translates #pragma keylist / #pragma DCPS_DATA_KEY / #pragma cats and the RTI keylist VendorExtension into synthetic @key annotations. This makes pragma-keyed fields downstream identical to inline @key.

For sources without #include, a MemoryResolver suffices.

§Errors

Error::Preprocess on preprocessor errors, otherwise as parse.