From 18ededfff2c20a16455ac688702e3b4ebc3e18b2 Mon Sep 17 00:00:00 2001 From: Blixibon Date: Fri, 20 Feb 2026 16:19:10 -0600 Subject: [PATCH] Fix parser failing with irregular description syntax Fixes parsing of I/O with no descriptions and descriptions with trailing + --- valvefgd/parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/valvefgd/parser.py b/valvefgd/parser.py index bb11ed7..95b1aa1 100644 --- a/valvefgd/parser.py +++ b/valvefgd/parser.py @@ -28,7 +28,7 @@ def protectUnescapedCharacters(quoted_string): pp_value = Word(nums+'-. ') # maybe space delimited vertex pp_quoted = Combine(QuotedString('"') + Optional(OneOrMore( - Suppress('+') + QuotedString('"'))), adjacent=False) + Suppress('+') + Optional(QuotedString('"')))), adjacent=False) pp_quoted.setParseAction(protectUnescapedCharacters) pp_comment = Literal('//') + SkipTo(lineEnd) @@ -84,11 +84,11 @@ def protectUnescapedCharacters(quoted_string): pp_EntityInput = Literal('input') + pp_property_name + \ - '(' + pp_property_value_type + ')' + ':' + pp_description + '(' + pp_property_value_type + ')' + Optional(':' + pp_description) pp_EntityInput.setParseAction(lambda toks: FgdEntityInput(**toks)) pp_EntityOutput = Literal('output') + pp_property_name + \ - '(' + pp_property_value_type + ')' + ':' + pp_description + '(' + pp_property_value_type + ')' + Optional(':' + pp_description) pp_EntityOutput.setParseAction(lambda toks: FgdEntityOutput(**toks)) pp_properties = Suppress(pp_comment) | \