feat: Add debug info metadata specification in hugr-py#2971
feat: Add debug info metadata specification in hugr-py#2971
hugr-py#2971Conversation
hugr-py
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2971 +/- ##
==========================================
- Coverage 83.87% 83.86% -0.02%
==========================================
Files 268 269 +1
Lines 52945 53031 +86
Branches 46857 46857
==========================================
+ Hits 44410 44476 +66
- Misses 6266 6286 +20
Partials 2269 2269
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Can you explain what has been moved from that PR? |
Ah nevermind, I just saw the comment. |
| @@ -0,0 +1,152 @@ | |||
| """Typed generator source debug information metadata for HUGR nodes.""" | |||
There was a problem hiding this comment.
This docstring is hard for me to parse, can you reword?
| return DICompileUnit( | ||
| directory=str(value["directory"]), | ||
| filename=int(value["filename"]), | ||
| file_table=list[str](value["file_table"]), |
There was a problem hiding this comment.
| file_table=list[str](value["file_table"]), | |
| file_table=list[str](files), |
| } | ||
| # Declarations have no function body so could have no scope_line. | ||
| if self.scope_line is not None: | ||
| data["scope_line"] = str(self.scope_line) |
There was a problem hiding this comment.
| data["scope_line"] = str(self.scope_line) | |
| data["scope_line"] = int(self.scope_line) |
| line_no: int # First line of the function definition. | ||
| scope_line: int | None = None # First line of the function body. | ||
|
|
||
| def to_json(self) -> dict[str, str]: |
There was a problem hiding this comment.
Should be dict[str, JsonType]?
| column: int | ||
| line_no: int | ||
|
|
||
| def to_json(self) -> dict[str, str]: |
There was a problem hiding this comment.
Should be dict[str, JsonType]?
| "column": str(self.column), | ||
| "line_no": str(self.line_no), |
There was a problem hiding this comment.
| "column": str(self.column), | |
| "line_no": str(self.line_no), | |
| "column": int(self.column), | |
| "line_no": int(self.line_no), |
Moved from Quantinuum/guppylang#1554