Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-264

Parser doesn't like literal closures in stings

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-4
    • 1.0-beta-5
    • parser
    • None

    Description

      "$it << x"

      throws org.codehaus.groovy.syntax.parser.UnexpectedTokenException: expected <identifier>; found '' at unknown location

      Note this is a string of the form "$"

      {x}

      " where x is the closure

      {it << x}

      Whilst this is a silly example, there is a real application for this construct which looks like "${{it << x}

      .asWritable()}"

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            tug John Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment