pub struct ParseOptions {
pub max_diagnostics: Option<usize>,
pub input_resolver: Option<Arc<dyn InputResolver>>,
pub standard_state: Option<Arc<ParsingState<Flm>>>,
}Expand description
The settings of one parse that can differ from the settings of the built language.
ParseOptions::default() keeps every setting of the built language. A field
set here applies to this parse only.
Fields§
§max_diagnostics: Option<usize>The maximum number of diagnostics that this parse stores. None keeps
the cap of the built language
(LangInputs::diagnostics_limit).
Diagnostics beyond the cap are not stored, but they are counted.
input_resolver: Option<Arc<dyn InputResolver>>The input resolver for this parse, used in place of the input resolver
of the built language; see crate::lang::input. None keeps the
input resolver of the built language. For instance, an embedding program
that records the files read during a build can set here an input
resolver that records these files, for the parses of this build.
standard_state: Option<Arc<ParsingState<Flm>>>The standard state of this parse: the state that the state events
FlmEvent::StandardScope and
FlmEvent::StandardState
restore. None keeps the initial state of the built language
(BuiltLang::initial_state).
The state must be derived from the initial state of the built language
with BuiltLang::derive_state. A program that parses from a state
with a scoped package added for the whole
parse sets that state here, so that a region that declares
FlmEvent::StandardState keeps
the package. The library sets it for the parse of a user
definition’s template, so
that the placeholders stay available in such a region.
Trait Implementations§
Source§impl Clone for ParseOptions
impl Clone for ParseOptions
Source§impl Debug for ParseOptions
impl Debug for ParseOptions
Source§impl Default for ParseOptions
impl Default for ParseOptions
impl Eq for ParseOptions
Source§impl PartialEq for ParseOptions
Two ParseOptions values are equal if they have the same cap on
diagnostics, the same input resolver and the same standard state. Two input
resolvers, or two standard states, are the same if both are None, or if
both point to the same allocation.
impl PartialEq for ParseOptions
Two ParseOptions values are equal if they have the same cap on
diagnostics, the same input resolver and the same standard state. Two input
resolvers, or two standard states, are the same if both are None, or if
both point to the same allocation.
Auto Trait Implementations§
impl !RefUnwindSafe for ParseOptions
impl !UnwindSafe for ParseOptions
impl Forget for ParseOptions
impl Freeze for ParseOptionswhere
*const ArcInner<dyn InputResolver> is !null: Freeze,
PhantomData<ArcInner<dyn InputResolver>>: Freeze,
*const ArcInner<ParsingState<Flm>> is !null: Freeze,
PhantomData<ArcInner<ParsingState<Flm>>>: Freeze,
impl Move for ParseOptions
impl Send for ParseOptions
impl Sync for ParseOptions
impl Unpin for ParseOptions
impl UnsafeUnpin for ParseOptionswhere
*const ArcInner<dyn InputResolver> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn InputResolver>>: UnsafeUnpin,
*const ArcInner<ParsingState<Flm>> is !null: UnsafeUnpin,
PhantomData<ArcInner<ParsingState<Flm>>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more