Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | bpo-31241: Fix AST node position for list and generator comprehensions. ↵ | Serhiy Storchaka | 2018-11-27 | 1 | -11/+40 |
| | | | | | | | | (GH-10633) The lineno and col_offset attributes of AST nodes for list comprehensions, generator expressions and tuples are now point to the opening parenthesis or square brace. For tuples without parenthesis they point to the position of the first item. | ||||
* | bpo-34876: Change the lineno of the AST for decorated function and class. ↵ | Serhiy Storchaka | 2018-10-30 | 1 | -2/+14 |
| | | | | | | | (GH-9731) It was overridden by the lineno of the first decorator. Now it is the lineno of 'def' or 'class'. | ||||
* | bpo-32892: Support subclasses of base types in isinstance checks for AST ↵ | Serhiy Storchaka | 2018-10-28 | 1 | -0/+4 |
| | | | | | | | constants. (GH-9934) Some projects (e.g. Chameleon) create ast.Str containing an instance of the str subclass. | ||||
* | bpo-32892: Use ast.Constant instead of specific constant AST types. (GH-9445) | Serhiy Storchaka | 2018-09-27 | 1 | -53/+151 |
| | |||||
* | closes bpo-31902: Fix the col_offset attribute for ast.Async* nodes to point ↵ | guoci | 2018-09-11 | 1 | -4/+4 |
| | | | | | | to the "async" keyword. (GH-4175) Previously, col_offset points to the keyword after "async". | ||||
* | bpo-33851: Fix ast.get_docstring() for a node that lacks a docstring. (GH-7682) | Serhiy Storchaka | 2018-06-15 | 1 | -0/+31 |
| | |||||
* | bpo-32911: Revert bpo-29463. (GH-7121) (GH-7197) | Serhiy Storchaka | 2018-05-29 | 1 | -78/+63 |
| | | | | | | Remove the docstring attribute of AST types and restore docstring expression as a first stmt in their body. Co-authored-by: INADA Naoki <methane@users.noreply.github.com> | ||||
* | bpo-31778: Make ast.literal_eval() more strict. (#4035) | Serhiy Storchaka | 2018-01-04 | 1 | -8/+31 |
| | | | | Addition and subtraction of arbitrary numbers no longer allowed. | ||||
* | bpo-31592: Fix an assertion failure in Python parser in case of a bad ↵ | Oren Milman | 2017-09-30 | 1 | -0/+10 |
| | | | | unicodedata.normalize(). (#3767) | ||||
* | bpo-29637: clean docstring only if not None (GH-267) | Matthias Bussonnier | 2017-02-24 | 1 | -0/+1 |
| | |||||
* | bpo-29622: Make AST constructor to accept less than enough number of ↵ | INADA Naoki | 2017-02-23 | 1 | -4/+0 |
| | | | | | | | | | | | positional arguments (GH-249) bpo-29463 added optional "docstring" field to 4 AST types. While it is optional, it breaks backward compatibility because AST constructor requires number of positional argument is same to number of fields. AST types accepts empty arguments, and incomplete keyword arguments. But it's not big problem because field can be filled after creation, and checked when compiling. So stop requiring complete set of fields for positional arguments too. | ||||
* | bpo-29463: Add docstring field to some AST nodes. (#46) | INADA Naoki | 2017-02-22 | 1 | -73/+87 |
| | | | | | | | | | | | * bpo-29463: Add docstring field to some AST nodes. ClassDef, ModuleDef, FunctionDef, and AsyncFunctionDef has docstring field for now. It was first statement of there body. * fix document. thanks travis! * doc fixes | ||||
* | Issue #28008: Implement PEP 530 -- asynchronous comprehensions. | Yury Selivanov | 2016-09-09 | 1 | -16/+19 |
| | |||||
* | Issue #27352: Fixed an error message in a test. | Serhiy Storchaka | 2016-06-27 | 1 | -1/+1 |
| | |||||
* | Issue #13436: Add a test to make sure that ast.ImportFrom(level=None) works | Berker Peksag | 2016-04-29 | 1 | -0/+11 |
| | |||||
* | compiler: don't emit SyntaxWarning on const stmt | Victor Stinner | 2016-02-08 | 1 | -5/+2 |
| | | | | | Issue #26204: the compiler doesn't emit SyntaxWarning warnings anymore when constant statements are ignored. | ||||
* | compiler now ignores constant statements | Victor Stinner | 2016-02-08 | 1 | -17/+16 |
| | | | | | | | | | | | | | | | | | | | The compile ignores constant statements and emit a SyntaxWarning warning. Don't emit the warning for string statement because triple quoted string is a common syntax for multiline comments. Don't emit the warning on ellipis neither: 'def f(): ...' is a legit syntax for abstract functions. Changes: * test_ast: ignore SyntaxWarning when compiling test statements. Modify test_load_const() to use assignment expressions rather than constant expression. * test_code: add more kinds of constant statements, ignore SyntaxWarning when testing that the compiler removes constant statements. * test_grammar: ignore SyntaxWarning on the statement "1" | ||||
* | Simplify main() of test_ast | Victor Stinner | 2016-02-08 | 1 | -2/+3 |
| | | | | | | | * Use ast.parse() to get the AST for a statement * Use str%args syntax for format a line Issue #26204. | ||||
* | Issue #26146: enhance ast.Constant error message | Victor Stinner | 2016-01-26 | 1 | -0/+6 |
| | | | | | | | Mention the name of the invalid type in error message of AST validation for constants. Suggestion made by Joseph Jevnik on a review. | ||||
* | Add ast.Constant | Victor Stinner | 2016-01-25 | 1 | -1/+119 |
| | | | | | | | | | | | | | | | | | | | | | Issue #26146: Add a new kind of AST node: ast.Constant. It can be used by external AST optimizers, but the compiler does not emit directly such node. An optimizer can replace the following AST nodes with ast.Constant: * ast.NameConstant: None, False, True * ast.Num: int, float, complex * ast.Str: str * ast.Bytes: bytes * ast.Tuple if items are constants too: tuple * frozenset Update code to accept ast.Constant instead of ast.Num and/or ast.Str: * compiler * docstrings * ast.literal_eval() * Tools/parser/unparse.py | ||||
* | make opening brace of container literals and comprehensions correspond to ↵ | Benjamin Peterson | 2015-09-26 | 1 | -9/+9 |
| | | | | the line number and col offset of the AST node (closes #25131) | ||||
* | Issue #24975: Fix AST compilation for PEP 448 syntax. | Yury Selivanov | 2015-09-01 | 1 | -9/+15 |
| | |||||
* | Issue #24688: ast.get_docstring() for 'async def' functions. | Yury Selivanov | 2015-07-23 | 1 | -0/+3 |
| | |||||
* | PEP 0492 -- Coroutines with async and await syntax. Issue #24017. | Yury Selivanov | 2015-05-12 | 1 | -0/+9 |
| | |||||
* | PEP 448: additional unpacking generalizations (closes #2292) | Benjamin Peterson | 2015-05-06 | 1 | -35/+21 |
| | | | | Patch by Neil Girdhar. | ||||
* | revert lineno and col_offset changes from #16795 (closes #21295) | Benjamin Peterson | 2015-02-02 | 1 | -31/+14 |
| | |||||
* | set line and column numbers for keyword-only arg nodes (closes #20619) | Benjamin Peterson | 2014-02-14 | 1 | -2/+2 |
| | |||||
* | #18466: merge with 3.3. | Ezio Melotti | 2013-08-17 | 1 | -1/+1 |
|\ | |||||
| * | #18466: fix more typos. Patch by Févry Thibault. | Ezio Melotti | 2013-08-17 | 1 | -1/+1 |
| | | |||||
* | | Update various test modules to use unittest.main() for test discovery | Brett Cannon | 2013-06-13 | 1 | -4/+1 |
| | | | | | | | | instead of manually listing tests for test.support.run_unittest(). | ||||
* | | test_ast: pass the filename to ast.parse() | Victor Stinner | 2013-03-21 | 1 | -1/+1 |
| | | |||||
* | | unify some ast.argument's attrs; change Attribute column offset (closes #16795) | Benjamin Peterson | 2013-03-18 | 1 | -37/+45 |
| | | | | | | | | Patch from Sven Brauch. | ||||
* | | create NameConstant AST class for None, True, and False literals (closes #16619) | Benjamin Peterson | 2012-12-06 | 1 | -5/+8 |
|/ | |||||
* | Issue #16546: make ast.YieldFrom argument mandatory. | Mark Dickinson | 2012-11-25 | 1 | -0/+8 |
| | |||||
* | get rid of ast_error_finish by passing the compiling struct to ast_error | Benjamin Peterson | 2012-09-02 | 1 | -1/+3 |
| | |||||
* | merge 3.2 (#15846) | Benjamin Peterson | 2012-09-02 | 1 | -0/+6 |
|\ | |||||
| * | prevert ast errors from being normalized before ast_error_finish is called ↵ | Benjamin Peterson | 2012-09-02 | 1 | -0/+6 |
| | | | | | | | | (closes #15846) | ||||
* | | test AST base type garbage collection | Benjamin Peterson | 2012-07-08 | 1 | -1/+14 |
| | | |||||
* | | merge 3.2 (#14378) | Benjamin Peterson | 2012-03-22 | 1 | -0/+6 |
|\ \ | |/ | |||||
| * | check by equality for __future__ not identity (closes #14378) | Benjamin Peterson | 2012-03-22 | 1 | -0/+6 |
| | | |||||
* | | give the AST class a __dict__ | Benjamin Peterson | 2012-03-12 | 1 | -0/+3 |
| | | |||||
* | | merge 3.2 | Benjamin Peterson | 2012-03-12 | 1 | -3/+0 |
|\ \ | |/ | |||||
| * | allow AST objects to be like its subclasses | Benjamin Peterson | 2012-03-12 | 1 | -3/+0 |
| | | |||||
* | | merge 3.2 | Benjamin Peterson | 2012-03-12 | 1 | -3/+0 |
|\ \ | |/ | |||||
| * | every other ast object has a dict, so I think AST should, too | Benjamin Peterson | 2012-03-12 | 1 | -3/+0 |
| | | |||||
* | | make YieldFrom its own distinct from Yield (closes #13780) | Benjamin Peterson | 2012-01-14 | 1 | -2/+2 |
| | | |||||
* | | Implement PEP 380 - 'yield from' (closes #11682) | Nick Coghlan | 2012-01-13 | 1 | -1/+2 |
| | | |||||
* | | Merge branch 3.2 | Amaury Forgeot d'Arc | 2011-11-22 | 1 | -0/+11 |
|\ \ | |/ | |||||
| * | Issue #13436: Fix a bogus error message when an AST object was passed | Amaury Forgeot d'Arc | 2011-11-22 | 1 | -0/+11 |
| | | | | | | | | an invalid integer value. | ||||
* | | Merge 3.2, fix typos. | Florent Xicluna | 2011-11-11 | 1 | -1/+1 |
|\ \ | |/ |