fn resolve_path(&mut self, var: &mut Variable) {
    let mut i = 1;
    // At each iteration, we check if the field `var[i]` is a field of the module given by the type of `var[i-1]`.
    while i < var.len() {
      let info = self.context.var_by_uid(var.path.uids[i-1]);
      // If the current variable is not a bonsai module, we stop the resolution.
      // This marks the limit between Bonsai and its host language.
      // See also context.rs (`Context.vars`).
      if info.kind != Kind::Product {
        assert_eq!(info.kind, Kind::Host, "{}", info.name);
        var.path.uids[i] = var.path.uids[i-1];
      }
      else {
        let module = self.find_mod(&info);
        let field_name = var.path.fragments[i].clone();
        match module.find_field_by_name(&field_name) {
          Some(field) => {
            var.path.uids[i] = field.binding.uid;
          }
          None => {
            self.err_unknown_field(module, field_name);
            break;
          }
        }
      }
      i += 1;
    }
  }
// Precondition: The UID of the first variable in the path is already computed (in `undeclared.rs`).
The UID of the first variable in the path is already computed (in `undeclared.rs`).
The UID of the first variable in the path is already computed ( in ` undeclared . rs ` ) .
fn resolve_path(&mut self, var: &mut Variable) {
    let mut i = 1;
    // At each iteration, we check if the field `var[i]` is a field of the module given by the type of `var[i-1]`.
    while i < var.len() {
      let info = self.context.var_by_uid(var.path.uids[i-1]);
      // If the current variable is not a bonsai module, we stop the resolution.
      // This marks the limit between Bonsai and its host language.
      // See also context.rs (`Context.vars`).
      if info.kind != Kind::Product {
        assert_eq!(info.kind, Kind::Host, "{}", info.name);
        var.path.uids[i] = var.path.uids[i-1];
      }
      else {
        let module = self.find_mod(&info);
        let field_name = var.path.fragments[i].clone();
        match module.find_field_by_name(&field_name) {
          Some(field) => {
            var.path.uids[i] = field.binding.uid;
          }
          None => {
            self.err_unknown_field(module, field_name);
            break;
          }
        }
      }
      i += 1;
    }
  }
fn resolve_path ( & mut self , var : & mut Variable ) { let mut i = 1 ; // At each iteration, we check if the field `var[i]` is a field of the module given by the type of `var[i-1]`. while i < var . len ( ) { let info = self . context . var_by_uid ( var . path . uids [ i - 1 ] ) ; // If the current variable is not a bonsai module, we stop the resolution. // This marks the limit between Bonsai and its host language. // See also context.rs (`Context.vars`). if info . kind != Kind :: Product { assert_eq ! ( info kind Kind Host " " info name ) ; var . path . uids [ i ] = var . path . uids [ i - 1 ] ; } else { let module = self . find_mod ( & info ) ; let field_name = var . path . fragments [ i ] . clone ( ) ; match module . find_field_by_name ( & field_name ) { Some ( field ) => { var . path . uids [ i ] = field . binding . uid ; } None => { self . err_unknown_field ( module , field_name ) ; break ; } } } i += 1 ; } }
Precondition: The UID of the first variable in the path is already computed (in `undeclared.rs`).
Precondition : The UID of the first variable in the path is already computed ( in ` undeclared . rs ` ) .
&mut self
var
&mut Variable
&mut self
var
&mut Variable