Skip to main content

parse_define

Function parse_define 

Source
pub fn parse_define(
    tokens: &[PpToken],
    interner: &mut Interner,
) -> (Option<MacroDef>, Vec<Diagnostic>)
Expand description

Parses the tokens after #define into a definition.

tokens is the rest of the directive line with no end marker, exactly as the lexer produced it. Diagnostics are returned alongside the definition where the definition is still usable, and alone where it is not.

ยงPanics

Panics if tokens did not come from rucc_lex, which interns the spelling of every identifier it produces. There is no other source of preprocessing tokens.