Re: Patch and test to allow component calls

John Williams <[email protected]>
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
On Wed, 22 Sep 2004, Dave Rolsky wrote:
> On Wed, 22 Sep 2004, Jonathan Swartz wrote:
>
> > So how about this: If a <&| &> tag contains a literal string as defined
> > above, then you can use either </&> or </& LITERAL>, where LITERAL is
> > the exact literal they specified. Otherwise, they can only use </&>.
> > This is mostly as John suggested, except that we don't let them use </&>
> > for expressions.
> >
> > I'm assuming that literals are vastly more common than expressions in
> > <&| &> tags, so this should give Alex what he wants in most cases.
> > Except that he won't be able to stick long diary entries in his </&> tag.
> >
> > What do you think?
>
> The code that determines if something is a literal is not the parsing
> code, so implementing this would require some extra talking back and forth
> between lexer & compiler, which doesn't seem like a good design.

So is your only objection that our current design does not allow us to
implement it cleanly enough?

I wouldn't put the decision of whether the ending tags matches the
beginning tag in the parsing code anyway.  It needs access to the
comp_with_content_stack, which is in the compiler.
Compiler::component_content_call_end is where I put it last time.
The parser just passes anything after '</&' to the compiler,
and it makes the decision whether it is valid.  No back and forth.

Also, as Jonathan pointed out, the definition of whether it is a literal
is well-documented in the manual, so I don't think the the design will
suffer very much if we put [\w/_.] in more than one place.

~ John Williams




-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.