Struct rslint_parser::ParserState [−][src]
pub struct ParserState {Show 22 fields
pub allow_object_expr: bool,
pub include_in: bool,
pub continue_allowed: bool,
pub break_allowed: bool,
pub labels: HashMap<String, Range<usize>>,
pub in_generator: bool,
pub in_function: bool,
pub potential_arrow_start: bool,
pub in_async: bool,
pub strict: Option<StrictMode>,
pub is_module: bool,
pub default_item: Option<Range<usize>>,
pub expr_recovery_set: TokenSet,
pub should_record_names: bool,
pub name_map: HashMap<String, Range<usize>>,
pub in_cond_expr: bool,
pub in_case_cond: bool,
pub in_declare: bool,
pub in_binding_list_for_signature: bool,
pub decorators_were_valid: bool,
pub in_default: bool,
pub for_head_error: Option<Diagnostic>,
// some fields omitted
}
Expand description
State kept by the parser while parsing. It is required for things such as strict mode or async functions
Fields
allow_object_expr: bool
If false, object expressions are not allowed to be parsed inside an expression.
Also applies for object patterns
include_in: bool
Whether in
should be counted in a binary expression
this is for for...in
statements to prevent ambiguity.
continue_allowed: bool
Whether the parser is in an iteration statement and continue
is allowed.
break_allowed: bool
Whether the parser is in an iteration or switch statement and
break
is allowed.
labels: HashMap<String, Range<usize>>
A list of labels for labelled statements used to report undefined label errors for break and continue, as well as duplicate labels
in_generator: bool
Whether the parser is in a generator function like function* a() {}
in_function: bool
Whether the parser is inside of a function
potential_arrow_start: bool
Whether we potentially are in a place to parse an arrow expression
in_async: bool
Whether we are in an async function
strict: Option<StrictMode>
Whether we are in strict mode code
is_module: bool
Whether the code we are parsing is a module
default_item: Option<Range<usize>>
The exported default item, used for checking duplicate defaults
expr_recovery_set: TokenSet
The recovery set primary_expr will use
should_record_names: bool
name_map: HashMap<String, Range<usize>>
in_cond_expr: bool
Whether the parser is in a conditional expr (ternary expr)
in_case_cond: bool
in_declare: bool
in_binding_list_for_signature: bool
decorators_were_valid: bool
in_default: bool
for_head_error: Option<Diagnostic>
Implementations
pub fn check_default(
&mut self,
p: &mut Parser<'_>,
marker: CompletedMarker
) -> CompletedMarker
pub fn check_default(
&mut self,
p: &mut Parser<'_>,
marker: CompletedMarker
) -> CompletedMarker
Check for duplicate defaults and update state
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ParserState
impl Send for ParserState
impl Sync for ParserState
impl Unpin for ParserState
impl UnwindSafe for ParserState
Blanket Implementations
Mutably borrows from an owned value. Read more
Whether this implementor has acknowledged the 1.1.0 update to
unerase
’s documented implementation requirements. Read more