store method

String store(
  1. CodeBlock block,
  2. String name
)

Implementation

String store(CodeBlock block, String name) {
  if (stored.containsKey(name)) {
    throw StateError('Variable has already been stored: $name');
  }

  if (variables.containsKey(name)) {
    return variables[name]!;
  }

  final variable = allocator!.allocate();
  stored[name] = variable;
  variables[name] = variable;
  block.assignFinal(variable, ref(name));
  return variable;
}