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

Parrot Parser: split declaration and initialization of "def var" sets incorrect modifier "var"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.0.4
    • None
    • parser-antlr4
    • None

    Description

      Consider the following:

      def var // optional comment
      var = 'initial value'
      

      Parrot Parser sees first "var" as modifier and not variable declaration. Thus the split declaration and initialization is actually parsed like a declaration and initialization. IDE colors the modifiers differently from variable names and so "def" and first "var" get the same coloration.

      "def" can also be replaced by "final" and the same issue is observed.

      Attachments

        1. image-2020-07-08-16-07-22-846.png
          2 kB
          Eric Milles
        2. image-2021-12-31-08-35-29-478.png
          34 kB
          Paul King

        Activity

          People

            Unassigned Unassigned
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: