Skip to content

Commit

Permalink
Avoid greedy regex
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed Oct 30, 2023
1 parent 31f3e18 commit 493feaf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fprettify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,8 @@ def build_scope_parser(fypp=True, mod=True):
F90_NUMBER_ALL_RE = "(" + F90_NUMBER_RE + "|" + F90_FLOAT_EXP_RE + ")"
F90_NUMBER_ALL_REC = re.compile(F90_NUMBER_ALL_RE, RE_FLAGS)

## F90_CONSTANTS_TYPES_RE = re.compile(r"\b" + F90_NUMBER_ALL_RE + "_(" + "|".join([a + r"\b" for a in (
F90_CONSTANTS_TYPES_RE = re.compile(
r"(" + F90_NUMBER_ALL_RE + ")*_(" + "|".join((
r"(" + F90_NUMBER_ALL_RE + ")_(" + "|".join((
## F2003 iso_fortran_env constants.
## F2003 iso_c_binding constants.
"c_int", "c_short", "c_long", "c_long_long", "c_signed_char",
Expand Down

0 comments on commit 493feaf

Please sign in to comment.