-
Notifications
You must be signed in to change notification settings - Fork 23
Loco Question, MatchParser #4
Comments
also, i bump into parsing completed prematurely exceptions on stray greater-than signs "<" and i have no clue on how to allow them (much like a browser does just displays them). once they're matched in 'content', they can't be part of the closing tag anymore. |
My preferred solution to this problem is just this:
(Obviously you'd need to implement a However, I do see that this is undesirable, because I'm having to throw a |
I don't see what use a |
@ferno that's almost exactly what i did, but inside the parser. Have you seen the Gist? For instance the simpleComment example will fail on a h4 or h6 tag. A match-parser can fetch valid (xml) tags syntax and your callback can discard or ignore them or whatever. |
Yes, I did see the Gist. The point I was making with my example was that On 1 October 2012 06:42, GDmac notifications@github.com wrote:
|
I am playing with a Matchparser but as somewhat newbie to parsing and lexing, i am wondering if there is place for such a parser in the library, or that it might be totally beyond the scope of loco.
The idea is that instead of using a ConcParser for every possible known xml or html tag <p <h etc. just fetch matching pairs.
I made a copy of the ConcParser where two internals have to match. During construct it is checked that both internals are identical, and during parsing the two args[] should be identical, otherwise throw an exception.
I haven't found out an easy way how to check that both the matching internals should not be nullable.
The MatchParser can be found in this gist, as i didn't want to do a pull request, before knowing if this type of parser might be out of order.
https://gist.github.com/3783791
The text was updated successfully, but these errors were encountered: