/// Parse decls for decls in compilation.
/// - Returns decls without reference to the source text to avoid the need to
///   keep the source text in memory when caching decls.
/// - Preserves user attributes in decls necessary for producing facts.
Parse decls for decls in compilation.
Returns decls without reference to the source text to avoid the need to
keep the source text in memory when caching decls.
Preserves user attributes in decls necessary for producing facts.
Parse decls for decls in compilation . Returns decls without reference to the source text to avoid the need to keep the source text in memory when caching decls . Preserves user attributes in decls necessary for producing facts .
pub fn parse_decls_without_reference_text<'a, 'text>(
    opts: &'a DeclParserOptions<'a>,
    filename: RelativePath,
    text: &'text [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,
        ArenaSourceTextAllocator(arena),
        true, // retain_or_omit_user_attributes_for_facts
        true, // 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_without_reference_text < ' a , ' text > ( opts : & ' a DeclParserOptions < ' a > , filename : RelativePath , text : & ' text [ 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 , ArenaSourceTextAllocator ( arena ) , true , // retain_or_omit_user_attributes_for_facts true , // 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 decls in compilation.
Parse decls for decls in compilation .
opts
&'a DeclParserOptions<'a>
filename
RelativePath
text
&'text [u8]
arena
&'a Bump
stack_limit
Option<&StackLimit>