Velocity
  1. Velocity
  2. VELOCITY-552

Lost $ within literal blocks when not followed by alpha

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Windows XP or Solaris, JDK 1.4.2_10

      Description

      This is probably the same root cause as #355 (lost #s).
      I was happy to find the #literal() directive in the user guide, because I intend to output SH script from Velocity, which could otherwise get messy. Unfortunately, under certain circumstances, $s are being gobbled.
      Consider this VTL fragment:
      #literal()
      export $VAR=$(echo $testme)
      #end

      Run through evaluate, this spits out
      export $VAR=(echo $testme)

      which isn't very literal (and is a compilation fault in SH). Even more odd,
      #literal()
      export $VAR=\$(echo $testme)
      #end

      outputs
      export $VAR=(echo $testme)

      Did some further testing on it, and if the $ isn't followed by alpha, it gets gobbled, but only inside a literal block.

        Activity

        Hide
        Nathan Bubna added a comment -

        This is indeed a duplicate of VELOCITY-355, as Dan suspected. Fix to follow shortly...

        Show
        Nathan Bubna added a comment - This is indeed a duplicate of VELOCITY-355 , as Dan suspected. Fix to follow shortly...
        Hide
        Nathan Bubna added a comment -

        Here's a simple test case for the issue.

        Show
        Nathan Bubna added a comment - Here's a simple test case for the issue.
        Hide
        Will Glass-Husain added a comment -

        Thanks for reporting this. Targeting a bug fix for 1.6

        Show
        Will Glass-Husain added a comment - Thanks for reporting this. Targeting a bug fix for 1.6

          People

          • Assignee:
            Unassigned
            Reporter:
            Dan Ertman
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development