mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-17 20:01:31 +00:00
Significant progress on AST codegen.
This commit is contained in:
@ -21,21 +21,5 @@ enum class NodeType(val parent: NodeType? = null) {
|
||||
FunctionCall(Expression),
|
||||
If(Expression),
|
||||
ImportDeclaration(Declaration),
|
||||
FunctionDefinition(Definition);
|
||||
|
||||
val parents: Set<NodeType>
|
||||
|
||||
init {
|
||||
val calculatedParents = mutableListOf<NodeType>()
|
||||
var self = this
|
||||
while (true) {
|
||||
calculatedParents.add(self)
|
||||
if (self.parent != null) {
|
||||
self = self.parent!!
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
parents = calculatedParents.toSet()
|
||||
}
|
||||
FunctionDefinition(Definition)
|
||||
}
|
||||
|
Reference in New Issue
Block a user