You are here: Foswiki>Tasks Web>Item2231 (29 Jun 2010, SvenDowideit)Edit Attach

Item2231: context-free vs classic registerTagHandler docco needs more info

pencil
Priority: Enhancement
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component:
Branches:
Reported By: SvenDowideit
Waiting For:
Last Change By: SvenDowideit
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:
  1. Use either type of quote for parameters
  2. Optional quotes on parameter values e.g. recurse=on
  3. Standardised use of \ for escapes
  4. 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

ItemTemplate edit

Summary context-free vs classic registerTagHandler docco needs more info
ReportedBy SvenDowideit
Codebase trunk
SVN Range SVN 5250: Foswiki-1.1.0-dev, Mon, 28 Sep 2009, build 5161
AppliesTo Engine
Component
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins distro:ee07de6274ec distro:a820f29b54a4
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r5 - 29 Jun 2010, SvenDowideit
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy