swc_ecma_parser

Function parse_file_as_script

source
pub fn parse_file_as_script(
    fm: &SourceFile,
    syntax: Syntax,
    target: EsVersion,
    comments: Option<&dyn Comments>,
    recovered_errors: &mut Vec<Error>,
) -> PResult<Script>
Expand description

Note: This is recommended way to parse a file.

This is an alias for Parser, Lexer and SourceFileInput, but instantiation of generics occur in swc_ecma_parser crate.