Improve params pattern to catch more macros (#1295)

The current pattern can only take into account params followed by default. The proposal catches more parameters and removes white spaces if present.
This commit is contained in:
Frédéric Beaucamp authored and GitHub committed 2024-03-09 12:31:51 -03:00
1 parent 97b4b544cb
commit 84f7c1acff
1 file changed
+1 -1
+1 -1
View File
@@ -80,7 +80,7 @@ class Panel(ScreenPanel):
"row": row,
"params": {},
}
pattern = r'params\.(?P<param>..*)\|default\((?P<default>..*)\).*'
pattern = r'params\.(?P<param>[A-Z_0-9]+)(?:\s*\|.*\s*default\(\s*(?P<default>[^\)]+)\))?'
i = 0
for line in gcode:
if line.startswith("{") and "params." in line: