You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parser combinators works wonderfully, except for a minor tweak I'd like to add: I would like to constrain the type of position data structure in my parser pipeline.
At the moment, parsers.scala will use the base type Position, and leave the specific position type to Readers. The downstream operation will need to perform pattern matching to cast the position data into specific type, e.g. OffsetPosition. This gets tedious if I already know that my parser will only use one specific Position type
I propose to make position a type member in a similar fashion to Elem and Input. Existing code base can be kept in-tact by adding
typePos=Position.
If needed, a user can constrain the position type to be more specific by overriding the type member;
e.g.
overridetypePos=OffsetPosition
I will send out a pull request on the proposed change. Please take a look.
The text was updated successfully, but these errors were encountered:
Hi,
The parser combinators works wonderfully, except for a minor tweak I'd like to add: I would like to constrain the type of position data structure in my parser pipeline.
At the moment, parsers.scala will use the base type Position, and leave the specific position type to Readers. The downstream operation will need to perform pattern matching to cast the position data into specific type, e.g. OffsetPosition. This gets tedious if I already know that my parser will only use one specific Position type
I propose to make position a type member in a similar fashion to Elem and Input. Existing code base can be kept in-tact by adding
If needed, a user can constrain the position type to be more specific by overriding the type member;
e.g.
I will send out a pull request on the proposed change. Please take a look.
The text was updated successfully, but these errors were encountered: