Skip to main content

Program

Struct Program 

Source
pub struct Program {
    pub declarations: Vec<Decl>,
    pub source: Option<String>,
    pub parse_failed_fns: HashMap<String, ParseFailRef>,
    pub glued_eq_binding_sites: HashSet<String>,
    pub h_keyword_simple_ref_sites: Vec<(Span, String)>,
}
Expand description

A complete program is a list of declarations

Fields§

§declarations: Vec<Decl>§source: Option<String>§parse_failed_fns: HashMap<String, ParseFailRef>

Function names whose declaration was started but failed to parse to completion (header recognised, then header/body/return-type errored). Populated by parser::parse and consumed by verify::verify to skip cascading type errors against these functions: their bodies are suppressed from type-checking, and undefined function diagnostics at call sites collapse to one cross-reference rather than firing per call. Maps name -> (code, line, col) of the originating parse error so cross-reference hints can point back at the root cause.

§glued_eq_binding_sites: HashSet<String>

Callee names whose call site sits as the RHS of a binding whose = was actually the two-character == token glued to the binding-LHS identifier (e.g. wc==q "", which parses as wc = (q "") — see ILO-469). When a later ILO-T005 fires for one of these callees, verify swaps in a targeted hint that recommends the spaced form name = =expr instead of the bare call-vs-binop nudge. Detection is pure adjacency: lexer joins =/== into a single Token::Eq, so we inspect the token span length at parse time. Diagnostic-only — we do not accept == as a fused bind-then-equality form (anti-P2).

§h_keyword_simple_ref_sites: Vec<(Span, String)>

Spans where the parser saw the ?h cond a b general prefix-ternary keyword form with a simple bool-Ref condition — i.e. a shape that the cheaper bare-bool prefix ternary ?cond a b would express identically. Surfaced by verify as an ILO-W003 advisory so an agent reaching for the keyword form when the bool was already a bare ref learns the shorter shape (ILO-463). Empty when the keyword form was used legitimately (comparison-led first operand, nested call, etc.).

Trait Implementations§

Source§

impl Clone for Program

Source§

fn clone(&self) -> Program

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 Debug for Program

Source§

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

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

impl Default for Program

Source§

fn default() -> Program

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

impl<'de> Deserialize<'de> for Program

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Program

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Program

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Program

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> 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> 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> Same for T

Source§

type Output = T

Should always be Self
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, 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,