-
Notifications
You must be signed in to change notification settings - Fork 2
Better position tracking #2
Copy link
Copy link
Closed
Description
From https://discuss.ocaml.org/t/ann-parseff-parser-combinator-library-for-ocaml-5/17914/4?u=davesnx
A real pain when writing parser is to handle locations with line number and character position on line. The Parseff interface seems to only provide a position from the beginning of the stream. Do you think it would be possible de provide more convenient positions, with absolute position, but also line number and position on line ?
What about a Parseff.location that returns type location = { offset : int; line : int; col : int }. We already handle offser and can store a mutable field line_index and derive col with position
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels