Velocity
  1. Velocity
  2. VELOCITY-709

String literal "\\" parses incorrectly

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.7, 2.x
    • Component/s: Engine
    • Labels:
      None

      Description

      Given the following VTL:

      #set($var = "
      " )
      #set($var2 = "$

      {var}

      ")

      results in the following parse error:

      Encountered "${" at test.vm[line 2, column 15]
      Was expecting one of:
      <RPAREN> ...
      ...

      the problem is that when parsing the string literal "
      " the second double quote is escaped. This was actually a bug that was introduced in 1.6.x, but I don't think we necessarily need to fix it in that branch.

        Issue Links

          Activity

          Hide
          Nathan Bubna added a comment -

          Thanks, Jarkko!

          Show
          Nathan Bubna added a comment - Thanks, Jarkko!
          Hide
          Jarkko Viinamäki added a comment -

          See patch submitted for VELOCITY-555 which should solve also this problem.

          Show
          Jarkko Viinamäki added a comment - See patch submitted for VELOCITY-555 which should solve also this problem.
          Hide
          Steve Ragle added a comment -

          This breaks a critical template for us (which is highly customized by many of our customers), which means we can't use 1.6 at all unless this is fixed. That's a shame because I was looking forward to taking advantage of several 1.6 changes and features.

          Show
          Steve Ragle added a comment - This breaks a critical template for us (which is highly customized by many of our customers), which means we can't use 1.6 at all unless this is fixed. That's a shame because I was looking forward to taking advantage of several 1.6 changes and features.

            People

            • Assignee:
              Unassigned
              Reporter:
              Byron Foster
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development