Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking nodes #15

Open
cdonovick opened this issue Aug 23, 2019 · 0 comments
Open

Tracking nodes #15

cdonovick opened this issue Aug 23, 2019 · 0 comments
Assignees

Comments

@cdonovick
Copy link
Collaborator

cdonovick commented Aug 23, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants