Skip to content

Conversation

@sriram-LANL
Copy link


USE_RE = re.compile(
SOL_STR + "USE(\s+|(,.+?)?::\s*)\w+?((,.+?=>.+?)+|,\s*only\s*:.+?)?$" + EOL_STR, RE_FLAGS)
SOL_STR + r"USE(\s+|(,.+?)?::\s*)\w+?((,.+?=>.+?)+|,\s*only\s*:.+?)?$" + EOL_STR, RE_FLAGS)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this do?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It prevents a warning about \s being an unrecognized escape sequence by interpreting the string as a raw string.

@dbroemmel
Copy link
Contributor

I've added a simple test in #152, at least for SELECT CASE. But I assume this PR does the trick just as well.

KineticTheory added a commit to KineticTheory/spack-packages that referenced this pull request Nov 20, 2025
See fortran-lang/fprettify#176 for full details. Fixes SyntaxWarning: invalid escape sequence '\s' warning at line 272 of __init__.py by converting to raw string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants