Skip to content

Instantly share code, notes, and snippets.

@ibizaman
Last active August 29, 2015 13:59
Show Gist options
  • Select an option

  • Save ibizaman/10646395 to your computer and use it in GitHub Desktop.

Select an option

Save ibizaman/10646395 to your computer and use it in GitHub Desktop.
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