SVG: Cleanup, less ambiguous names for pre-compiled regex

This commit is contained in:
Sergey Sharybin 2019-09-19 12:25:24 +02:00
parent 119f203eef
commit a18093e58d
1 changed files with 3 additions and 3 deletions

View File

@ -36,11 +36,11 @@ match_first_comma = r"^\s*(?=,)"
match_comma_pair = r",\s*(?=,)"
match_last_comma = r",\s*$"
pattern = f"({match_number})|{match_first_comma}|{match_comma_pair}|{match_last_comma}"
re_pattern = re.compile(pattern)
array_of_floats_pattern = f"({match_number})|{match_first_comma}|{match_comma_pair}|{match_last_comma}"
re_array_of_floats_pattern = re.compile(array_of_floats_pattern)
def parse_array_of_floats(text):
elements = re_pattern.findall(text)
elements = re_array_of_floats_pattern.findall(text)
return [value_to_float(v[0]) for v in elements]
def value_to_float(value_encoded: str):