From bb44324960f277b25cef7e8c38a59692b598c034 Mon Sep 17 00:00:00 2001 From: Andrew Best Date: Fri, 24 Jan 2020 13:33:42 -0800 Subject: [PATCH] Added rank --- fprettify/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fprettify/__init__.py b/fprettify/__init__.py index ae54cbd..79afa1f 100644 --- a/fprettify/__init__.py +++ b/fprettify/__init__.py @@ -41,6 +41,7 @@ - if, else, endif - do, enddo - select case, case, end select + - select rank, rank, end select - subroutine, end subroutine - function, end function - module, end module @@ -121,9 +122,9 @@ ENDDO_RE = re.compile(SOL_STR + r"END\s*DO(\s+\w+)?" + EOL_STR, RE_FLAGS) SELCASE_RE = re.compile( - SOL_STR + r"SELECT\s*(CASE|TYPE)\s*\(.*\)" + EOL_STR, RE_FLAGS) + SOL_STR + r"SELECT\s*(CASE|RANK|TYPE)\s*\(.*\)" + EOL_STR, RE_FLAGS) CASE_RE = re.compile( - SOL_STR + r"((CASE|TYPE\s+IS|CLASS\s+IS)\s*(\(.*\)|DEFAULT)|CLASS\s+DEFAULT)" + EOL_STR, RE_FLAGS) + SOL_STR + r"((CASE|RANK|TYPE\s+IS|CLASS\s+IS)\s*(\(.*\)|DEFAULT)|CLASS\s+DEFAULT)" + EOL_STR, RE_FLAGS) ENDSEL_RE = re.compile(SOL_STR + r"END\s*SELECT" + EOL_STR, RE_FLAGS) ASSOCIATE_RE = re.compile(SOL_STR + r"ASSOCIATE\s*\(.*\)" + EOL_STR, RE_FLAGS) @@ -785,6 +786,8 @@ def add_whitespace_charwise(line, spacey, filename, line_nr): line[:pos], RE_FLAGS) or re.search(SOL_STR + r"(SELECT)?\s*CASE\s*$", line[:pos], RE_FLAGS) or + re.search(SOL_STR + r"(SELECT)?\s*RANK\s*$", + line[:pos], RE_FLAGS) or re.search(SOL_STR + r"SELECT\s*TYPE\s*$", line[:pos], RE_FLAGS) or re.search(SOL_STR + r"CLASS\s*DEFAULT\s*$",