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

Shell can not handle multi-line list defs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.6, 2.2.0-beta-1
    • 2.4.6
    • Groovysh
    • None

    Description

      Things like this, while valid Groovy, don't eval in groovysh:

      a = [
          1,
          2,
          3
      ]
      

      Pukes up something like:

      groovy:000> a = [
      groovy:001> 1,
      groovy:002> 2,
      groovy:003> 3
      ERROR org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, groovysh_parse: 4: unexpected token: 3 @ line 4, column 1.
         3
         ^
      
      1 error
      

      Though this works:

      a = [
          1,
          2,
          3,
      ]
      

      Attachments

        Activity

          People

            pascalschumacher Pascal Schumacher
            jason@planet57.com Jason Dillon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: