[stringtemplate-interest] no such attribute error?

Johannes Luber JALuber at gmx.de
Wed Dec 2 03:19:12 PST 2009


> Hi. in STv3, referencing an undefined attribute is not a problem...unless
> you define arguments for that template in a group file like:
> 
> foo(x) ::= "<y>"   // ooops, y doens't exist
> 
> you'll get an error since y doesn't exist (assuming foo isn't enclosed in
> another template with y formally defined as arg).
> 
> Now, even template files need a header. A group file is literally the cat
> of a bunch of templates.
> 
> For migrating to STv4, it would be a big burden to force people to add arg
> lists (the name of template is easy) to each template file.
> 
> I don't like that distinction though and so I'm leaning towards forcing
> accurate arg lists.  Not sure an automated tool is feasible to read old STv3
> file and figure out the list of args; worse, it can't know what to put:
> 
> body() ::= "h1. <title>"
> 
> should I put title in body args or is title inherited from enclosing
> file() template?
> 
> Yikes...
> 
> Ter

How about simple assuming unknown attributes as arguments? If that is wrong then people can easily correct that mistake. It should be less work than not using a conversion tool.

Johannes
-- 
Sarah Kreuz, die DSDS-Siegerin der Herzen, mit ihrem eindrucksvollen           
Debütalbum "One Moment in Time". http://portal.gmx.net/de/go/musik


More information about the stringtemplate-interest mailing list