Item2231: context-free vs classic registerTagHandler docco needs more info
Priority: Enhancement
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component:
Branches:
Foswiki::registerTaghandler
tells me nothing, and
Foswiki::Func::registerTagHandler
doesn't tell the plugin author
why they would want to choose one over the other - just what it does.
I assume from the tone, that
context-free
is somehow better - is it, and if so, how is it better? is it faster, cleaner, sexier, or .... just different?
from the lack, and the fact only IF seems to use it, is it a justifiable extra code path (ok, so i may well think it is, but imo, it does deserve a little elaboration)
--
SvenDowideit - 10 Oct 2009
No, it's not justifiable.
Way back in prehistory, back when the dinosaur still roamed the earth, I tried to extend the tag syntax of macros such that they could be processed by a context-free parser (hence the "context-free") and bring them into line with HTML. This work was banjaxed by one particular tyrranosaur, who felt that the existing syntax was perfect. However by that time I had used it in a couple of places - most notable in the action tracker.
The syntax isn't vastly different from what's there; the differences are:
- Use either type of quote for parameters
- Optional quotes on parameter values e.g.
recurse=on
- Standardised use of \ for escapes
- Boolean (valueless) options (i.e.
recurse
instead of recurse="on"
When I imported the macro parser in the Attrs class into the core, I kept the context-free syntax in the code, despite the fact that it had been blocked.
My inclination is to remove the doc from
Foswiki::Func
, perhaps with the above explanation in a comment on
Foswiki::registerTaghandler
.
--
CrawfordCurrie - 10 Oct 2009