jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-2178

New shell dosn't like multi-line list defs very much

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: 1.8.x
  • Component/s: Groovysh
  • Labels:
    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,
]

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Guillaume Laforge added a comment - 22/Oct/08 10:47 AM

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 Laforge added a comment - 22/Oct/08 10:47 AM 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.
Hide
Permalink
Jason Dillon added a comment - 22/Oct/08 10:54 AM

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 - 22/Oct/08 10:54 AM 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
Permalink
blackdrag blackdrag added a comment - 23/Oct/08 6:56 AM

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
blackdrag blackdrag added a comment - 23/Oct/08 6:56 AM 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.

People

  • Assignee:
    Unassigned
    Reporter:
    Jason Dillon
Vote (0)
Watch (0)

Dates

  • Created:
    07/Oct/07 5:42 AM
    Updated:
    07/Oct/11 10:55 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.