Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modifies both parsing the gui-DSL into Node-types as well as generati…
…ng code from those Node-types. First it allows parsing expressions such as "<Widget> as <someStateRefVariable>". This is supposed to express an assignment of <someStateRefVariable> to the "valStateRef" Field on the <Widget> instance. The variable gets stored in the "widgetRefVar" field on "Node". There it is optional, as expressions such as "<Widget>:" without the "as <someStateRefVariable>" syntax obviously do not provide a variable to which a given signalState could be assigned. The "<Widget> as <someStateRefVariable>" syntax creates an infix expression which is part of nnkCallKinds. Therefore in parseGui I removed it from the nnkCallKinds group as it requires slightly different parsing than other nnkCallKinds based nodes. In the code-generation step, when generating a NodeWidget there now is a small check if the gui-DSL contained such an assignment. If so, the variable <someStateRefVariable> gets assigned to the Widgets "valStateRef" field. This is functionally equivalent to just having this syntax: Widget: stateRef = <someStateRefVariable> But is more readable.
- Loading branch information