Groovy
  1. Groovy
  2. GROOVY-2178

Shell can not handle multi-line list defs

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1.6, 2.2.0-beta-1
    • Fix Version/s: None
    • Component/s: Groovysh
    • Labels:

      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,
      ]
      

        Activity

        Jason Dillon created issue -
        Jason Dillon made changes -
        Field Original Value New Value
        Description Things like this, while valid Groovy, don't eval in groovysh:

        {noformat}
        a = [
            1,
            2,
            3
        ]
        {noformat}

        Pukes up something like:

        {noformat}
        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
        {noformat}
        Things like this, while valid Groovy, don't eval in groovysh:

        {noformat}
        a = [
            1,
            2,
            3
        ]
        {noformat}

        Pukes up something like:

        {noformat}
        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
        {noformat}

        Though this works:

        {noformat}
        a = [
            1,
            2,
            3,
        ]
        {noformat}

        :-(
        Guillaume Delcroix made changes -
        Fix Version/s 1.1-rc-1 [ 13165 ]
        Fix Version/s 1.1-rc-2 [ 13792 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.2 [ 13832 ]
        Fix Version/s 1.1-rc-2 [ 13792 ]
        Hide
        Guillaume Delcroix added a comment -

        Jason, in case you've got some spare cycles, you can have a look at it, otherwise I'm scheduling it for 1.7 for the moment.

        Show
        Guillaume Delcroix added a comment - Jason, in case you've got some spare cycles, you can have a look at it, otherwise I'm scheduling it for 1.7 for the moment.
        Guillaume Delcroix made changes -
        Fix Version/s 1.6 [ 13832 ]
        Fix Version/s 1.7 [ 14014 ]
        Hide
        Jason Dillon added a comment -

        This is parser voodoo to me... I wish I could fix this, but the truth is that the parser doesn't like line by line compilation similar to how python works.

        Show
        Jason Dillon added a comment - This is parser voodoo to me... I wish I could fix this, but the truth is that the parser doesn't like line by line compilation similar to how python works.
        Hide
        Jochen Theodorou added a comment -

        well, you could try to not to send incomplete scripts to the compiler. For example if there is a open [(

        {, then do not send before the corresponding }

        )] is given. Also a line is incomplete if it ends with one of ,.-+/*%&|?<>=: and not to forget open strings. Writing something that recognizes this should not be too difficult.

        Show
        Jochen Theodorou added a comment - well, you could try to not to send incomplete scripts to the compiler. For example if there is a open [( {, then do not send before the corresponding } )] is given. Also a line is incomplete if it ends with one of ,.-+/*%&|?<>=: and not to forget open strings. Writing something that recognizes this should not be too difficult.
        Guillaume Delcroix made changes -
        Fix Version/s 1.7-beta-x [ 15538 ]
        Fix Version/s 1.7-beta-1 [ 14014 ]
        Jochen Theodorou made changes -
        Fix Version/s 1.7.x [ 15538 ]
        Fix Version/s 1.8.x [ 15750 ]
        Jochen Theodorou made changes -
        Assignee Jason Dillon [ user57 ]
        Cédric Champeau made changes -
        Labels contrib
        Pascal Schumacher made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Pascal Schumacher made changes -
        Fix Version/s 1.8.x [ 15750 ]
        Pascal Schumacher made changes -
        Priority Minor [ 4 ] Major [ 3 ]
        Pascal Schumacher made changes -
        Affects Version/s 2.1.6 [ 19335 ]
        Pascal Schumacher made changes -
        Affects Version/s 2.2.0-beta-1 [ 19074 ]
        Pascal Schumacher made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Pascal Schumacher made changes -
        Summary New shell dosn't like multi-line list defs very much Shell can not handle multi-line list defs
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12731262 ] Default workflow, editable Closed status [ 12743136 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12973959 ] Default workflow, editable Closed status [ 12981101 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Jason Dillon
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development