Пример #1
0
        public static Chunk Parse(string luaCode)
        {
            bool  success;
            Chunk chunk = parser.ParseChunk(new TextInput(luaCode), out success);

            if (success)
            {
                return(chunk);
            }
            else
            {
                //[PixelCrushers] Clear error stack:
                var errorMessages = parser.GetErrorMessages();
                parser.ClearErrors();
                throw new ArgumentException("Code has syntax errors:\r\n" + errorMessages);
            }
        }