new_parser_from_file in rustc_parse - Rust
Description: Creates a new parser from a filename. On failure, the errors must be consumed via `unwrap_or_emit_fatal`, `emit`, `cancel`, etc., otherwise a panic will occur when they are dropped.

Skip to main content

## new_parser_from_file

# Function new_parser_from_file

Source

    pub fn new_parser_from_file<'a>(
        psess: &'a ParseSess,
        path: &Path,
        strip_tokens: StripTokens,
        sp: Option<Span>,
    ) -> Result<Parser<'a>, Vec<Diag<'a>>>

Expand description

Creates a new parser from a filename. On failure, the errors must be consumed via `unwrap_or_emit_fatal`, `emit`, `cancel`, etc., otherwise a panic will occur when they are dropped.

If a span is given, that is used on an error as the source of the problem.