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

AST Browser - EmptyStatement nodes do not render in AST Browser, visitEmptyStatement missing from GroovyCodeVisitor

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7-beta-2
    • Fix Version/s: 1.7-rc-1
    • Component/s: Compiler
    • Labels:
      None
    • Environment:
      ubuntu linux, probably all

      Description

      The AST Browser displays ASTs for code in GroovyConsole.

      EmptyStatement nodes do not show up in the tree. There are 2 ways to create an empty statement:

      // the TryCatchStatement will have a finallyBlock field that is of type EmptyStatement
      def x
      try {
      x = 1
      } catch (IOException ei) {
      x = 2
      }

      // the IfStatement will have an elseBlock field that is of type EmptyStatement.
      if (true) 1
      2

      To fix this we can add visitEmptyStatement to GroovyCodeVisitor and its subclasses.
      Or we can handle it as a special case in the AST Browser code.

        Attachments

          Activity

            People

            • Assignee:
              hamletdrc Hamlet D'Arcy
              Reporter:
              hamletdrc Hamlet D'Arcy
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: