From ef8ac19ce83d5c7f7e620f7525b6844ef8d4323a Mon Sep 17 00:00:00 2001 From: Terry Yin Date: Thu, 31 Oct 2024 15:12:50 +0800 Subject: [PATCH] replace re.NOFLAG with 0 --- CHANGELOG.md | 5 +++++ lizard_ext/version.py | 2 +- lizard_languages/code_reader.py | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be4ef141..bbfc1e8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 1.17.12 + +Bug fix: + Fortran support for ELSEIF + ## 1.17.9 Bug fix: diff --git a/lizard_ext/version.py b/lizard_ext/version.py index b0e2b74c..65b4f893 100644 --- a/lizard_ext/version.py +++ b/lizard_ext/version.py @@ -3,4 +3,4 @@ # # pylint: disable=missing-docstring,invalid-name -version = "1.17.9" +version = "1.17.12" diff --git a/lizard_languages/code_reader.py b/lizard_languages/code_reader.py index e8d7d988..d3ff96bf 100644 --- a/lizard_languages/code_reader.py +++ b/lizard_languages/code_reader.py @@ -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 = ["<<=", ">>=", "||", "&&", "===", "!==", @@ -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)