Struct cl_parser::inliner::ModuleInliner

source ·
pub struct ModuleInliner { /* private fields */ }

Implementations§

source§

impl ModuleInliner

source

pub fn new(root: impl AsRef<Path>) -> Self

Creates a new ModuleInliner

source

pub fn has_errors(&self) -> bool

Returns true when the ModuleInliner has errors to report

source

pub fn into_errs(self) -> Option<(IoErrs, ParseErrs)>

Returns the IO Errors and parse Errors

source

pub fn inline(self, file: File) -> Result<File, (File, IoErrs, ParseErrs)>

Traverses a [File], attempting to inline all submodules.

This is a simple wrapper around ModuleInliner::fold_file() and ModuleInliner::into_errs()

Trait Implementations§

source§

impl Fold for ModuleInliner

source§

fn fold_module(&mut self, m: Module) -> Module

Traverses down the module tree, entering ever nested directories

source§

fn fold_module_kind(&mut self, m: ModuleKind) -> ModuleKind

Attempts to read and parse a file for every module in the tree

§

fn fold_span(&mut self, extents: Span) -> Span

§

fn fold_mutability(&mut self, mutability: Mutability) -> Mutability

§

fn fold_visibility(&mut self, visibility: Visibility) -> Visibility

§

fn fold_sym(&mut self, ident: Interned<'static, str>) -> Interned<'static, str>

§

fn fold_literal(&mut self, lit: Literal) -> Literal

§

fn fold_bool(&mut self, b: bool) -> bool

§

fn fold_char(&mut self, c: char) -> char

§

fn fold_int(&mut self, i: u128) -> u128

§

fn fold_string(&mut self, s: String) -> String

§

fn fold_file(&mut self, f: File) -> File

§

fn fold_attrs(&mut self, a: Attrs) -> Attrs

§

fn fold_meta(&mut self, m: Meta) -> Meta

§

fn fold_meta_kind(&mut self, kind: MetaKind) -> MetaKind

§

fn fold_item(&mut self, i: Item) -> Item

§

fn fold_item_kind(&mut self, kind: ItemKind) -> ItemKind

§

fn fold_alias(&mut self, a: Alias) -> Alias

§

fn fold_const(&mut self, c: Const) -> Const

§

fn fold_static(&mut self, s: Static) -> Static

§

fn fold_function(&mut self, f: Function) -> Function

§

fn fold_param(&mut self, p: Param) -> Param

§

fn fold_struct(&mut self, s: Struct) -> Struct

§

fn fold_struct_kind(&mut self, kind: StructKind) -> StructKind

§

fn fold_struct_member(&mut self, m: StructMember) -> StructMember

§

fn fold_enum(&mut self, e: Enum) -> Enum

§

fn fold_enum_kind(&mut self, kind: EnumKind) -> EnumKind

§

fn fold_variant(&mut self, v: Variant) -> Variant

§

fn fold_variant_kind(&mut self, kind: VariantKind) -> VariantKind

§

fn fold_impl(&mut self, i: Impl) -> Impl

§

fn fold_impl_kind(&mut self, kind: ImplKind) -> ImplKind

§

fn fold_use(&mut self, u: Use) -> Use

§

fn fold_use_tree(&mut self, tree: UseTree) -> UseTree

§

fn fold_ty(&mut self, t: Ty) -> Ty

§

fn fold_ty_kind(&mut self, kind: TyKind) -> TyKind

§

fn fold_ty_tuple(&mut self, t: TyTuple) -> TyTuple

§

fn fold_ty_ref(&mut self, t: TyRef) -> TyRef

§

fn fold_ty_fn(&mut self, t: TyFn) -> TyFn

§

fn fold_path(&mut self, p: Path) -> Path

§

fn fold_path_part(&mut self, p: PathPart) -> PathPart

§

fn fold_stmt(&mut self, s: Stmt) -> Stmt

§

fn fold_stmt_kind(&mut self, kind: StmtKind) -> StmtKind

§

fn fold_semi(&mut self, s: Semi) -> Semi

§

fn fold_let(&mut self, l: Let) -> Let

§

fn fold_expr(&mut self, e: Expr) -> Expr

§

fn fold_expr_kind(&mut self, kind: ExprKind) -> ExprKind

§

fn fold_assign(&mut self, a: Assign) -> Assign

§

fn fold_modify(&mut self, m: Modify) -> Modify

§

fn fold_modify_kind(&mut self, kind: ModifyKind) -> ModifyKind

§

fn fold_binary(&mut self, b: Binary) -> Binary

§

fn fold_binary_kind(&mut self, kind: BinaryKind) -> BinaryKind

§

fn fold_unary(&mut self, u: Unary) -> Unary

§

fn fold_unary_kind(&mut self, kind: UnaryKind) -> UnaryKind

§

fn fold_member(&mut self, m: Member) -> Member

§

fn fold_member_kind(&mut self, kind: MemberKind) -> MemberKind

§

fn fold_index(&mut self, i: Index) -> Index

§

fn fold_structor(&mut self, s: Structor) -> Structor

§

fn fold_fielder(&mut self, f: Fielder) -> Fielder

§

fn fold_array(&mut self, a: Array) -> Array

§

fn fold_array_rep(&mut self, a: ArrayRep) -> ArrayRep

§

fn fold_addrof(&mut self, a: AddrOf) -> AddrOf

§

fn fold_block(&mut self, b: Block) -> Block

§

fn fold_group(&mut self, g: Group) -> Group

§

fn fold_tuple(&mut self, t: Tuple) -> Tuple

§

fn fold_loop(&mut self, l: Loop) -> Loop

§

fn fold_while(&mut self, w: While) -> While

§

fn fold_if(&mut self, i: If) -> If

§

fn fold_for(&mut self, f: For) -> For

§

fn fold_else(&mut self, e: Else) -> Else

§

fn fold_break(&mut self, b: Break) -> Break

§

fn fold_return(&mut self, r: Return) -> Return

§

fn fold_continue(&mut self, c: Continue) -> Continue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.