public HeronValue EvalString(string s) { Expression x = CodeModelBuilder.CreateExpr(s); x.ResolveAllTypes(globalModule, globalModule); return(Eval(x));; }
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); } }