archive_me1Add my vote for this tag extract_stuff1Add my vote for this tag create new tag
, view all tags
A lot of parsing is still done in many places in the code; two specifics are obvious to any code browser:

  1. Parsing Set statements
  2. Parsing pre and verbatim tags when processing entire topics

It would be good to centralise this parsing. I've made a start by dealing with Set statements, by adding a couple of TWiki::regexes for them

  • $TWiki::regex{setRegex} does /^(\t|   )+\*\s+Set\s*/
  • $TWiki::regex{setVarRegex} does /$regex{setRegex}(\w+)\s*=\s*/

I don't propose to do any more than that for Dakar.

-- CrawfordCurrie - 25 Mar 2005

Good idea. It wasn't obvious that the setRegex was insisting on a multiple of 3 spaces (which I think is correct), so I modified it to be in fixed font to make it more obvious. I think there are some inconsistencies in these expressions with current (Cairo) implementation. The setRegex allows multiple spaces between the * and Set; the current regex requires one and only one. Also, the setRegex ends with \s* and is followed in setVarRegex with (\w+), which means that something like SetJUNK = foo would set the variable JUNK to foo. Again, the current implementation requires one and only one space between Set and the variable name. I am OK with allowing more than one space between the * and Set and between Set and =, but I think we should require at least one space between those elements.

-- DavidBright - 25 Mar 2005

The "more than one space" lets you line up the '=' signs in the raw, whcih can help composing, But then the HTML rendering foes and converts all those spaces to one space.

Yes, there should be white-space between the Set and name of the variable and the Set and the =.

-- AntonAylward - 25 Mar 2005

The exprs are now:

    $regex{bulletRegex} = qr/^(?:\t|   )+\*/;
    $regex{setRegex} = qr/$regex{bulletRegex}\s+Set\s+/o;
    $regex{setVarRegex} = qr/$regex{setRegex}(\w+)\s*=\s*(.*)$/o;
Why should there be whitespace between the variable name and the =?

-- CrawfordCurrie - 26 Mar 2005

Probably because programmers know that any amount of whitespace is optional.

Why we use set statements at all is another question. I'd venture that this is 'data about pages' and therefore metadata; it'd be nice to have a panel that pops up where one is guided as to what name (ALLOWTOPICCHANGE) = value (TWikiAdminGroup) pairs are possible.

Logically these Sets ought fit into a namespace too.

-- MartinCleaver - 26 Mar 2005

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2008-09-11 - TWikiJanitor
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.