예제 #1
0
파일: Program.cs 프로젝트: MostafaEissa/Lox
        static void RunPrompt()
        {
            var interpreter = new LoxInterpreter();

            while (true)
            {
                Console.Write("> ");
                interpreter.Run(Console.ReadLine());
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: MostafaEissa/Lox
        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);
            }
        }