示例#1
0
文件: Program.cs 项目: minib00m/JNP2
        private static void Main()
        {
            var instance = new MobLang.Program();

            instance.Writer += Console.WriteLine;
            instance.AddStd();
            instance.AddImpure();

            while (true)
            {
                Console.Write(@"> ");

                var    builder = new StringBuilder();
                string line;

                do
                {
                    line = Console.ReadLine();
                    builder.Append(line);
                } while (line != "");

                var input = builder.ToString();
                instance.Execute(input, true);
            }
        }
示例#2
0
 public SimpleStatements()
 {
     _sb      = new StringBuilder();
     _program = new MobLang.Program();
     _program.AddStd();
     _program.AddImpure();
     _program.Writer += str => _sb.Append(str);
 }
示例#3
0
 public OutputlessTests()
 {
     _program = new MobLang.Program();
     _program.AddStd();
     _program.AddImpure();
     _program.UnsafeExecute("def undefined : undefined as undefined");
     _program.UnsafeExecute("def assert x as if not x then undefined");
     _program.UnsafeExecute("def assert_eq x y as assert (x == y)");
 }
示例#4
0
 public ExceptionsTest()
 {
     _program = new MobLang.Program();
     _program.AddStd();
     _program.AddImpure();
 }