Actually, after reading through the parser grammar it's pretty clear
this is haunting the authors. They're trying to describe an escape
sequence in the grammar itself which causes havoc for the poor parser.
Escape sequences should be handled by the scanner. Really when \$
appears in the stream it should be emitted as $ in literal output, with
no possibility to be tokenized. Then the grammer doesn't care and is
smaller, the parser is faster, and you have an outlet for
backwards-compatible growth if in the future you need new language
constructs. (Imagine if #hello is in my template. And in the future
hello becomes a directive. It breaks me. But if I do \#hello now, then
I'm always covered.)
Your point is a good one-- does the speed really matter? In most cases
no, it really doesn't. In my case it actually might, I don't know...
there are a TON of dollar signs over megabytes of content. I'm just
imagining an interrupted stream and a hashmap lookup for each and every
one... there's no notion of constant or final template variables is there?
Hmm. Anyway, thanks for the thoughts.
--jason
Daniel Dekany wrote:
Wednesday, July 6, 2005, 5:53:54 PM, Jason Pettiss wrote:
Aaah, I get it. That's a serious performance hit but at least it'll get
me up and running so I can make milestone... a good tip. Thank you.
Then later I'll just go back and replace $ and # with \ or whatever the
escape is, so things are fast again.
So what's the history behind the broken escape mechanism? It's not
really an escape mechanism if it can't escape itself, after all. I mean
the problem is, \$foo should always always always output $foo. Because
there is no way of knowing at template time what's in the context and so
there's no way of knowing if random backslashes are going to creep up.
[snip]
Yeah, I have debated in a long thread about that earlier. I dare to
state that it is, as a matter if fact... amm... so, let me call it what
it is: plain stupid design. And most probably it will not be fixed,
since that would be not backward compatible, of course. So don't waste
your time thinking about it, just live with ${D} and ${H}. Who cares
after all... this minor speed loss barely does mater.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]