qbsp, maputil: add parser location to "brush primitives" error messages

This commit is contained in:
iknowsomething 2023-11-17 20:57:15 +03:00 committed by Eric Wasylishen
parent 3969f857cb
commit bf50e0d604
2 changed files with 5 additions and 5 deletions

View File

@ -1080,13 +1080,13 @@ void map_entity_t::parse_brush(parser_t &parser)
// optional
if (parser.token == "brushDef") {
if (!parser.parse_token()) {
FError("Brush primitives: unexpected EOF (nothing after brushDef)");
FError("{}: Brush primitives: unexpected EOF (nothing after brushDef)", parser.location);
}
}
// mandatory
if (parser.token != "{") {
FError("Brush primitives: expected second {{ at beginning of brush, got \"{}\"", parser.token);
FError("{}: Brush primitives: expected second {{ at beginning of brush, got \"{}\"", parser.location, parser.token);
}
}
// ericw -- end brush primitives
@ -1110,7 +1110,7 @@ void map_entity_t::parse_brush(parser_t &parser)
if (!parser.parse_token()) {
FError("Brush primitives: unexpected EOF (no closing brace)");
} else if (parser.token != "}") {
FError("Brush primitives: Expected }}, got: {}", parser.token);
FError("{}: Brush primitives: Expected }}, got: {}", parser.location, parser.token);
}
}
// ericw -- end brush primitives

View File

@ -2516,12 +2516,12 @@ static mapbrush_t ParseBrush(parser_t &parser, mapentity_t &entity, texture_def_
// optional
if (parser.token == "brushDef") {
if (!parser.parse_token())
FError("Brush primitives: unexpected EOF (nothing after brushDef)");
FError("{}: Brush primitives: unexpected EOF (nothing after brushDef)", parser.location);
}
// mandatory
if (parser.token != "{")
FError("Brush primitives: expected second {{ at beginning of brush, got \"{}\"", parser.token);
FError("{}: Brush primitives: expected second {{ at beginning of brush, got \"{}\"", parser.location, parser.token);
}
// ericw -- end brush primitives