grammar: introduce ASuperPropdef for super-classes
[nit.git] / src / parser / parser_nodes.nit
index 289ad53..93a26e2 100644 (file)
@@ -1030,12 +1030,13 @@ class AStdClassdef
        # The extern block code
        var n_extern_code_block: nullable AExternCodeBlock = null is writable
 
-       # The list of super-classes
-       var n_superclasses = new ANodes[ASuperclass](self)
-
        # The `end` keyword
        var n_kwend: TKwend is writable, noinit
 
+       fun n_superclasses: Array[ASuperPropdef] do
+               return [for d in n_propdefs do if d isa ASuperPropdef then d]
+       end
+
        redef fun hot_location do return n_id.location
 end
 
@@ -1111,17 +1112,6 @@ class AFormaldef
        var n_type: nullable AType = null is writable
 end
 
-# A super-class. eg `super X`
-class ASuperclass
-       super Prod
-
-       # The super keyword
-       var n_kwsuper: TKwsuper is writable, noinit
-
-       # The super-class (indicated as a type)
-       var n_type: AType is writable, noinit
-end
-
 # The definition of a property
 abstract class APropdef
        super ADefinition
@@ -1200,6 +1190,18 @@ class AMainMethPropdef
        super AMethPropdef
 end
 
+# A super-class. eg `super X`
+class ASuperPropdef
+       super APropdef
+
+       # The super keyword
+       var n_kwsuper: TKwsuper is writable, noinit
+
+       # The super-class (indicated as a type)
+       var n_type: AType is writable, noinit
+end
+
+
 # Declaration of callbacks for extern methods
 class AExternCalls
        super Prod