kursjan / petitparser2

A high-performance top-down parser
MIT License
41 stars 17 forks source link

Create alternatives to `thisContext` #28

Closed kursjan closed 5 years ago

kursjan commented 5 years ago

References to thisContext are troublesome for GemStone migration. Provide alternatives.

thisCotnext is referenced from these methods:

kursjan commented 5 years ago

@jgfoster: James, any ideas what are my options here? I have no idea how to deal with this.

jgfoster commented 5 years ago

I'll do some investigation and let you know what I come up with.

jgfoster commented 5 years ago

If PP2RecordingContext>>node called PP2RecordingContext>>strategy then you would reduce duplicate code and we would have only one method to fix.

kursjan commented 5 years ago

For you convenience, I implemented the following method:

PP2RecordingContext#findContextSuchThat: aBlock
    ^ thisContext findContextSuchThat: aBlock
jgfoster commented 5 years ago

Yes, that helps. I can replace that method as a minimal change. Thanks.