Skip to main content

options

Macro options 

Source
macro_rules! options {
    ($($field:ident : $value:expr),* $(,)?) => { ... };
}
Expand description

Construct Options from its defaults and a list of field assignments.

ยงExamples

let options = granit_parser::options! {
    max_buffered_comment_events: 64,
    emit_comments: false,
    simple_key_max_lookahead: 2048,
};

assert_eq!(options.max_buffered_comment_events, 64);
assert!(!options.emit_comments);
assert_eq!(options.simple_key_max_lookahead, 2048);
assert_eq!(options.flow_nesting_limit, 255);