[EMAIL PROTECTED] writes:
> Bzzt, you missed the point, you don't need to implement a parser (that
> was PHP's big mistake that eperl solves). All that the start-tag does is
> imply 'pipe this from here, up to the end tag, to the stdin of the
> real parser'.
Umm. I'm not so sure I missed the point, though perhaps I was trying
to allow too much flexibility. The question is, "How do you recognize
the end tag?" For example:
<html> The magic tag is <perl> print "</perl> today"; </perl> </html>
The end tag here shouldn't be interpreted as an end tag because it's
in the middle of a scheme string. AFAIK, in the general case, there's
no way to keep from accidentally recognizing spurious end tags within
your embedded code without fully parsing the language you're
embedding.
I suppose the trivial way around this (which I hadn't really
considered; it being too obvious :>) would just be to require that the
embedded code not contain any end tags. This will only work with a
regexp parser if we have a sufficiently flexible one (see my final
note below).
> No, I don't like the quotes, I'd rather argue that the fundamental form
> is this:
> <html> Yesterday was <scheme>(current-day -1)</scheme>.</html>
>
> If you wish, we could also define the following abbreviated equivalents:
> <html> Yesterday was <s/>(current-day -1)</>.</html>
> <html> Yesterday was <s/(current-day -1)/.</html>
>
> These are sgml-ish. Using quote marks I think just is asking for trouble.
But this has the same problem above:
<html> Yesterday was <s/>(frob "</>")</>.</html>
whereas this is completely unambiguous (because the scheme parser
makes it so):
"<html> Yesterday was " (frob "</>") ".</html>"
If we want to do it without the scheme parser, we have to create our
own, but we can trivialize our parser by just forbidding end tags in
the embedded code and using a regexp parser. However, for this to
work cleanly, we'll need a regexp parser that can be told to use
non-greedy patterns. Otherwise it'll grab the text from the first
start tag to the last end tag on the first call.
--
Rob Browning <[EMAIL PROTECTED]> PGP=E80E0D04F521A094 532B97F5D64E3930
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]