Closed suemi994 closed 8 years ago
What happens if you use an anonymous template instead of a string for your dictionary values?
javaToSQLValueMap ::= [
"Date": {new java.sql.Date(<val>.getTime())},
default : {<val>}
]
fieldValue(type,val="o")::="<javaToSQLValueMap.(type.simpleName)>"
:memo: Looking at the code, it appears you can use any of the forms << ... >>
, <% ... %>
, or { ... }
to have your code treated as a template instead of as a raw string.
Thank you for your help, it works now !
When I'm writing a String Template Group file, I found that reference a variable in dictionary value string won't lead to the variable, but to the raw string. An example in your book is following.
When I use fieldValue , this is the result:
If the variable is not visible in this scope, then I will get
But it'not, so I think the cause is your definition of STRING token in lexer.