antlr / stringtemplate4

StringTemplate 4
http://www.stringtemplate.org
Other
956 stars 231 forks source link

Cannot override template referenced from dictionary value #171

Open sharwell opened 7 years ago

sharwell commented 7 years ago

Steps to reproduce

Base.stg

Map ::= [
  "a": {<example()>}
]

example() ::= "override this"

Derived.stg

import "Base.stg"

main() ::= <<
<Map.("a")>
>>

example() ::= "custom"

Code

STGroup group = new STGroupFile("Derived.stg");
ST template = group.getInstanceOf("a");
template.render();

Expected result

custom

Actual result

override this