Example #1
0
        static void RunPrompt()
        {
            var interpreter = new LoxInterpreter();

            while (true)
            {
                Console.Write("> ");
                interpreter.Run(Console.ReadLine());
            }
        }
Example #2
0
        static void RunFile(string path)
        {
            var source      = File.ReadAllText(path);
            var interpreter = new LoxInterpreter();
            var hadErrors   = interpreter.Run(source);

            if (hadErrors)
            {
                System.Environment.Exit(62);
            }
        }