/// Parse decls for typechecking.
/// - References the source text to avoid spending time or space copying
///   identifiers into the arena (when possible).
/// - Excludes user attributes which are irrelevant to typechecking.
Parse decls for typechecking.
References the source text to avoid spending time or space copying
identifiers into the arena (when possible).
Excludes user attributes which are irrelevant to typechecking.
Parse decls for typechecking . References the source text to avoid spending time or space copying identifiers into the arena ( when possible ) . Excludes user attributes which are irrelevant to typechecking .
pub fn parse_decls<'a>(
    opts: &'a DeclParserOptions<'a>,
    filename: RelativePath,
    text: &'a [u8],
    arena: &'a Bump,
    stack_limit: Option<&StackLimit>,
) -> ParsedFile<'a> {
    let text = SourceText::make(RcOc::new(filename), text);
    let (_, errors, state, mode) = parse_script_with_text_allocator(
        opts,
        &text,
        arena,
        stack_limit,
        NoSourceTextAllocator,
        false, // retain_or_omit_user_attributes_for_facts
        false, // simplify_naming_for_facts
    );
    ParsedFile {
        mode,
        file_attributes: collect_file_attributes(
            arena,
            state.file_attributes.iter().copied(),
            state.file_attributes.len(),
        ),
        decls: state.decls,
        has_first_pass_parse_errors: !errors.is_empty(),
    }
}
pub fn parse_decls < ' a > ( opts : & ' a DeclParserOptions < ' a > , filename : RelativePath , text : & ' a [ u8 ] , arena : & ' a Bump , stack_limit : Option < & StackLimit > , ) -> ParsedFile < ' a > { let text = SourceText :: make ( RcOc :: new ( filename ) , text ) ; let ( _ , errors , state , mode ) = parse_script_with_text_allocator ( opts , & text , arena , stack_limit , NoSourceTextAllocator , false , // retain_or_omit_user_attributes_for_facts false , // simplify_naming_for_facts ) ; ParsedFile { mode , file_attributes : collect_file_attributes ( arena , state . file_attributes . iter ( ) . copied ( ) , state . file_attributes . len ( ) , ) , decls : state . decls , has_first_pass_parse_errors : ! errors . is_empty ( ) , } }
Parse decls for typechecking.
Parse decls for typechecking .
opts
&'a DeclParserOptions<'a>
filename
RelativePath
text
&'a [u8]
arena
&'a Bump
stack_limit
Option<&StackLimit>