[stringtemplate-interest] ASTExpr.getObjectProperty: should a null propertyName check for a default value if the object is a Map?
Sam Harwell
sharwell at pixelminegames.com
Tue Mar 3 19:10:21 PST 2009
If I have the following map in my StringTemplate:
csharpVisibilityMap ::= [
"private":"private",
"protected":"protected",
"public":"public",
"fragment":"private",
default:"private"
]
And ruleDescriptor is an instance of the Rule class, whose string member
modifier is null, should "private" be output, or an empty string? It
seems like the default value in the map, if present, should be used. The
relevant code is the check for a null propertyName inside
ASTExpr.getObjectProperty without then checking if the parameter o is a
Map.
lexerRule(ruleName,nakedBlock,ruleDescriptor,block,memoize) ::= <<
...
<csharpVisibilityMap.(ruleDescriptor.modifier)> ...
>>
Thanks,
Sam Harwell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20090303/52e55e65/attachment.html
More information about the stringtemplate-interest
mailing list