visitAnonymousExpr method

  1. @override
void visitAnonymousExpr(
  1. Anonymous expr
)
override

Implementation

@override
void visitAnonymousExpr(Expr.Anonymous expr) {
  // declare(expr.name);
  // define(expr.name);
  FunctionType enclosingFunctionType = currentFunctionType;
  currentFunctionType = FunctionType.FUNCTION;
  beginScope();
  for (Token param in expr.params) {
    declare(param);
    define(param);
  }
  resolve(expr.body);
  endScope();
  currentFunctionType = enclosingFunctionType;
}