Ok,
what do we mean by parser rules?
here I think we mean a collection of competing consumers of a text, these
rules are applied together in a single pass, to a (spatial) sequence of
characters (ie the text). At any point in the parsing of the text, the rule
that matches in the spatial sequence before the others gets to consume a
portion of text (ie it wins). In addition, it is possible that we have a
collision, where two or more rules match the same (winning) point in the
text, and in this case, the last rule that was applied will win (get to
consume some text), ie we also have a temporal ordering to consider.
There is also the result of the parsering to consider, ie the semantics.
With vnd.tiddlywiki, its rules taken together produce the required rich
text (ie they do what the user expects). But will sub collections of its
rules always make sense?
I don't think they will.
If we consider how TW implements italics we see that the '//' string
logically splits the text into a sequence of subtexts and that odd items in
this sequence are transformed into italics.
We also have the "extlink" rule that captures "http://". This rule wins
over the italics rule when "http:" precedes "//". If we remove this rule
then extra '//' are captured by the italics rule changing which (sub)
sequences of text become italic. If the user expects that the removal of
the "extlink" rule to just leave links as plain text, then the result is
not what the user expects.
To overcome this problem I was suggesting that rules be nullified by
introducing extra rules that are applied after the vnd.tiddlywiki rules. eg
we can introduce the "extlinkdummy" rule that also captures "http://"
causing a collision with "extlink", and as "extlinkdummy" is applied after
"extlink" it wins and consumes the "http://" so these instances of "//"
will not be captured by the italics rule. If the semantics of
"extlinkdummy" are to pass the caputured text verbatim to the output
stream, then the overall result is probably what the user expects.
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.