[stringtemplate-interest] [ST4 Beta-4] Map is not imported
Terence Parr
parrt at cs.usfca.edu
Tue Feb 15 15:02:18 PST 2011
hiya. I remember thinking about this; apparently I thought about it in an incorrect way! adding to todo list.
Ter
On Feb 12, 2011, at 3:11 PM, Udo Borkowski wrote:
> Hi,
>
> it looks like a map defined in an STGroup is not imported when using the "import" statement for that group.
>
> Steps to reproduce:
>
> File "mapAndTemplate.stg"
> ---------
> mapname ::= [ "name1":"val1", "name2":"val2", default:"err"]
>
> template1() ::= <<
> one
>>>
>
> main() ::= <<
> mapOutput: <mapname.name1>, <mapname.xyz>
> templateOutput: <template1()>
>>>
> --------
>
> "main()" will output (as expected):
>
> mapOutput: val1, err
> templateOutput: one
>
>
>
> However when the group is imported like here
>
> File "test.stg"
> ----------
> import "~/st/templates/trial/mapAndTemplate.stg"
>
> main() ::= <<
> mapOutput: <mapname.name1>, <mapname.xyz>
> templateOutput: <template1()>
>>>
> ----------
>
> the output is:
>
> mapOutput: ,
> templateOutput: one
>
> I.e. the map entries are not found. However the template "template1()" is correctly used.
>
>
> Udo
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
More information about the stringtemplate-interest
mailing list