/// Brews a place to a bir place, returning a vector of the
/// syntactical expressions that were evaluated along the way.
/// No cusp expressions are emitted, as places are evaluated
/// instantaneously and do not represent a moment in time.
///
/// Example: if you have `a.b.c`, we will evaluate this to the
/// place `a.b.c` and return a vector with `[a, a.b, a.b.c]`.
///
/// This vector is used to add cusp operations (they all show the value
/// of `a.b.c` in its entirety, though).
///
Brews a place to a bir place, returning a vector of the
syntactical expressions that were evaluated along the way.
No cusp expressions are emitted, as places are evaluated
instantaneously and do not represent a moment in time.



This vector is used to add cusp operations (they all show the value
of `a.b.c` in its entirety, though).
Brews a place to a bir place returning a vector of the syntactical expressions that were evaluated along the way . No cusp expressions are emitted as places are evaluated instantaneously and do not represent a moment in time . This vector is used to add cusp operations ( they all show the value of ` a . b . c ` in its entirety though ) .
pub(crate) fn brew_place(
        &mut self,
        brewery: &mut Brewery<'_>,
        place: validated::Place,
    ) -> (bir::Place, Vec<ExprOrigin>) {
        let origin = brewery.origin(place);
        match place.data(brewery.validated_tables()) {
            validated::PlaceData::LocalVariable(validated_var) => {
                let bir_var = brewery.variable(*validated_var);
                let place = brewery.add(bir::PlaceData::LocalVariable(bir_var), origin);
                (place, vec![origin])
            }
            validated::PlaceData::Function(function) => {
                let place = brewery.add(bir::PlaceData::Function(*function), origin);
                (place, vec![origin])
            }
            validated::PlaceData::Intrinsic(intrinsic) => {
                let place = brewery.add(bir::PlaceData::Intrinsic(*intrinsic), origin);
                (place, vec![origin])
            }
            validated::PlaceData::Class(class) => {
                let place = brewery.add(bir::PlaceData::Class(*class), origin);
                (place, vec![origin])
            }
            validated::PlaceData::Dot(base, field) => {
                let (base, mut origins) = self.brew_place(brewery, *base);
                let place = brewery.add(bir::PlaceData::Dot(base, *field), origin);
                origins.push(origin);
                (place, origins)
            }
        }
    }
pub ( crate ) fn brew_place ( & mut self , brewery : & mut Brewery < ' _ > , place : validated :: Place , ) -> ( bir :: Place , Vec < ExprOrigin > ) { let origin = brewery . origin ( place ) ; match place . data ( brewery . validated_tables ( ) ) { validated :: PlaceData :: LocalVariable ( validated_var ) => { let bir_var = brewery . variable ( * validated_var ) ; let place = brewery . add ( bir :: PlaceData :: LocalVariable ( bir_var ) , origin ) ; ( place , vec ! [ origin ] ) } validated :: PlaceData :: Function ( function ) => { let place = brewery . add ( bir :: PlaceData :: Function ( * function ) , origin ) ; ( place , vec ! [ origin ] ) } validated :: PlaceData :: Intrinsic ( intrinsic ) => { let place = brewery . add ( bir :: PlaceData :: Intrinsic ( * intrinsic ) , origin ) ; ( place , vec ! [ origin ] ) } validated :: PlaceData :: Class ( class ) => { let place = brewery . add ( bir :: PlaceData :: Class ( * class ) , origin ) ; ( place , vec ! [ origin ] ) } validated :: PlaceData :: Dot ( base , field ) => { let ( base , mut origins ) = self . brew_place ( brewery , * base ) ; let place = brewery . add ( bir :: PlaceData :: Dot ( base , * field ) , origin ) ; origins . push ( origin ) ; ( place , origins ) } } }
Brews a place to a bir place, returning a vector of the
syntactical expressions that were evaluated along the way.
Brews a place to a bir place returning a vector of the syntactical expressions that were evaluated along the way .
&mut self
brewery
&mut Brewery<'_>
place
validated::Place