pub enum RestrictedInterior {
Document,
Template(TemplateInteriorRules),
}Expand description
The restricted-interior policy: what the interior of a restricted
argument recognizes. The parsing state carries it
(FlmStateExt::restricted_interior).
The language has two restricted argument shapes, each read by a parser of
its own: the characters-only group
(FlmCharsGroupArgumentParser,
as in \label{…} and \ref{…}) and the verbatim argument or environment
body (crate::lang::verbatim, as in \verbcode{…}). Both parsers read
their interior under the parsing state this policy derives
(chars_group_delta,
verbatim_delta), so one setting on the state
decides for both whether a placeholder is recognized inside them. A
terminated argument read as
raw text is verbatim content too, and is read under the same policy
(raw_text_delta). The
module documentation of
lang::verbatim
states how the two shapes differ.
Serialized form: "document", or {template: {commands, specials}}.
Variants§
Document
The policy of a document parse: no command and no special character
sequence is recognized inside a restricted argument, so # and \ are
ordinary characters there.
Template(TemplateInteriorRules)
The policy of a template parse: the listed rules stay enabled inside a restricted argument, so a placeholder written there is recognized.
Implementations§
Source§impl RestrictedInterior
impl RestrictedInterior
Sourcepub fn verbatim_delta(
&self,
terminator: Arc<GroupRule<Flm>>,
) -> ParsingStateDelta<Flm>
pub fn verbatim_delta( &self, terminator: Arc<GroupRule<Flm>>, ) -> ParsingStateDelta<Flm>
Returns the change of parsing state under which a verbatim region’s
interior is read: techy’s verbatim change (verbatim_state_delta:
every tokenizer rule off, with terminator as the only recognized
closing delimiter) and, under Template, the listed
rules enabled again.
Sourcepub fn raw_text_delta(&self) -> ParsingStateDelta<Flm>
pub fn raw_text_delta(&self) -> ParsingStateDelta<Flm>
Returns the change of parsing state under which raw text is read by a
parser that installs its terminator itself: the change of
verbatim_delta (every tokenizer rule off,
and under Template the listed rules enabled
again), with the expected closing delimiter left as it is.
A terminated argument read as raw text uses it: the terminator of such an argument depends on the run of characters that opens it at the use site, so the terminator is known only once the parser has read that run, and the parser then installs it as the expected closing delimiter of the content.
Sourcepub fn chars_group_delta(
&self,
base: &ParsingState<Flm>,
group_type: FlmGroupType,
) -> ParsingStateDelta<Flm>
pub fn chars_group_delta( &self, base: &ParsingState<Flm>, group_type: FlmGroupType, ) -> ParsingStateDelta<Flm>
Returns the change of parsing state under which a characters-only
group’s interior is read. base is the state the argument itself is
parsed under, and group_type the group class of the argument’s group.
The change switches commands and special character sequences off and
comments on, and keeps only the group rules of base whose class is
group_type, so that the delimiters of mathematics, a different group
class, are read as characters. Under Template, the
listed rules are enabled again on top of that.
Sourcepub fn is_template(&self) -> bool
pub fn is_template(&self) -> bool
Returns whether this is the Template policy.
Trait Implementations§
Source§impl Clone for RestrictedInterior
impl Clone for RestrictedInterior
Source§impl Debug for RestrictedInterior
impl Debug for RestrictedInterior
Source§impl Default for RestrictedInterior
impl Default for RestrictedInterior
Source§impl<__L: Lang> DeserializableValue<__L> for RestrictedInterior
impl<__L: Lang> DeserializableValue<__L> for RestrictedInterior
Source§fn deserialize_value(
__value: &SerialValue,
__cx: &mut DeserializeContext<'_, __L>,
) -> Result<Self, DeserializeError>where
__L: SerializableLang,
fn deserialize_value(
__value: &SerialValue,
__cx: &mut DeserializeContext<'_, __L>,
) -> Result<Self, DeserializeError>where
__L: SerializableLang,
cx gives the call access to the
state of the deserialization in progress. Read moreSource§fn deserialize_field(
name: &'static str,
value: Option<&SerialValue>,
cx: &mut DeserializeContext<'_, L>,
) -> Result<Self, DeserializeError>where
L: SerializableLang,
fn deserialize_field(
name: &'static str,
value: Option<&SerialValue>,
cx: &mut DeserializeContext<'_, L>,
) -> Result<Self, DeserializeError>where
L: SerializableLang,
name of a structure whose fields are read by
name (a type with #[derive(DeserializableValue)]): value is the field’s
value, or None when the key is missing from the map. The default requires
the key and reads its value with deserialize_value;
Option<T> reads a missing key as None. The counterpart of
SerializableValue::is_absent_field: a type overriding one overrides both. Read moreSource§impl<'de> Deserialize<'de> for RestrictedInterior
impl<'de> Deserialize<'de> for RestrictedInterior
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RestrictedInterior
Source§impl PartialEq for RestrictedInterior
impl PartialEq for RestrictedInterior
Source§impl<__L: Lang> SerializableValue<__L> for RestrictedInterior
impl<__L: Lang> SerializableValue<__L> for RestrictedInterior
Source§fn serialize_value(
&self,
__cx: &mut SerializeContext<'_, __L>,
) -> Result<SerialValue, SerializeError>where
__L: SerializableLang,
fn serialize_value(
&self,
__cx: &mut SerializeContext<'_, __L>,
) -> Result<SerialValue, SerializeError>where
__L: SerializableLang,
cx gives the call access to the state
of the serialization in progress — a value that refers to a table object
(a span’s source, say) interns it through cx and embeds the position. Read moreSource§fn is_absent_field(&self) -> boolwhere
L: SerializableLang,
fn is_absent_field(&self) -> boolwhere
L: SerializableLang,
#[derive(SerializableValue)]), is left out of the structure’s map
entirely — no key at all, rather than a key with a null value. The default is
false; Option<T> is absent when it is None. Read moreSource§impl Serialize for RestrictedInterior
impl Serialize for RestrictedInterior
impl StructuralPartialEq for RestrictedInterior
Auto Trait Implementations§
impl Forget for RestrictedInterior
impl Freeze for RestrictedInterior
impl Move for RestrictedInterior
impl RefUnwindSafe for RestrictedInterior
impl Send for RestrictedInteriorwhere
RawVecInner: Send,
impl Sync for RestrictedInteriorwhere
RawVecInner: Sync,
impl Unpin for RestrictedInterior
impl UnsafeUnpin for RestrictedInterior
impl UnwindSafe for RestrictedInteriorwhere
RawVecInner: UnwindSafe,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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