[][src]Crate macro_helper

This crate is a collection of ligthweight procedural macros typically used for writing others,either procedural or not,as such covers some of the missing features you might expect from macro_rules! like expansion bucles controlled by you and not an input.Or guarantee an identifier is borrowed in the manner you want over any other,included own.

This crate is no_std.

Macros

Stringify

Stringify the input.

as_mut_ref_token

Ensures that the reference or identifier passed is mutable and changes it if is not.

as_ref_token

Ensures that the reference or identifier passed is shared and changes it if is not.

count_spec_tokens

Expands to the number of spec tokens you pass in tokens => spec syntax,useful when expanding expansion bucles with a given separator matched in spec;to retrieve the number of expansions,as it have more precedence than the other macros.

count_tokens

Expands to the number of tokens you pass.

eval_encoded

Eval encoded strings that maybe are from other macros.

expansion_bucle

An expansion bucle with syntax code => num when num is the number of times the code should be expanded.

expansion_bucle_counted

An expansion bucle with syntax code => num when num is the number of times the code should be expanded along with a replacement of the rep_count imaginary variable at each "iteration" with values from 0 thought num-1.

proto

This macro panics with the message "Prototype reached 'tokens'." where tokens are the tokens passed.