Velocity
  1. Velocity
  2. VELOCITY-209

Encountered ")" Was expecting one of: ")"

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Later
    • Affects Version/s: 1.3.1
    • Fix Version/s: 2.x
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC

      Description

      The following velocity directive (which IS NOT proper code and should create a
      meaningful error)

      #if ( (1 == $currentAccount.getAmountDue().compareTo(BigDecimal.valueOf(0)))
      && ($currentAccount.isAccountStatusActive()) && (0 ==
      $currentAccount.scheduledPaymentList().size()) )

      gives this error:

      Encountered ")" at line 27, column 75.
      Was expecting one of:
      "," ...
      ")" ...
      ...
      ...

      Handcopied from veloedit in Eclipse (a little clearer):

      Encountered ")" at line 27, column 75. [After BigDecimal.valueOf(0)]
      Was expecting one of:
      "," ...
      ")" ...
      <WHITESPACE> ...
      <DOT> ...

      The error thrown is internally-inconsistent (the parser found a right-paren,
      but expected to find a right-paren) and useless.

        Activity

        Hide
        Henning Schmiedehausen added a comment -

        This is related to BigDecimal not being a reference and getting lost in the parse process. This is reproducable but is just as VELOCITY-280 it doesn't seem to be easily solvable. As with VELOCITY-280, is someone comes up with a patch to the Parser.jj file to fix this, I'm fine to apply it to the 1.5 release, else it goes to the "great parser rewrite" in 2.0

        Show
        Henning Schmiedehausen added a comment - This is related to BigDecimal not being a reference and getting lost in the parse process. This is reproducable but is just as VELOCITY-280 it doesn't seem to be easily solvable. As with VELOCITY-280 , is someone comes up with a patch to the Parser.jj file to fix this, I'm fine to apply it to the 1.5 release, else it goes to the "great parser rewrite" in 2.0
        Hide
        Daniel Rall added a comment -

        Additional commentary from Mike K. on the dev list:

        "The bug is that the error message says that it found a right paren, but it
        expected to find a right paren. That's internally-inconsistent, since you
        can't both find and not find a right paren.

        Just to clarify one final time – at no point did I expect the code above to
        WORK. I was not posting a request for help with my code.

        However, I do expect the parser to produce internally-inconsistent error
        messages."

        Show
        Daniel Rall added a comment - Additional commentary from Mike K. on the dev list: "The bug is that the error message says that it found a right paren, but it expected to find a right paren. That's internally-inconsistent, since you can't both find and not find a right paren. Just to clarify one final time – at no point did I expect the code above to WORK. I was not posting a request for help with my code. However, I do expect the parser to produce internally-inconsistent error messages."

          People

          • Assignee:
            Unassigned
            Reporter:
            Mike Kienenberger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development