예제 #1
0
        Stmt Stmt.Visitor <Stmt> .VisitFunctionStmt(Stmt.Function stmt)
        {
            JukaFunction functionCallable = new JukaFunction(stmt, null, false);

            environment.Define(stmt.name.ToString(), functionCallable);
            return(null);
        }
예제 #2
0
        internal JukaInterpreter(ServiceProvider services)
        {
            environment          = globals = new JukaEnvironment();
            this.serviceProvider = services;

            if (serviceProvider != null)
            {
#pragma warning disable CS8604 // Possible null reference argument.
                globals.Define("clock", serviceProvider.GetService <ISystemClock>());
                globals.Define("fileOpen", services.GetService <IFileOpen>());
#pragma warning restore CS8604 // Possible null reference argument.
            }
            else
            {
                throw new JRuntimeException("Unable to load system calls");
            }
        }