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

the new parser does not seem to recognize the new function pointer assignment for a particular case

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.0-JSR-1
    • 1.0-JSR-2
    • None
    • None
    • win xp /all

    Description

      #test.gy

      def sayHello(){
      println "sayHello"
      }

      def h = &sayHello // the parser does not seem to recognize this new method
      //pointer syntax.

      def x = this.&sayHello // Works though!

                                            1. exception trace

      D:\lab\groovy>groovy test.gy
      Caught: General error during parsing: unexpected token: &

      D:\lab\groovy\test.gy:5:9: unexpected token: &
      at org.codehaus.groovy.antlr.parser.GroovyRecognizer.multiplicativeExpre
      ssion(GroovyRecognizer.java:10568)
      at org.codehaus.groovy.antlr.parser.GroovyRecognizer.additiveExpression(
      GroovyRecognizer.java:10184)
      at org.codehaus.groovy.antlr.parser.GroovyRecognizer.shiftExpression(Gro
      ovyRecognizer.java:8041)
      at org.codehaus.groovy.antlr.parser.GroovyRecognizer.relationalExpressio
      n(GroovyRecognizer.java:9992)
      at org.codehaus.groovy.antlr.parser.GroovyRecognizer.equalityExpression(
      GroovyRecognizer.java:9934)
      at org.codehaus.groovy.antlr.parser.GroovyRecognizer.regexExpression(Gro
      ovyRecognizer.java:9884)
      at org.codehaus.groovy.antlr.parser.GroovyRecognizer.andExpression(Groov
      yRecognizer.java:9854)
      at org.codehaus.groovy.antlr.parser.GroovyRecognizer.exclusiveOrExpressi
      on(GroovyRecognizer.java:9824)
      at org.codehaus.groovy.antlr.parser.GroovyRecognizer.inclusiveOrExpressi

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            blackdrag Jochen Theodorou
            karthikg Karthik Guru
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment