How to parse dot's HTML-like strings? #423
-
Parsing dot-files is generally straight forward. I don't know how to implement HTML-like strings, though. An HTML-like string is separated by an opening and closing angular bracket
For a test from graphviz see here. It seems, like a parser, that would like to recognize, would need to hold state, so as to be able to detect, if a matching number of opening and closing brackets have been found. The repeating combinators, like Is there a way to parse HTML-Like strings? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
We will likely need a delimiter matching parser for #96 but not feeling ready to define that quite yet. You could write this imperatively, something roughly like
|
Beta Was this translation helpful? Give feedback.
-
Thanks @epage! I imagine, the parsing would look like this
However, I don't know what to call the |
Beta Was this translation helpful? Give feedback.
unpeek(p_html_inner).recognize()
unpeek
takes the old nom-like purely functional function signature and turns it into animpl Parser<I, O, E>
.You could also do
and then you could do
p_html_inner.recognize()
since we haveimpl Parser for FnMut...
for that signature.