Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-395

Semantics of escaping unclear

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.1
    • 1.6
    • Documentation
    • None
    • Operating System: Windows 2000
      Platform: PC
    • 35738

    Description

      I think the semantics of the escaping operator \ (backslash) are not documented
      clearly. Especially I miss this ones:

      Why generates
      \$foo ==> $foo
      but
      \${foo} ==> \${foo}
      this seems inconsistent to me. I expect
      \${foo} ==> ${foo}

      I understand that
      ${foo:bar}
      raises an error since there are no : (colons)
      allowed in a variable-name.
      But why raises
      \${foo:bar}
      also an error? I would expect that \$ disables the function of $
      as an operator, so that the following

      {..}

      will not be parsed as
      a variable name.

      There should be a simple way to generate something like
      ${foo:bar}
      or even
      ${not a variable name at all &%$}
      The workaround
      #set($D='$')
      ${D}

      {foo:bar}

      is undocumented and REALLY ugly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            frank.fischer.mail@web.de Frank Fischer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: