visitVarStmt method

  1. @override
void visitVarStmt(
  1. Var stmt
)
override

Implementation

@override
void visitVarStmt(Stmt.Var stmt) {
  Object? value;
  if (stmt.initializer != null) {
    value = evaluate(stmt.initializer!);
  }
  environment.define(stmt.name.lexeme, value);
  return;
}