WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion fprettify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ def build_scope_parser(fypp=True, mod=True):
# find namelists and data statements
NML_STMT_RE = re.compile(SOL_STR + r"NAMELIST.*/.*/", RE_FLAGS)
DATA_STMT_RE = re.compile(SOL_STR + r"DATA\s+\w", RE_FLAGS)
# find CUDA chevrons
CUDA_CHEVRONS_RE = re.compile(r"<<<.*>>>", RE_FLAGS)

## Regexp for f90 keywords'
F90_KEYWORDS_RE = re.compile(r"\b(" + "|".join((
Expand Down Expand Up @@ -1302,7 +1304,7 @@ def add_whitespace_context(line, spacey):
# exclude comments, strings:
if not STR_OPEN_RE.match(part):
# also exclude / if we see a namelist and data statement
if not ( NML_STMT_RE.match(line) or DATA_STMT_RE.match(line) ):
if not ( NML_STMT_RE.match(line) or DATA_STMT_RE.match(line) or CUDA_CHEVRONS_RE.search(line) ):
partsplit = lr_re.split(part)
line_parts[pos] = (' ' * spacey[n_op + 2]).join(partsplit)

Expand Down