[
https://issues.apache.org/jira/browse/VELOCITY-614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633377#action_12633377
]
Nathan Bubna commented on VELOCITY-614:
---------------------------------------
It's not #something($foo) that is the problem, it's #something(foo). The
difference is that #something(foo) is perfectly legal schmoo, but if there is a
#something directive or #something macro, then plain old foo (JJTWORD) is not
an acceptable argument for it. it would have to be 'foo' (string literal) or
$foo (reference) or ['foo'] (inline list) or { 'foo':$foo } (inline map).
so, since it is legal schmoo and we now let you 'forward define' (aka late
bind) macros (in order to allow macros to be included via #parse), we cannot
tell at parse time if #something(foo) is legal schmoo or a macro called
#something that is being passed an illegal argument. we have to wait until
runtime to know if #something is a macro or not.
as for the escaping, escaping is also (unfortunately) dependent on whether
#something is schmoo or a valid macro. which reminds me, i didn't test how it
reacts if #something is a macro and you do \#something(foo). hmm. i'll have
to check on that.
anyway, hope that helps clear it up a bit.
> Impossible to escape '#' if followed by text and parenthesis(
> "\#something(Stuff)" renders with the '\')
> --------------------------------------------------------------------------------------------------------
>
> Key: VELOCITY-614
> URL: https://issues.apache.org/jira/browse/VELOCITY-614
> Project: Velocity
> Issue Type: Bug
> Affects Versions: 1.6
> Environment: I don't think it is relevant but still: CPU Intel
> Pentium D, windows XP SP3, JRE 1.6.0_07, Velocity 1.6-beta1
> Reporter: Guillaume Polet
> Priority: Minor
> Fix For: 1.6
>
> Attachments: Velocity614TestCase.java
>
>
> "#something(Stuff)" in your templates (without the double quotes) causes a
> parse error.
> "\#something(Stuff)" in your template (without the double quotes) renders as
> "\#something(Stuff)"
> Either the first line should go through just fine, or the next one should not
> render the '\'
> This typically happens when you try to generate JavaDoc for overriding
> methods.
> Don't hesitate to contact me if this is not clear enough or if you are unable
> to reproduce this issue.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]