GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — parser: fix dotted decorator names by drew-512 · Pull Request #265 · go-python/gpython Conversation
Contributor
A decorator with a dotted name was parsed into a single CPython 3.4 ( The helper is in parser.go rather than the grammar.y prologue so grammar.y keeps its line numbers: the regenerated y.go changes by one line and y.output not at all. Tests:
Fixes #264.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsA decorator with a dotted name, e.g. a.b.c(x), was parsed into a single Name whose Id was the whole string "a.b.c", so it failed at runtime with NameError: name 'a.b.c' is not defined. Build the decorator expression as CPython 3.4 does in ast_for_dotted_name: a Name for the first component and one Attribute (Load) per further component, all at the start of the dotted name, wrapped in a Call when arguments are given. Plain decorators now also carry the name's position rather than the '@', as in CPython. The new dottedName helper lives in parser.go so that grammar.y keeps its line numbers: the regenerated y.go changes by one line and y.output does not change. Enable test_dotted and test_eval_order in vm/tests/decorators.py and expect AttributeError for the nullval.attr decorator, as in CPython's test_decorators.py. Add dotted decorator cases to the parser tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. parser: dotted decorator names raise NameErrorUh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |