示例#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 void TwoPlusTwo()
 {
     _sb.Clear();
     _program.Execute("2 + 2", true);
     Assert.AreEqual("result : Int = 4", _sb.ToString());
 }