Last active
August 29, 2015 13:59
-
-
Save ibizaman/10646395 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| rendering_dictionnary = { | |
| "assignment": [ | |
| ("key", "target" ), | |
| ("list", "first_formatting" ), | |
| ("key", "operator" ), # ceci devrait être optionnel | |
| ("constant", "=" ), | |
| ("list", "second_formatting"), | |
| ("key", "value" ) | |
| ], | |
| } | |
| # vs | |
| @node() | |
| def assignment(node): | |
| yield dump_node(node["target"]) | |
| yield dump_node_list(node["first_formatting"]) | |
| if node.get("operator"): | |
| # FIXME should probably be a different node type | |
| yield node["operator"] | |
| yield "=" | |
| yield dump_node_list(node["second_formatting"]) | |
| yield dump_node(node["value"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment