public static string EvaluateWrap(Ast.AstNode source) => Evaluate(source, new Dictionary <string, Ast.Val> { { "true", Ast.Val.Bool(true) }, { "false", Ast.Val.Bool(false) } }.ToImmutableDictionary()).Match( Int: i => i.ToString(), String: s => s, Bool: b => b ? "true" : "false");
public ScopeInfo(Ast.AstNode ownerNode, string name = "") { Util.Check(ownerNode != null, "ScopeInfo owner node must not be null."); OwnerNode = ownerNode; Level = Parent == null ? 0 : Parent.Level + 1; slots = new SlotInfoDictionary(); Name = name; }
public void Create(Ast.AstNode ast, string url) { Visit(ast); Debug.Assert(m_assembly != null); m_assembly.SetEntryPoint(m_mainMethod, PEFileKinds.ConsoleApplication); m_assembly.Save(url); }
public static string Compile(Ast.AstNode source) { return("process.stdout.write(String(" + "\"NO JavaScript COMPILATION FOR NOW\"" /* + source.Match( * Int: i => i.ToString(), * String: s => $"'{s.ToString()}'" * )*/ + "));"); }
public static Ast.Val Evaluate(Ast.AstNode source, ImmutableDictionary <string, Ast.Val> env) // => Log(source.Str(), () => source.Match(