Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

groovy.py parsing depends on sre internals and does not work for Python 3.6 #28

Open
myukselen opened this issue Apr 14, 2018 · 0 comments

Comments

@myukselen
Copy link

myukselen commented Apr 14, 2018

Used functionality is not exposed by sre_parse. As a work around version based implementation might be done in Scanner._get_group_pattern() function such as

        for phrase, action in self.lexicon:
            if sys.version_info >= (3, 6):  # internal representation changed in 3.6, add_flags del_flags are given 0
                patterns.append(sre_parse.SubPattern(sub_pattern, [
                    (SUBPATTERN, (len(patterns) + 1, 0, 0, sre_parse.parse(phrase, flags))), ]))
            else:
                patterns.append(sre_parse.SubPattern(sub_pattern, [
                    (SUBPATTERN, (len(patterns) + 1
                                  , sre_parse.parse(phrase, flags))),
                ]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant