X-Git-Url: http://nitlanguage.org diff --git a/src/parser/parser_nodes.nit b/src/parser/parser_nodes.nit index 5204376..55d4606 100644 --- a/src/parser/parser_nodes.nit +++ b/src/parser/parser_nodes.nit @@ -1126,7 +1126,7 @@ end class APublicVisibility super AVisibility # The `public` keyword, if any - var n_kwpublic: nullable TKwpublic is writable + var n_kwpublic: nullable TKwpublic = null is writable end # An explicit private visibility modifier class APrivateVisibility @@ -1165,7 +1165,7 @@ class AStdClassdef var n_classkind: AClasskind is writable, noinit # The name of the class - var n_id: nullable TClassid = null is writable + var n_qid: nullable AQclassid = null is writable # The `[` symbol var n_obra: nullable TObra = null is writable @@ -1186,7 +1186,7 @@ class AStdClassdef return [for d in n_propdefs do if d isa ASuperPropdef then d] end - redef fun hot_location do return n_id.location + redef fun hot_location do return n_qid.location end # The implicit class definition of the implicit main method @@ -1491,7 +1491,7 @@ class ATypePropdef var n_kwtype: TKwtype is writable, noinit # The name of the virtual type - var n_id: TClassid is writable, noinit + var n_qid: AQclassid is writable, noinit # The bound of the virtual type var n_type: AType is writable, noinit @@ -1659,6 +1659,16 @@ class AQid var n_id: TId is writable, noinit end +# A potentially qualified class identifier `foo::bar::Baz` +class AQclassid + super Prod + # The qualifier, if any + var n_qualified: nullable AQualified = null is writable + + # The final identifier + var n_id: TClassid is writable, noinit +end + # A signature in a method definition. eg `(x,y:X,z:Z):T` class ASignature super Prod @@ -1697,7 +1707,7 @@ class AType var n_kwnullable: nullable TKwnullable = null is writable # The name of the class or of the formal type - var n_id: TClassid is writable, noinit + var n_qid: AQclassid is writable, noinit # The opening bracket var n_obra: nullable TObra = null is writable @@ -1907,6 +1917,23 @@ class AForExpr # The `for` keyword var n_kwfor: TKwfor is writable, noinit + # The list of groups to iterate + var n_groups = new ANodes[AForGroup](self) + + # The `do` keyword + var n_kwdo: TKwdo is writable, noinit + + # The body of the loop + var n_block: nullable AExpr = null is writable +end + +# A collection iterated by a for, its automatic variables and its implicit iterator. +# +# Standard `for` iterate on a single collection. +# Multiple `for` can iterate on more than one collection at once. +class AForGroup + super Prod + # The list of name of the automatic variables var n_ids = new ANodes[TId](self) @@ -1915,12 +1942,6 @@ class AForExpr # The expression used as the collection to iterate on var n_expr: AExpr is writable, noinit - - # The `do` keyword - var n_kwdo: TKwdo is writable, noinit - - # The body of the loop - var n_block: nullable AExpr = null is writable end # A `with` statement