setVariable method

bool setVariable(
  1. String name,
  2. ASTValue value,
  3. bool allowField
)

Sets an already declared variable of name with value in this context.

  • allowClassFields if true allows class fields.

Implementation

bool setVariable(String name, ASTValue value, bool allowField) {
  var variable = _variables[name];
  if (variable != null) {
    variable.setValue(this, value);
    return true;
  }

  var field = block.getField(name);

  if (field != null) {
    field.setValue(this, value);
    return true;
  }

  return false;
}