Exemple #1
0
 public LoxFunctionCallable(FunctionStmt stmt, LoxEnvironment closure, bool isInitializer = false)
 {
     _functionStmt  = stmt;
     _closure       = closure;
     _isInitializer = isInitializer;
 }
Exemple #2
0
        public void Visit(FunctionStmt stmt)
        {
            var callable = new LoxFunctionCallable(stmt, _currentEnvironment);

            _currentEnvironment.Define(stmt.Name.Lexeme, callable);
        }