[ https://issues.apache.org/jira/browse/GROOVY-2178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14995287#comment-14995287 ]
ASF GitHub Bot commented on GROOVY-2178: ---------------------------------------- GitHub user jwagenleitner opened a pull request: https://github.com/apache/incubator-groovy/pull/181 GROOVY-2178 - Shell can not handle multi-line list defs To address @blackdrag's comments on the issue, there was already some code that handles [detecting incomplete lines] (https://github.com/apache/incubator-groovy/blob/1eb37ea96428e14f0418fa003292cce9d3f94f94/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/Parser.groovy#L204-L212) and it looks like it captures all the chars referenced in the comment. I wasn't able to replicate the problem with opened braces `{` so am just trying to detect (if compilation error is thrown) if there's an unmatched bracket `[` or paren `(`. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jwagenleitner/incubator-groovy GROOVY-2178 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-groovy/pull/181.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #181 ---- commit 314e6858dce81d5e6ca585b104c495fe5e220a0d Author: John Wagenleitner <john.wagenleit...@gmail.com> Date: 2015-11-07T15:28:48Z GROOVY-2178 - Shell can not handle multi-line list defs ---- > Shell can not handle multi-line list defs > ----------------------------------------- > > Key: GROOVY-2178 > URL: https://issues.apache.org/jira/browse/GROOVY-2178 > Project: Groovy > Issue Type: Bug > Components: Groovysh > Affects Versions: 2.1.6, 2.2.0-beta-1 > Reporter: Jason Dillon > Priority: Minor > Labels: contrib > > 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} > :-( -- This message was sent by Atlassian JIRA (v6.3.4#6332)