Example #1
0
        public static Variable Execute(string text, string filename = "")
        {
            string[] lines = text.Split(new char[] { '\n' });

            Dictionary <int, int> char2Line;
            string        includeScript = Utils.ConvertToScript(text, out char2Line);
            ParsingScript tempScript    = new ParsingScript(includeScript, 0, char2Line);

            tempScript.Filename       = filename;
            tempScript.OriginalScript = string.Join(Constants.END_LINE.ToString(), lines);

            Variable result = null;

            while (tempScript.Pointer < includeScript.Length)
            {
                result = tempScript.ExecuteTo();
                tempScript.GoToNextStatement();
            }
            return(result);
        }