[stringtemplate-interest] formal arg checking
Terence Parr
parrt at cs.usfca.edu
Thu Apr 26 10:49:50 PDT 2007
Hi Nate, not sure I understand your concern. Can't you just send in
the error and display it? If not there, you'll get empty string.
Ter
On Apr 24, 2007, at 12:31 PM, Nate wrote:
> StringTemplate#checkNullAttributeAgainstFormalArguments
> (StringTemplate,
> String) has this javadoc comment...
>
> "Don't do the check if no formal parameters exist for this
> template; ask
> enclosing."
>
> The result of this method contract is that a template such as...
> $table(emptyMessage={$errorMessage; null="The list is empty."$})$
> ...will fail if the attribute "errorMessage" is not defined. I want to
> show the error messag if it exists, otherwise I want to show "The list
> is empty.". I should not have to define "errorMessage" unless there is
> an actual error message.
>
> This works even when "errorMessage" is not defined...
> $table(emptyMessage=errorMessage)$
>
> I believe the delegation to the enclosing template in
> checkNullAttributeAgainstFormalArguments is flawed.
>
> -Nate
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
More information about the stringtemplate-interest
mailing list