pub struct PragmaSet {
pub entries: Vec<Pragma>,
}Expand description
The pragmas in force in one Polydat scope: those the scope declares and those of every scope enclosing it.
Fields§
§entries: Vec<Pragma>The pragmas in force, the enclosing scopes’ first, in order.
Implementations§
Source§impl PragmaSet
impl PragmaSet
Sourcepub fn host(strict: bool) -> PragmaSet
pub fn host(strict: bool) -> PragmaSet
The set a program’s top scope starts from before its own pragmas
are added: strict when the host asks for strict compilation
(CompileOptions::strict, the binary’s --strict), and empty
otherwise. The seeded strict is in force exactly as a
pragma strict written at the top of the program is, so every
scope that inherits the top scope’s set inherits it, and a module
body, which compiles under its own pragmas alone, does not.
Sourcepub fn strict_types(&self) -> bool
pub fn strict_types(&self) -> bool
Returns true if either strict_types or strict, which implies
it, is in force.
Sourcepub fn strict_values(&self) -> bool
pub fn strict_values(&self) -> bool
Returns true if either strict_values or strict, which implies
it, is in force.
Sourcepub fn strict_names(&self) -> bool
pub fn strict_names(&self) -> bool
Returns true if strict name checking is in force: strict, and no
other pragma. A comprehension read in this scope that reads a
name nothing binds is then refused (comprehension_forms.md §5 V3).
Sourcepub fn unknown(&self) -> impl Iterator<Item = &Pragma>
pub fn unknown(&self) -> impl Iterator<Item = &Pragma>
Iterate the pragmas in force that the compiler doesn’t recognise.
Sourcepub fn nested(&self, statements: &[Statement]) -> PragmaSet
pub fn nested(&self, statements: &[Statement]) -> PragmaSet
The set a scope nested in this one compiles under: every pragma
in force here, then the pragmas statements (the nested
scope’s own) declare. Pragmas in scopes nested inside
statements are not collected; each applies when its own scope
compiles.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PragmaSet
impl RefUnwindSafe for PragmaSet
impl Send for PragmaSet
impl Sync for PragmaSet
impl Unpin for PragmaSet
impl UnsafeUnpin for PragmaSet
impl UnwindSafe for PragmaSet
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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