forked from can-lehmann/owlkettle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
can-lehmann#115 Update gui-DSL for clearer stateRef Syntax
Modifies both parsing the gui-DSL into Node-types as well as generating 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 will not contain assignments. The "<Widget> as <someStateRefVariable>" syntax creates an infix expression which is part of nnkCallKinds. Therefore in parseGui I removed it from the nnkCallKinds group. 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
1 parent
faa291f
commit d06c1cb
Showing
2 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters