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

parser error with static initializer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-JSR-5
    • parser
    • None

    Description

      static_init:
      class A {
      static foo
      static bar
      static

      { foo = "FOO" bar = "BAR" }

      }

      $ groovyc static_init
      >>> a serious error occurred: found unexpected token during REDUCE [804]
      >>> stacktrace:
      found unexpected token during REDUCE [804]
      at org.codehaus.groovy.syntax.parser.Parser.expression(Parser.java:3009)
      at org.codehaus.groovy.syntax.parser.Parser.propertyDeclaration(Parser.java:1125)
      at org.codehaus.groovy.syntax.parser.Parser.typeBodyStatement(Parser.java:955)
      at org.codehaus.groovy.syntax.parser.Parser.typeBody(Parser.java:804)
      at org.codehaus.groovy.syntax.parser.Parser.classDeclaration(Parser.java:644)
      at org.codehaus.groovy.syntax.parser.Parser.topLevelStatement(Parser.java:506)
      at org.codehaus.groovy.syntax.parser.Parser.module(Parser.java:299)
      at org.codehaus.groovy.syntax.parser.Parser.parse(Parser.java:103)
      at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:288)
      at org.codehaus.groovy.control.CompilationUnit$3.call(CompilationUnit.java:528)
      at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:872)
      at org.codehaus.groovy.control.CompilationUnit.parse(CompilationUnit.java:513)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:475)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:452)
      at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:72)
      at org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:211)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

      Attachments

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              mdi Michael Ivey
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: