Skip to content

Commit

Permalink
replace re.NOFLAG with 0
Browse files Browse the repository at this point in the history
  • Loading branch information
terryyin committed Oct 31, 2024
1 parent 1f9a51b commit ef8ac19
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 1.17.12

Bug fix:
Fortran support for ELSEIF

## 1.17.9

Bug fix:
Expand Down
2 changes: 1 addition & 1 deletion lizard_ext/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#
# pylint: disable=missing-docstring,invalid-name

version = "1.17.9"
version = "1.17.12"
4 changes: 2 additions & 2 deletions lizard_languages/code_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def create_token(match):
if not token_class:
token_class = create_token

def _generate_tokens(source, add, flags=re.NOFLAG):
def _generate_tokens(source, add, flags=0):
# DO NOT put any sub groups in the regex. Good for performance
_until_end = r"(?:\\\n|[^\n])*"
combined_symbols = ["<<=", ">>=", "||", "&&", "===", "!==",
Expand Down Expand Up @@ -170,7 +170,7 @@ def _generate_tokens(source, add, flags=re.NOFLAG):

pattern = re.compile(r'\(\?[aiLmsux]+\)')
re_flags = ''.join(opt[2:-1] for opt in pattern.findall(addition))
flags = reduce(or_, (flag_dict[flag] for flag in re_flags), re.NOFLAG)
flags = reduce(or_, (flag_dict[flag] for flag in re_flags), 0)

return _generate_tokens(source_code, pattern.sub('', addition), flags=flags)

Expand Down

0 comments on commit ef8ac19

Please sign in to comment.