Skip to content

Conversation

@leonardt
Copy link
Owner

This adds logic to pass a metadata dictionary between passes. The initial entries are source_filename and source_lines which are populated by inspect.getsourcefile(fn) and inspect.getsourcelines(fn) when the flags are set for begin_rewrite. This debug information is used by magma to generate error messages (the important part of getsourcelines is that it provides the starting line number and the actual source lines which could be different compared to simply unparsing the AST (e.g. if there are linebreaks in the user code not represented in the AST).

@leonardt leonardt requested a review from cdonovick August 22, 2019 18:48
Copy link
Collaborator

@cdonovick cdonovick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modulo type annotation

@cdonovick cdonovick merged commit 0240a9f into master Aug 22, 2019
@cdonovick cdonovick deleted the metadata branch September 3, 2019 21:54
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

Successfully merging this pull request may close these issues.

3 participants