Skip to main content

RustyfiVersion

Enum RustyfiVersion 

Source
#[non_exhaustive]
pub enum RustyfiVersion { V0_0, V0_1, }
Expand description

Target SATySFi language version.

#[non_exhaustive] because more 0.1.z-era (and later) variants are expected as the upstream module system design settles; treat any match on this type as needing a wildcard arm.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

V0_0

SATySFi 0.0.6 (and, as far as this port is concerned, the rest of the 0.0.x series): @require: / @import: headers, the module-less surface syntax this port’s rustyfi-syntax / rustyfi-loader / rustyfi-lang implement.

§

V0_1

SATySFi 0.1.x: the dev-0-1-0 language generation — an ML-style module system (F-ing Modules-based), row-polymorphic records and optional-argument encodings, and a reworked surface grammar — shared near-identically by saphe-split (confirmed by direct diff). This says nothing about packaging: V0_1 documents may resolve dependencies via either today’s @require:/@import: headers (dev-0-1-0’s own model, and this port’s LoadMode::Legacy) or the use/manifest/lockfile model (saphe-split’s LoadMode::Envelopes, a later milestone) — see rustyfi_loader::LoadMode.

Implementations§

Source§

impl RustyfiVersion

Source

pub const DEFAULT: RustyfiVersion = Self::V0_0

The version this port targets when none is specified.

Source

pub fn has_row_polymorphism(&self) -> bool

Whether this version’s type system has row-polymorphic records and optional-argument rows (?(l = e) bundles, ?'r row variables). false for V0_0 (closed Kind::Record rows only); true for V0_1.

Source

pub fn has_page_adt(&self) -> bool

Whether page-break/page-break-multicolumn/page-break-two-column take the page ADT (A4Paper/UserDefinedPaper) as their paper-size argument, as opposed to V0_1’s plain length * length. Deliberately phrased as an assertion about V0_0’s surface (not “is it 0.0.6”), so a future third generation that also drops the ADT reads correctly without touching call sites.

Source

pub fn math_is_split(&self) -> bool

Whether the math type is split into math-text (unparsed ${...} source) / math-boxes (evaluated tree) with a read-math primitive bridging them, as opposed to V0_0’s single unsplit math type. false for V0_0; true for V0_1.

Source

pub fn graphics_is_collection(&self) -> bool

Whether the graphics type is a collection (0.1’s GraphicD.t = 'a element list, with Clip/Group container elements — a graphics-producing callback returns ONE graphics value) as opposed to V0_0’s single drawing element (a callback returns list graphics). false for V0_0; true for V0_1. Backs the graphics-collection sweep: every fork in the shared place_graphics/coerce_graphics_result machinery keys on this one method, so the env and type-env agree by construction (mirrors math_is_split’s role for the math slice).

Source

pub fn has_per_binding_stage(&self) -> bool

Whether a single BINDING may carry its own stage qualifier — 0.1’s val ~x = e / val persistent ~x = e (dev-0-1-0 parser.mly:416-421, UTBindValue(Stage0 | Persistent0, _)). false for V0_0, which declares one stage per FILE with a @stage: header and has no binding-level spelling at all: 0.0.6’s EXACT_TILDE occurs only as a splice operand prefix (v0.0.6 parser.mly:797) and as macro syntax (:608, :1199).

The two generations share one cst::TopLet/TopBinding (the 0.1 lowering builds them), so the ~ prefix is parseable under both and this is what makes it an ERROR under 0.0.6 rather than a silent accept — see elaborate.rs’s binding_stage.

Source

pub fn has_code_type_syntax(&self) -> bool

Whether the code TYPE has a surface spelling — 0.1’s code τ, a one-argument prefix type application decoded alongside list/ref (dev-0-1-0 src/frontend/manualTypeDecoder.ml:31-36). false for V0_0, whose own manual-type decoder (v0.0.6 src/frontend/typeenv.ml:527-530) special-cases list and ref and nothing else, so CodeType there is inference-only.

Source

pub fn is_implemented(&self) -> bool

Whether this port actually implements this version end-to-end (lexer through PDF rendering). True for both generations.

Source

pub fn supported() -> &'static [RustyfiVersion]

The subset of RustyfiVersion::all this port can actually load.

Trait Implementations§

Source§

impl Clone for RustyfiVersion

Source§

fn clone(&self) -> RustyfiVersion

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RustyfiVersion

Source§

impl Debug for RustyfiVersion

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for RustyfiVersion

Source§

fn default() -> RustyfiVersion

Returns the “default value” for a type. Read more
Source§

impl Display for RustyfiVersion

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for RustyfiVersion

Source§

impl FromStr for RustyfiVersion

Source§

type Err = ParseVersionError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<RustyfiVersion, <RustyfiVersion as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for RustyfiVersion

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for RustyfiVersion

Source§

fn eq(&self, other: &RustyfiVersion) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RustyfiVersion

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> Clone for T
where T: Clone,

Source§

fn clone(&self) -> T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Copy for T
where T: Copy,

Source§

impl<T> Debug for T
where T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl<T> Display for T
where T: Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Hash for T
where T: Hash,

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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>,

Source§

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.