コード例 #1
0
ファイル: HeronVM.cs プロジェクト: catb0t/heron-language
        public HeronValue EvalString(string s)
        {
            Expression x = CodeModelBuilder.CreateExpr(s);

            x.ResolveAllTypes(globalModule, globalModule);
            return(Eval(x));;
        }
コード例 #2
0
 static public void TestCreateExprParse(string s)
 {
     Console.WriteLine("testing expression: " + s);
     try
     {
         Expression x = CodeModelBuilder.CreateExpr(s);
         if (x != null)
         {
             Console.WriteLine("test passed");
             Console.WriteLine("result string = " + x.ToString() + ", type " + x.GetType().ToString());
         }
         else
         {
             Console.WriteLine("test failed without exception");
         }
     }
     catch (Exception e)
     {
         Console.WriteLine("test failed with exception " + e.Message);
     }
 }