Document new host fields for record building
@@ -93,7 +93,21 @@ pub struct AnalysisHost {
env: Environment,
scope: Vec<ScopeId>,
meta: Option<MetaValue>,
+ /// Indexing a record will store a reference to the record as
+ /// well as its fields.
+ /// [Self::Scope] will produce a host with a single **`pop`ed**
+ /// Ident. As fields are typechecked in the same order, each
+ /// in their own scope immediately after the record, which
+ /// gives the corresponding record field _term_ to the ident
+ /// useable to construct a vale declaration.
record_fields: Option<(usize, Vec<Ident>)>,
+ /// Accesses to nested records are recorded recursively.
+ /// ```
+ /// outer.middle.inner -> inner(middle(outer))
+ /// ```
+ /// To resolve those inner fields, accessors (`inner`, `mddle`)
+ /// are recorded first until a variable (`outer`). is found.
+ /// Then, access to all nested records are resolved at once.
access: Option<Vec<Ident>>,
}
