The parser needs to be able to handle infinite schemas. This likely means instantiating default elements and keeping track of them, and then recursing through and setting attributes. There is a POC of this in feature/recursive-schema.
The orderer needs to be able to identify cycles, and either annotate them for manual resolution in the output or resolve them as is.
The DSL itself needs to be able to handle infinite recursion. This chiefly causes problems in places with default values. If the default value is the element with no arguments, but some properties have defaults, then instantiating with no arguments will trigger an infinite recursion.
What is the correct way to write recursive schemas in the DSL?
class TreeNode(Object):
parent = Property(Element())
TreeNode.properties["value"].element = TreeNode
or maybe
class TreeNode(Object):
parent = Property(lambda: TreeNode)
There are several issues with this.
feature/recursive-schema
.What is the correct way to write recursive schemas in the DSL?
or maybe