void error(string msg, int line = -1, int col = -1, Token tok = null) { if (tok == null) { tok = reader.Peek(); } if (line == -1) { line = tok.Line; } if (col == -1) { col = tok.Column; } msg += ", got '" + tok.Data + "'"; LuaSourceException ex = new LuaSourceException(line, col, msg); Errors.Add(ex); //Console.WriteLine(ex.GenerateMessage("sd")); if (ThrowParsingErrors) { throw ex; } }
void error(string msg) { LuaSourceException ex = new LuaSourceException(tok.Peek().Line, tok.Peek().Column, msg + ", got '" + tok.Peek().Data + "'"); Errors.Add(ex); if (ThrowParsingErrors) { throw ex; } }
void error(string msg, int line = -1, int col = -1, Token tok = null) { if (tok == null) tok = reader.Peek(); if (line == -1) line = tok.Line; if (col == -1) col = tok.Column; msg += ", got '" + tok.Data + "'"; LuaSourceException ex = new LuaSourceException(line, col, msg); Errors.Add(ex); //Console.WriteLine(ex.GenerateMessage("sd")); if (ThrowParsingErrors) throw ex; }