Appearance
| 1 | namespace Syntax.Trees.Definitions is | |
| 2 | use Source; | |
| 3 | ||
| 4 | // A supplementary member block for an already-declared type: | |
| 5 | // partial <Type>[<params>] is <members> si | |
| 6 | // Adds members to the target type; carries no interface clause | |
| 7 | // (interfaces stay in the target's own header). `name`/`arguments` | |
| 8 | // identify the target; `body` holds the members. | |
| 9 | class PARTIAL( | |
| 10 | location: LOCATION, | |
| 11 | name: Identifiers.Identifier, | |
| 12 | arguments: TypeExpressions.LIST?, | |
| 13 | modifiers: Modifiers.LIST, | |
| 14 | body: Definitions.LIST | |
| 15 | ): Classy is | |
| 16 | super(location, name, arguments, null, modifiers, body); | |
| 17 | ||
| 18 | description_for_walk: string => "partial"; | |
| 19 | ||
| 20 | accept(visitor: Visitor) is | |
| 21 | visitor.visit(self); | |
| 22 | si | |
| 23 | ||
| 24 | _walk(visitor: Visitor) is | |
| 25 | if !visitor.pre(self) then | |
| 26 | name.walk(visitor); | |
| 27 | ||
| 28 | if arguments? then | |
| 29 | arguments.walk(visitor); | |
| 30 | fi | |
| 31 | ||
| 32 | modifiers.walk(visitor); | |
| 33 | body.walk(visitor); | |
| 34 | fi | |
| 35 | ||
| 36 | accept(visitor); | |
| 37 | si | |
| 38 | si | |
| 39 | si |