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

Command expressions using named arguments doesn't support newlines after colon

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.4, 1.8-beta-1
    • 1.8-beta-2
    • None
    • None

    Description

      Although normal calls (with parens) with named arguments allow a newline after the colons, the command expression variant (witout parens) doesn't like it.

      Example:

      someMethod name:
                          "gromit",
                  eating:
                          "nice cheese",
                  times:
                          2
      

      Whereas when adding parentheses, this is supported notation.

      Attachments

        Activity

          But if someone feels like fighting Antlr a bit for 1.7 as well, don't hesitate

          guillaume Guillaume Sauthier added a comment - But if someone feels like fighting Antlr a bit for 1.7 as well, don't hesitate

          I've made the changes on just on 1.8, as this is more interesting especially in the case of GEP-3, like in:

          check that:
              margherita tastes good
          

          With GEP-3, would be interpreted as:

          check(that: margherita).tastes(good)
          
          guillaume Guillaume Sauthier added a comment - I've made the changes on just on 1.8, as this is more interesting especially in the case of GEP-3, like in: check that: margherita tastes good With GEP-3, would be interpreted as: check(that: margherita).tastes(good)

          People

            guillaume Guillaume Sauthier
            guillaume Guillaume Sauthier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: