antchfx / xmlquery

xmlquery is Golang XPath package for XML query.
https://github.com/antchfx/xpath
MIT License
444 stars 89 forks source link

Stream Parser Support - pt3 - create `parser` context object and turn `parse()` function into `parser.parse()` #35

Closed jf-tech closed 4 years ago

jf-tech commented 4 years ago

Stream Parser Support - pt3 - create parser context object and turn parse() function into parser.parse()

Eventually streaming parser needs to remember state in between client calls, thus we have to save those into a parser context object. This PR simply creates the parser context object and turns parse() the standalone function into a method on parser object. Move all the state variables into parser object. Other than that, the functionalities and code paths remain unchanged.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.6%) to 87.288% when pulling db13d6a33d668109b898ad8a7f123dc472b8e24e on jf-tech:jf-tech/parse4 into 5f8a3899072ea37064a8ff158fcb70093b9a1d3a on antchfx:master.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.6%) to 87.288% when pulling db13d6a33d668109b898ad8a7f123dc472b8e24e on jf-tech:jf-tech/parse4 into 5f8a3899072ea37064a8ff158fcb70093b9a1d3a on antchfx:master.