Function dfir_lang::process_singletons::preprocess_singletons

source ·
pub fn preprocess_singletons(
    tokens: TokenStream,
    found_idents: &mut Vec<Ident>,
) -> TokenStream
Expand description

Finds all the singleton references #my_var and appends them to found_idents. Returns the TokenStream but with the hashes removed from the varnames.

The returned tokens are used for “preflight” parsing, to check that the rest of the syntax is OK. However the returned tokens are not used in the codegen as we need to use postprocess_singletons later to substitute-in the context referencing code for each singleton