Skip to content

Commit

Permalink
update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Technologicat committed Sep 26, 2024
1 parent 037f585 commit d86d1b1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mcpyrate/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,15 @@ class SourceLocationInfoValidator(ASTVisitor):
print(v.collected)
It's a rather common occurrence when developing macros to have the source
location info missing somewhere, but when we `compile`, Python won't tell us
*which* nodes are missing them.
location info missing somewhere, but when we `compile`, Python (up to 3.10)
won't tell us *which* nodes are missing them.
This can also be used to debug whether the problem is what Python claims it is.
Python's `compile` is notorious for yelling about a missing source location
when the actual problem is that is got a bare value in a position where an
AST node was expected.
Python's `compile` (up to 3.10) is notorious for yelling about a missing
source location when the actual problem is that is got a bare value in a
position where an AST node was expected.
Things might improve now that Python 3.11+ have AST validation in `compile`.
The macro expander *should* fill in missing source location info when it expands
a macro, so this utility will be needed only rarely.
Expand Down

0 comments on commit d86d1b1

Please sign in to comment.