From bf50e0d604905a06f825ba2e3ca827ba2484a36d Mon Sep 17 00:00:00 2001 From: iknowsomething <5054918+iknowsomething@users.noreply.github.com> Date: Fri, 17 Nov 2023 20:57:15 +0300 Subject: [PATCH] qbsp, maputil: add parser location to "brush primitives" error messages --- common/mapfile.cc | 6 +++--- qbsp/map.cc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/mapfile.cc b/common/mapfile.cc index 5add17df..5d1a567a 100644 --- a/common/mapfile.cc +++ b/common/mapfile.cc @@ -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 diff --git a/qbsp/map.cc b/qbsp/map.cc index 126750b8..2e85301d 100644 --- a/qbsp/map.cc +++ b/qbsp/map.cc @@ -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