public static CScript CreateRunner(string[] srcs, ScriptConfig scriptConfig = null, RunConfig config = null) { if (srcs == null || srcs.Length == 0) { throw new ArgumentException(nameof(srcs)); } if (scriptConfig == null) { scriptConfig = ScriptConfig.Default; } if (config == null) { config = RunConfig.Default; } var r = new Runner(scriptConfig, config); var roots = new List <SyntaxNode>(); foreach (var src in srcs) { var root = ParseAndValidate(src, scriptConfig.PredefinedSymbols); r.LoadSyntax(root); roots.Add(root); } return(new CScript(r, roots.ToArray())); }
public static CScript CreateRunner(string[] srcs, ScriptConfig scriptConfig = null, RunConfig config = null) { if (srcs == null || srcs.Length == 0) { throw new ArgumentException(nameof(srcs)); } if (scriptConfig == null) { scriptConfig = ScriptConfig.Default; } if (config == null) { config = RunConfig.Default; } var r = new Runner(scriptConfig, config); foreach (var src in srcs) { var root = ParseAndValidate(src); r.LoadSyntax(root); } return(new CScript(r)); }
public void LoadScript(string src) { var root = ParseAndValidate(src); Runner.LoadSyntax(root); }