Skip to content

Commit 1938056

Browse files
committed
fixing / generalizing regular expressions for syntax
1 parent e7e2320 commit 1938056

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fprettify/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898

9999
TYPE_RE = re.compile(
100100
SOL_STR +
101-
r"TYPE(\s*,\s*(BIND\s*\(\s*C\s*\)|EXTENDS\s*\(.*\)))?(\s*::\s*|\s+)\w+" + EOL_STR,
101+
r"TYPE(\s*,\s*(BIND\s*\(\s*C\s*\)|EXTENDS\s*\(.*\)|ABSTRACT))?(\s*,\s*(PUBLIC|PRIVATE))?(\s*::\s*|\s+)\w+" + EOL_STR,
102102
RE_FLAGS)
103103
ENDTYPE_RE = re.compile(SOL_STR + r"END\s*TYPE(\s+\w+)?" + EOL_STR, RE_FLAGS)
104104

@@ -107,7 +107,7 @@
107107
SOL_STR + r"END\s*PROGRAM(\s+\w+)?" + EOL_STR, RE_FLAGS)
108108

109109
INTERFACE_RE = re.compile(
110-
r"^([^\"'!]* )?INTERFACE(\s+\w+)?" + EOL_STR, RE_FLAGS)
110+
r"^([^\"'!]* )?INTERFACE(\s+\w+|\s+(OPERATOR|ASSIGNMENT)\s*\(.*\))?" + EOL_STR, RE_FLAGS)
111111
ENDINTERFACE_RE = re.compile(
112112
SOL_STR + r"END\s*INTERFACE(\s+\w+)?" + EOL_STR, RE_FLAGS)
113113

0 commit comments

Comments
 (0)