Esempio n. 1
0
        public static void BuildWorld(string script, out List <Error> errors)
        {
            World.Instance.Clear();
            Instance.ClearState();
            var tree = ScriptReader.MakeParseTree(script, out _);

            Instance.Visit(tree);
            errors = Instance.errors;
        }
Esempio n. 2
0
        public static List <Error> CheckErrors(string script, Scope scope = null)
        {
            Instance.scope  = scope ?? new Scope();
            Instance.errors = new List <Error>();
            var tree = ScriptReader.MakeParseTree(script, out var syntaxErrors);

            if (syntaxErrors.Count > 0)
            {
                return(syntaxErrors);
            }

            Instance.Visit(tree);

            return(Instance.errors);
        }