summaryrefslogtreecommitdiff
path: root/Python/ast.c
AgeCommit message (Collapse)AuthorLines
2018-12-07bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. ↵Zackery Spytz-1/+6
(GH-11015) (GH-11020) (cherry picked from commit 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9)
2018-09-11Make sure the line comes from the same node as the col offset. (GH-9189)Miss Islington (bot)-3/+3
Followup to 90fc8980bbcc5c7dcced3627fe172b0bfd193a3b. <!-- Thanks for your contribution! Please read this comment in its entirety. It's quite important. GH- Pull Request title It should be in the following format: ``` bpo-NNNN: Summary of the changes made ``` Where: bpo-NNNN refers to the issue number in the https://bugs.python.org. Most PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue. GH- Backport Pull Request title If this is a backport PR (PR made against branches other than `master`), please ensure that the PR title is in the following format: ``` [X.Y] <title from the original PR> (GH-NNNN) ``` Where: [X.Y] is the branch name, e.g. [3.6]. GH-NNNN refers to the PR number from `master`. --> (cherry picked from commit d13e59c1b512069d90efe7ee9b613d3913e79c56) Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-09-11closes bpo-31902: Fix the col_offset attribute for ast.Async* nodes to point ↵Miss Islington (bot)-18/+21
to the "async" keyword. (GH-4175) Previously, col_offset points to the keyword after "async". (cherry picked from commit 90fc8980bbcc5c7dcced3627fe172b0bfd193a3b) Co-authored-by: guoci <zguoci@gmail.com>
2018-08-22bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). ↵Miss Islington (bot)-0/+2
(GH-8852) Reported by Svace static analyzer. (cherry picked from commit 28853a249b1d0c890b7e9ca345290bb8c1756446) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-05-29bpo-32911: Revert bpo-29463. (GH-7121)Serhiy Storchaka-63/+24
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>
2017-12-01Don't hide unexpected errors in PyErr_WarnExplicitObject(). (#4585)Serhiy Storchaka-9/+10
2017-11-15bpo-32023: Disallow genexprs without parenthesis in class definitions. (#4400)Serhiy Storchaka-5/+10
2017-11-15bpo-32012: Disallow trailing comma after genexpr without parenthesis. (#4382)Serhiy Storchaka-10/+9
2017-11-05Fix miscellaneous typos (#4275)luzpaz-1/+1
2017-10-20bpo-31825: Fixed OverflowError in the 'unicode-escape' codec (#4058)Serhiy Storchaka-1/+1
and in codecs.escape_decode() when decode an escaped non-ascii byte.
2017-10-05bpo-30406: Make async and await proper keywords (#1669)Jelle Zijlstra-40/+35
Per PEP 492, 'async' and 'await' should become proper keywords in 3.7.
2017-09-30bpo-31592: Fix an assertion failure in Python parser in case of a bad ↵Oren Milman-12/+16
unicodedata.normalize(). (#3767)
2017-09-14bpo-31338 (#3374)Barry Warsaw-4/+2
* Add Py_UNREACHABLE() as an alias to abort(). * Use Py_UNREACHABLE() instead of assert(0) * Convert more unreachable code to use Py_UNREACHABLE() * Document Py_UNREACHABLE() and a few other macros.
2017-09-06bpo-30465: Fix lineno and col_offset in fstring AST nodes (#1800)Łukasz Langa-5/+67
For f-string ast nodes, fix the line and columns so that tools such as flake8 can identify them correctly.
2017-08-21bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. ↵Stefan Krah-0/+3
(#3157)
2017-06-16bpo-30682: Removed a too-strict assertion that failed for certain f-strings. ↵ericvsmith-2/+2
(#2232) This caused a segfault on eval("f'\\\n'") and eval("f'\\\r'") in debug build.
2017-06-08bpo-30529: Fix errors for invalid whitespaces in f-string subexpressions. ↵Serhiy Storchaka-24/+7
(#1888) 'invalid character in identifier' now is raised instead of 'f-string: empty expression not allowed' if a subexpression contains only whitespaces and they are not accepted by Python parser.
2017-05-25bpo-29104: Fixed parsing backslashes in f-strings. (#490)Serhiy Storchaka-21/+32
2017-03-21bpo-29865: Use PyXXX_GET_SIZE macros rather than Py_SIZE for concrete types. ↵Serhiy Storchaka-1/+1
(#748)
2017-02-22bpo-29463: Add docstring field to some AST nodes. (#46)INADA Naoki-26/+63
* 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
2016-12-16Issue #18896: Python function can now have more than 255 parameters.Serhiy Storchaka-5/+0
collections.namedtuple() now supports tuples with more than 255 elements.
2016-12-11Issue #28739: f-string expressions no longer accepted as docstrings andSerhiy Storchaka-6/+5
by ast.literal_eval() even if they do not include subexpressions.
2016-12-11Issue #28739: f-string expressions no longer accepted as docstrings andSerhiy Storchaka-6/+5
by ast.literal_eval() even if they do not include subexpressions.
2016-11-28Issue #12844: More than 255 arguments can now be passed to a function.Serhiy Storchaka-5/+0
2016-11-20Issue #28715: Added error checks for PyUnicode_AsUTF8().Serhiy Storchaka-3/+5
2016-11-20Issue #28715: Added error checks for PyUnicode_AsUTF8().Serhiy Storchaka-3/+5
2016-11-16Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka-4/+4
_PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
2016-11-16Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka-2/+2
_PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
2016-11-15Fix warn_invalid_escape_sequence()Victor Stinner-1/+7
Issue #28691: Fix warn_invalid_escape_sequence(): handle correctly DeprecationWarning raised as an exception. First clear the current exception to replace the DeprecationWarning exception with a SyntaxError exception. Unit test written by Serhiy Storchaka.
2016-11-08Issue #26182: Fix ia refleak in code that raises DeprecationWarning.Yury Selivanov-3/+5
2016-11-07Fixed issue #28633: segfault when concatenating bytes literal and f-string.Eric V. Smith-4/+5
2016-10-31Issue 28128: Print out better error/warning messages for invalid string ↵Eric V. Smith-5/+61
escapes. Backport to 3.6.
2016-09-18delete dead codeBenjamin Peterson-3/+0
2016-09-15Issue #26182: Raise DeprecationWarning for improper use of async/await keywordsYury Selivanov-0/+20
2016-09-11Make an f-string error message more exact and consistent.Eric V. Smith-1/+1
2016-09-09just start with an int rather than castingBenjamin Peterson-2/+2
2016-09-09Issue 27948: Allow backslashes in the literal string portion of f-strings, ↵Eric V. Smith-270/+208
but not in the expressions. Also, require expressions to begin and end with literal curly braces.
2016-09-09Issue #26331: Implement the parsing part of PEP 515.Brett Cannon-1/+26
Thanks to Georg Brandl for the patch.
2016-09-09Issue #28008: Implement PEP 530 -- asynchronous comprehensions.Yury Selivanov-11/+24
2016-09-08Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.Yury Selivanov-2/+84
Patch by Ivan Levkivskyi.
2016-09-07replace PY_SIZE_MAX with SIZE_MAXBenjamin Peterson-1/+1
2016-09-03Closes issue 27921: Disallow backslashes anywhere in f-strings. This is a ↵Eric V. Smith-0/+10
temporary restriction. In 3.6 beta 2, the plan is to again allow backslashes in the string parts of f-strings, but disallow them in the expression parts.
2016-08-05Merge spelling and grammar fixes from 3.5Martin Panter-1/+1
2016-08-04Fix spelling and grammar in documentation and code commentsMartin Panter-1/+1
2016-06-27Issue #27352: Correct the validation of the ImportFrom AST node and simplifySerhiy Storchaka-2/+2
the implementation of the IMPORT_NAME opcode.
2016-05-18Issue #23275: Allow () = iterable assignment syntaxBerker Peksag-7/+2
Documentation updates by Martin Panter.
2016-02-25remove unused c_encoding struct memberBenjamin Peterson-17/+4
2016-02-25rewrite parsestr() so it's comprehensible; remove dead codeBenjamin Peterson-24/+12
2016-02-25c_encoding can never be NULL, which allows some code simplificationBenjamin Peterson-47/+43
2016-01-27Issue #26146: enhance ast.Constant error messageVictor Stinner-1/+3
Mention the name of the invalid type in error message of AST validation for constants. Suggestion made by Joseph Jevnik on a review.