Enums in aspets

Issue #157 resolved
Jesper Öqvist created an issue

Allow enum declarations in aspect files.

Comments (3)

  1. Jesper Mattsson

    Is this really resolved properly?

    Having an aspect with:

    public enum MyASTNode.MyEnum { A, B, C };
    

    gives me "exception occurred while parsing: org.jastadd.ast.AST.ASTDecl cannot be cast to org.jastadd.ast.AST.EnumDecl".

    Looking at the changeset, Jrag.jjt line 1498 looks like a likely culprit:

    typeDecl = (org.jastadd.ast.AST.EnumDecl) root.findEnumDecl(className, Unparser.unparseComment(jjtThis),
        fileName, first.beginLine, enclosingAspect);
    
  2. Jesper Öqvist reporter

    The only type of enum declarations I considered when working on this issue were declarations on this form:

    aspect A {
      enum MyEnum {
        A, B, C
      }
    }
    

    I will create a new issue for inter-type enum declarations.

  3. Log in to comment