alex / rply

An attempt to port David Beazley's PLY to RPython, and give it a cooler API.
BSD 3-Clause "New" or "Revised" License
381 stars 60 forks source link

#102 use updated pypy repo url #103

Closed nobodxbodon closed 3 years ago

alex commented 3 years ago

Looks like the pypy API we use has changed. This was already broken before this, so I'll merge.

nobodxbodon commented 3 years ago

In order to fix the pypy related test cases, shall I compare the pypy code at the time of this last rply commit which passed all tests with the latest pypy code to see how to update the APIs?

alex commented 3 years ago

I don't know if that's the easiest way, but I'm sure it works.

On Sun, Sep 20, 2020 at 4:51 PM Xuan Wu notifications@github.com wrote:

In order to fix the pypy related test cases, shall I compare the pypy code at the time of this last rply commit which passed all tests https://github.com/alex/rply/pull/101/commits/a4056697c15e7bf0a79cb51fd9ce406f99c087bf with the latest pypy code to see how to update the APIs?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/alex/rply/pull/103#issuecomment-695834844, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAGBCLLUCCQR6CKZNV72DSGZTNHANCNFSM4RODX5JQ .

-- All that is necessary for evil to succeed is for good people to do nothing.

nobodxbodon commented 3 years ago

Thanks I'll try. Any pointers are more than welcome.

nobodxbodon commented 3 years ago

It seems to be caused by the flags param being removed from StrMatchContext, compared to a February version, which I suppose was close to the last version of pypy before moving off bitbucket. After removing self.flags here, the tests passed locally at least for py2.7.

I wonder if this flags attribute is exposed to user or used internally in some way?

Thanks.

alex commented 3 years ago

It looks like flags is available to users via LexerGenerator.add

On Tue, Sep 22, 2020 at 5:24 PM Xuan Wu notifications@github.com wrote:

It seems to be caused by the flags param being removed from StrMatchContext, compared to a February version https://foss.heptapod.net/pypy/pypy/-/blob/ed702d100cf04d3e2ff2d78dfa12a56a9d2650a4/rpython/rlib/rsre/rsre_core.py#L296, which I suppose was close to the last version of pypy before moving off bitbucket. After removing self.flags here https://github.com/alex/rply/blob/4950fe79dd417af703c18545e37a49364c35de7a/rply/lexergenerator.py#L36, the tests passed locally at least for py2.7.

I wonder if this flags attribute is exposed to user or used internally in some way?

Thanks.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/alex/rply/pull/103#issuecomment-696990427, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAGBCLZZDR7VWTFOGGDQLSHEIZBANCNFSM4RODX5JQ .

-- All that is necessary for evil to succeed is for good people to do nothing.

nobodxbodon commented 3 years ago

Oh like re.DOTALL? As test_lexer still passes, my guess is flags is still effective through the pattern. If so, shall I create a pr with just self.flagsremoved?

alex commented 3 years ago

It looks like our translated tests ( https://github.com/alex/rply/blob/master/tests/test_ztranslation.py) do not cover flags, so those tests passing don't mean it works. We need to add a test to test_ztranslation that relies on flags.

On Tue, Sep 22, 2020 at 5:37 PM Xuan Wu notifications@github.com wrote:

Oh like re.DOTALL? As test_lexer still passes, my guess is flags is still effective through the pattern https://github.com/alex/rply/blob/4950fe79dd417af703c18545e37a49364c35de7a/rply/lexergenerator.py#L25. If so, shall I create a pr with just self.flagsremoved?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/alex/rply/pull/103#issuecomment-696995859, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAGBGCTMOXFIX6L762MITSHEKKPANCNFSM4RODX5JQ .

-- All that is necessary for evil to succeed is for good people to do nothing.

nobodxbodon commented 3 years ago

Makes sense. Will work on it. Thanks.