-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-35766: Merge typed_ast back into CPython #11645
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
Merged
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
77de614
Add TYPE_IGNORE and TYPE_COMMENT without regenerating anything
gvanrossum 8e0fd8a
Regenerated files (make regen-token)
gvanrossum cb93ba5
Tentative parsetok.c changes to handle TYPE_IGNORE
gvanrossum 232f2b6
Unconditionally recognize type comments in tokenizer.c
gvanrossum c80197e
Changes to Grammar without regenerating anything
gvanrossum b440842
Regenerated files (make regen-grammar)
gvanrossum 9db5e34
Add type_comment fields to various asdl classes without regenerating …
gvanrossum 6cc5a55
Regenerated files (make regen-ast)
gvanrossum e7f207d
Make ast.c compile by adding NULL for all type_comment arguments
gvanrossum 8b426b9
Make recognition of type comments conditional on a flag (off by default)
gvanrossum 72e4f4d
Define flags to turn on parsing type comments
gvanrossum 3d19dbb
Support passing type ignores to Module object
gvanrossum d273d67
Support TYPE_COMMENT in ast.c for all nodes that need it
gvanrossum 830d63a
Regenerate Lib/symbol.py
gvanrossum 71aecd5
Make growable_int_array functions static
gvanrossum 53ceee6
News blurb (thank you blurb-it)
blurb-it[bot] 6ddca66
Fix test_ast.py
gvanrossum 36c212b
Fix test_asdl_parser.py
gvanrossum d2091ed
Hacky way to get tests to pass
gvanrossum 6d1f1de
Regen Lib/symbol.py (again)
gvanrossum 567f341
Fix assert in ast_for_suite() -- n can be a func_body_suite too now
gvanrossum 5d36558
A better hack for IndentationError
gvanrossum 7e78552
Merge remote-tracking branch 'origin/master' into ast-type-comments
gvanrossum 308df83
Move func_body_suite towards the end of Grammar to stabilize symbol n…
gvanrossum 110c42a
Fix test_parser.py in a hacky way
gvanrossum 46dfac5
Export PyCF_TYPE_COMMENTS and add an interface for it to ast.parse()
gvanrossum 8c527b7
Add some tests for type comments
gvanrossum cb301f7
Add some negative tests
gvanrossum d57aeab
Add checks that no type comments are returned without type_comments=True
gvanrossum 30ea39e
Add 'as a' to with-statement with type comment
gvanrossum cef9f31
Don't allow type comments on expression statements
gvanrossum 1667b8c
Add guards to some '== TYPE_COMMENT' checks, hopefully fixing a crash
gvanrossum 895a012
Support compile(source, filename, 'func_type', PyCF_ONLY_AST)
gvanrossum ac485cd
Fix test_func_type_input()
gvanrossum 8935005
Document type_comments=True and mode='func_type' for ast.parse()
gvanrossum 4687be4
Document token.TYPE_COMMENT
gvanrossum 783224d
Fix the asdl_c.py code generator to support mode='func_type'
gvanrossum 50a921a
Reject function def with two signature type comments
gvanrossum d0adc22
Add a test with a non-ASCII name in a type comment
gvanrossum 98ee20a
Add comment clarifying the func_body_suite switcheroo
gvanrossum 4abedd3
Check for errors from _Py_asdl_seq_new()
gvanrossum 551f2a6
Check for NULL from NEW_TYPE_COMMENT()
gvanrossum b68270c
Fix markup bug
gvanrossum dcf86e8
Brace block in parsetok.c
gvanrossum 87812ad
Brace a block and fix indentation of another block
gvanrossum 5633403
Brace block, update grammar comment, fix indents of many ast_error calls
gvanrossum 2062e27
Merge branch 'master' into new-ast-type-comments
gvanrossum 03310fc
Merge remote-tracking branch 'origin/master' into ast-type-comments
gvanrossum 229874c
Break up long comment to trigger Appveyor build
gvanrossum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this doesn't give an error, and the type comment recorded is the one on the same line:
I think this should cause a
SyntaxError
(not here, but inast.c
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will do.