-
|
Hi, thanks for this! Is it possible to capture the row and column of where a match starts? I'm using For example, I'm parsing some graphs whose nodes contain meta data and documenting where that meta data is used, so I want to display something like:
I've got the parser working to grab the bits I want, but I can't where those bits are:
Thanks :-) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
I guess you can perhaps use Span? It gives a textual position of each match's start and end (not sure if that's what you meant -- otherwise, a custom code may be needed to compute the "where" part): |
Beta Was this translation helpful? Give feedback.
I guess you can perhaps use Span? It gives a textual position of each match's start and end (not sure if that's what you meant -- otherwise, a custom code may be needed to compute the "where" part):
https://docs.rs/pest/latest/pest/iterators/struct.Pair.html#method.as_span
https://docs.rs/pest/latest/pest/struct.Span.html