コード例 #1
0
        // Parses code
        public static Chunk Parse(string UserCode)
        {
            bool Success;
            Parser Parser = new Parser();

            Chunk Chunk = Parser.ParseChunk(new TextInput(UserCode), out Success);

            if (Success)
                return Chunk;
            else
                throw new ArgumentException("Interpreter: Code has syntax errors:\r\n" + Parser.GetErrorMessages());
        }
コード例 #2
0
        public static Chunk Parse(string luaCode)
        {
            bool  success;
            Chunk chunk = parser.ParseChunk(new TextInput(luaCode), out success);

            if (success)
            {
                return(chunk);
            }
            else
            {
                throw new ArgumentException("Code has syntax errors:\r\n" + parser.GetErrorMessages());
            }
        }
コード例 #3
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);
            }
        }