|There's more than one way to do things|
Re^11: Thanks to Ikegami, Chromatic & Corionby Logicus
|on Nov 03, 2011 at 00:43 UTC||Need Help??|
Nope, your looking at it the wrong way, probably my fault for comparing it with TT2 lol.
Try this analogy, it's like self-golfing code.
Let's take an example from that file I sent you.
mumble mumble... make text box much wider on PerlNights.. mumble.. mumble
The state of the document changes as it is being parsed, first the parser runs a fast regex to look for primary ( ) tags, and marks them with the ` control char
It's found 2 primary tags to compute, one is nested inside the other. Now because it has found at least one primary tag, a slower regex runs which finds the whole tag and it's close, and then treats it like a subroutine call, returning the return value to the document.
The slower regex is looped and it negates the ` char within the tag structure, so that only tags which have no nested commands get processed each time we go around the loop.
The result is that the first tag to be computed is the (sqd) tag, followed immediately by the (db_mask) tag. So let's say that the (sqd) tag returned a value of 1. The db_mask tag then gets picked up and run with the following data :
The query and mask tags are extracted, the query gets run and returns hashrefs which are then used to populate the mask. The db_mask plugin will return a copy of the mask interpolated with the specified columns for each row the query produces.
Since in this case the query will only return a single row, the return value looks like this :
The parser now looks for any remaining ( ) primary tags, determines there are none left, and moves on to the secondary tags < >. Since there are none of these either (h2 is not a defined aXML tag), it skips on the the tertiary tags, [ ]
Once again it has found 2 tags that it recognises with the fast scanner, and invokes the slower scanner which loops negating the control char, causing the tags to be run db_get first, followed by hlink.
The parser then concludes there is nothing left to do and exits to the post processing stage.