Beispiel #1
0
        public static Script Load(string content)
        {
            var script = new Script();

            var lines = StripComments(content).Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);

            for (int i = 0; i < lines.Length; ++i)
            {
                lines[i] = lines[i].Trim();
                if (lines[i].Length == 0)
                {
                    continue;
                }

                script._commands.Add(ScriptCommand.FromLine(i + 1, lines[i]));
            }

            return(script);
        }