Skip to content

Tracking nodes #15

Description

@cdonovick

In debug mode we should track what node(s) caused another node to exists if possible.
For example

node = ast.BoolOp(...) 
tree =  ast.Ast(..., node, ...)
metadata = {}
env = SymbolTable({}, {})
bit_tree, bit_env, bit_metadata = bool_to_bit(debug=True)(tree, env, metadata)

Then something like one of following should work

bit_tree.origin == tree
bit_tree.<PATH>.bit_node.origin == node
bit_metadata[bit_tree]['origin'] == tree
bit_metadata[bit_tree.<PATH>.bit_node]['origin'] == node

Now it kinda clunky to have to have to construct each pass with debug=True so maybe the pass interface should be extended with an options dict / object.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions