mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 02:19:04 +08:00
Fix single-line statement processing
CURA-12386 The regex was not specific enough and would catch the rest of the line, now we force stopping as soon as we see a { or }
This commit is contained in:
parent
5de614590c
commit
f9b8bc20c2
@ -76,7 +76,7 @@ class GcodeStartEndFormatter:
|
|||||||
# will be used. Alternatively, if the expression is formatted as "{[expression], [extruder_nr]}",
|
# will be used. Alternatively, if the expression is formatted as "{[expression], [extruder_nr]}",
|
||||||
# then the expression will be evaluated with the extruder stack of the specified extruder_nr.
|
# then the expression will be evaluated with the extruder stack of the specified extruder_nr.
|
||||||
|
|
||||||
_instruction_regex = re.compile(r"{(?P<condition>if|else|elif|endif)?\s*(?P<expression>.*?)\s*(?:,\s*(?P<extruder_nr_expr>.*))?\s*}(?P<end_of_line>\n?)")
|
_instruction_regex = re.compile(r"{(?P<condition>if|else|elif|endif)?\s*(?P<expression>[^{}]*?)\s*(?:,\s*(?P<extruder_nr_expr>[^{}]*))?\s*}(?P<end_of_line>\n?)")
|
||||||
|
|
||||||
def __init__(self, all_extruder_settings: Dict[str, Dict[str, Any]], default_extruder_nr: int = -1) -> None:
|
def __init__(self, all_extruder_settings: Dict[str, Dict[str, Any]], default_extruder_nr: int = -1) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user