[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: [wml] Re: WML 2.0.1

On Fri, May 26, 2000 at 10:13:53PM +0200, Denis Barbier wrote:
> Some expressions below are called either valid or invalid. This has
> nothing to do with HTML or SGML syntax, it is just my idea of mp4h
> syntax.

Yep, I agree.

> > > 1) <H1>hello<BLA>hello</H1></BLA>
> > Expand BLA and interpret H1 as text.
> Agree.

> > > 2) <BLB>hello<BLA>hello</BLB></BLA>
> > Expand BLB, and don't expand BLB. Alternatively, print an error because
> > BLA is not terminated within BLB.
> <comment>
> Hey Stefan, you have only one choice ;-)  Otherwise grammar will be
> somewhat obfuscated.
> </comment>

Yes. I was just trying to differentiate between 'best-effort' parsing.
I.e. what should happen if we try to make it fool-proof.

> Invalid: `</BLB> found where </BLA> is expected'
> I believe that allowing wrong-nested tags does not help, it just makes
> debugging harder.

I'm completely okay with outputting an Error. It probably makes mp4h a
lot cleaner :)

> > > 3) <BLA>hello</BLB></BLA>
> > Error. BLB has no opening. Alternatively, interpret BLB as text.
> Invalid: `</BLB> found where </BLA> is expected'
> I would also suggest that
>   </BLB>
> reports an error.


> > > 4) <BLA><perl>print "<BLB>"</perl></BLB></BLA>
> > Because perl is run after mhc, I'd either make <perl></perl> protect its
> > interior from mhc, thus resulting in example 3. If you make
> > perl-non-protecting, you expand both of them. <BLB> then has "</perl> as
> > %body.
> I do not like the idea of <perl>...</perl> protecting against expansion,
> i worked hard to make Perl commands nestable ;-)
> So i would say that this expression is invalid.

Yep. It might surprise a few people, but I think it's better that way.
We might add an option to protect perl from pass2 just in case someone
wants it :)

> > > 6) <BLA <BLB>></BLB>></BLA> or <BLA <BLB>></BLB></BLA>
> > expand BLA with argument <BLB> and %body </BLB>>
> <comment>
> No, <BLB> alone does not make sense.
> </comment>
> <BLA> has one attribute which is <BLB>></BLB> and an empty body.

I don't think so. It would be violating POLA. A tag should close with
the first 'available' >.
<BLA <BLB>> Is clearly BLA with attribute <BLB> no matter what follows.
Only >'s at the 'top level' are allowed to represent literal >'s.
IMHO you should print a warning for these cases anyway.

> > and
> > expand BLA with argument <BLB> and %body </BLB>
> Invalid: EOF when reading attributes af <BLA>

I think you mean <BLB> here, don't you ?

But yes, this line should always produce an error.

> > both behave essentially the sames as (3)
> Not really, as you see we do not have the same idea on how it must be
> processed.

I'd say, keep it clean and simple. This will make things a great deal
easier IMHO :)

> > > 7) <BLA <BLB></BLA></BLB>></BLA>
> > Just pass "<BLB></BLA></BLB>" as parameter.
> <comment>
> Huh, in 3 you say this expression is invalid.
> </comment>
> Invalid: `</BLA> found where </BLB> is expected'

Oh, I was thinking of doing no further expansion inside <>. I'm not sure
if we can do this or if we need that somewhere, but it would make things
a great deal simpler. IMHO of course.

Remember, all software sucks. Some sucks more, and some sucks less.
But it sucks regardless. If I want to see something elegant I go
look for a piece of art.                                  -- Wietse
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com