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

Shell Does Not Accept Triple Double Quote

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.0
    • 2.4.2
    • Groovysh
    • None

    Description

      A string defined via the triple double quote (not assigned to a variable) in the groovysh generates an error:

      $ bin/groovysh
      Groovy Shell (2.4.0, JVM: 1.8.0_31)
      Type ':help' or ':h' for help.
      -------------------------------------------------------------------------------
      groovy:000> "test"
      ===> test
      groovy:000> 'test'
      ===> test
      groovy:000> """test"""
      assert name
             |
             ""
              at java_lang_Runnable$run.call (Unknown Source)
      groovy:000> """test
      

      The above was possible in previous versions. My guess is that this problem introduced itself given the new method for parsing code lines given to groovysh (but i'm not 100% sure):

      https://github.com/groovy/groovy-core/blob/GROOVY_2_4_X/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/util/CommandArgumentParser.groovy

      Attachments

        Activity

          People

            melix Cédric Champeau
            spmallette Stephen Mallette
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: