From bf2f9e86656a1cf9cf1f0481f50544a6baf21e36 Mon Sep 17 00:00:00 2001 From: Nir Date: Wed, 10 Jun 2026 14:59:45 +1000 Subject: [PATCH 1/2] [76] Fix typed parameters in animation profile parser PDDL typed parameters (e.g. (?r - robot ?l - location)) caused a logic error because the :parameters block was split verbatim, including '-' and type names. Now filters to tokens starting with '?' so only the parameter names are kept; untyped profiles are unaffected. Resolves #76 --- server/app/vfg/parser/Animation_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/app/vfg/parser/Animation_parser.py b/server/app/vfg/parser/Animation_parser.py index 78fc7e9..d4bdaa8 100755 --- a/server/app/vfg/parser/Animation_parser.py +++ b/server/app/vfg/parser/Animation_parser.py @@ -163,7 +163,7 @@ def parse_predicate(text_to_parse, result): # Get the value of parameters temp_regex_pattern = re.compile(pattern_parameters + " " + "\((.*?)\)", re.IGNORECASE) - objectList = temp_regex_pattern.findall(temp_visual_block)[0].split() + objectList = [t for t in temp_regex_pattern.findall(temp_visual_block)[0].split() if t.startswith('?')] customObjectList = parseObjectLine(pattern_custom, temp_visual_block) # Get the value of effect From 9c8813b38354c16cf94bd074bb26e3a5a0fb1928 Mon Sep 17 00:00:00 2001 From: Nir Date: Wed, 10 Jun 2026 16:46:10 +1000 Subject: [PATCH 2/2] [76] Fix property parser ignoring entries with multiple spaces The regex \s matched exactly one space, so properties written with extra whitespace (e.g. "(width 36)") were silently dropped from the visual block. Changed to \s+ to allow one or more spaces, and + instead of * for the value group to require a non-empty value. Resolves #76 --- server/app/vfg/parser/Animation_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/app/vfg/parser/Animation_parser.py b/server/app/vfg/parser/Animation_parser.py index d4bdaa8..de50b64 100755 --- a/server/app/vfg/parser/Animation_parser.py +++ b/server/app/vfg/parser/Animation_parser.py @@ -106,10 +106,10 @@ def parse_visual(text_to_parse, result): # Get the value of properties temp_property_block = temp_visual_block[temp_visual_block.index(pattern_properties) + len(pattern_properties):] temp_property_block = Parser_Functions.get_one_block(temp_property_block) - temp_properties_pattern = re.compile("\([a-zA-Z0-9_.-]*\s[#a-zA-Z0-9_.-]*\)") + temp_properties_pattern = re.compile(r"\([a-zA-Z0-9_.-]*\s+[#a-zA-Z0-9_.-]+\)") temp_properties = temp_properties_pattern.findall(temp_property_block) for x in temp_properties: - x, y = x.replace('(', '').replace(')', '').split() + x, y = x.replace('(', '').replace(')', '').split() sublist[x] = y result["visual"][temp_subshape_value] = sublist return result;