summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-31825: Fixed OverflowError in the 'unicode-escape' codec (GH-4058) (#4059)Miss Islington (bot)2017-10-201-1/+1
| | | | and in codecs.escape_decode() when decode an escaped non-ascii byte. (cherry picked from commit 56cb465cc93dcb35aaf7266ca3dbe2dcff1fac5f)
* [3.6] bpo-31592: Fix an assertion failure in Python parser in case of a bad ↵Miss Islington (bot)2017-09-301-12/+16
| | | | | unicodedata.normalize(). (GH-3767) (#3836) (cherry picked from commit 7dc46d8cf5854d9f4ce3271b29c21aea4872e8ad)
* [3.6] bpo-30923: Silence fall-through warnings included in -Wextra since ↵Victor Stinner2017-09-121-0/+3
| | | | | | | | | | | | | | | | gcc-7.0 (#3518) * bpo-30923: Disable warning that has been part of -Wextra since gcc-7.0. (#3142) (cherry picked from commit d73a960c575207539c3f9765cff26d4fff400b45) * bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. (#3157) (cherry picked from commit f432a3234f9f2ee09bd40be03e06bf72865ee375) * bpo-31275: Small refactoring to silence a fall-through warning. (#3206) (cherry picked from commit 138753c1b96b5e06a5c5d409fa4cae5e2fe1108b)
* bpo-30465: Fix lineno and col_offset in fstring AST nodes (GH-1800) (gh-3409)Miss Islington (bot)2017-09-071-5/+67
| | | | For f-string ast nodes, fix the line and columns so that tools such as flake8 can identify them correctly. (cherry picked from commit e7c566caf177afe43b57f0b2723e723d880368e8)
* [3.6] bpo-30682: Removed a too-strict assertion that failed for certain ↵Serhiy Storchaka2017-06-161-2/+2
| | | | | | f-strings. (GH-2232) (#2242) This caused a segfault on eval("f'\\\n'") and eval("f'\\\r'") in debug build.. (cherry picked from commit 11e97f2f80bf65cc828c127eafc95229df35d403)
* [3.6] bpo-30529: Fix errors for invalid whitespaces in f-string ↵Serhiy Storchaka2017-06-081-24/+7
| | | | | | | | subexpressions. (GH-1888) (#2013) '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. (cherry picked from commit 2e9cd58)
* [3.6] bpo-29104: Fixed parsing backslashes in f-strings. (GH-490) (#1812)Serhiy Storchaka2017-05-251-21/+32
| | | (cherry picked from commit 0cd7a3f)
* Issue #28739: f-string expressions no longer accepted as docstrings andSerhiy Storchaka2016-12-111-6/+5
| | | | by ast.literal_eval() even if they do not include subexpressions.
* Issue #28715: Added error checks for PyUnicode_AsUTF8().Serhiy Storchaka2016-11-201-3/+5
|\
| * Issue #28715: Added error checks for PyUnicode_AsUTF8().Serhiy Storchaka2016-11-201-3/+5
| |
* | Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-4/+4
|\ \ | |/ | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| * Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-2/+2
| | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
* | Fix warn_invalid_escape_sequence()Victor Stinner2016-11-151-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.
* | Issue #26182: Fix ia refleak in code that raises DeprecationWarning.Yury Selivanov2016-11-081-3/+5
| |
* | Fixed issue #28633: segfault when concatenating bytes literal and f-string.Eric V. Smith2016-11-071-4/+5
| |
* | Issue 28128: Print out better error/warning messages for invalid string ↵Eric V. Smith2016-10-311-5/+61
| | | | | | | | escapes. Backport to 3.6.
* | delete dead codeBenjamin Peterson2016-09-191-3/+0
| |
* | Issue #26182: Raise DeprecationWarning for improper use of async/await keywordsYury Selivanov2016-09-151-0/+20
| |
* | Make an f-string error message more exact and consistent.Eric V. Smith2016-09-111-1/+1
| |
* | just start with an int rather than castingBenjamin Peterson2016-09-101-2/+2
| |
* | Issue 27948: Allow backslashes in the literal string portion of f-strings, ↵Eric V. Smith2016-09-101-273/+211
| | | | | | | | but not in the expressions. Also, require expressions to begin and end with literal curly braces.
* | Issue #26331: Implement the parsing part of PEP 515.Brett Cannon2016-09-091-1/+26
| | | | | | | | Thanks to Georg Brandl for the patch.
* | Issue #28008: Implement PEP 530 -- asynchronous comprehensions.Yury Selivanov2016-09-091-11/+24
| |
* | Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.Yury Selivanov2016-09-091-2/+84
| | | | | | | | Patch by Ivan Levkivskyi.
* | replace PY_SIZE_MAX with SIZE_MAXBenjamin Peterson2016-09-071-1/+1
| |
* | Closes issue 27921: Disallow backslashes anywhere in f-strings. This is a ↵Eric V. Smith2016-09-031-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.
* | Merge spelling and grammar fixes from 3.5Martin Panter2016-08-051-1/+1
|\ \ | |/
| * Fix spelling and grammar in documentation and code commentsMartin Panter2016-08-041-1/+1
| |
* | Issue #27352: Correct the validation of the ImportFrom AST node and simplifySerhiy Storchaka2016-06-271-2/+2
| | | | | | | | the implementation of the IMPORT_NAME opcode.
* | Issue #23275: Allow () = iterable assignment syntaxBerker Peksag2016-05-181-7/+2
| | | | | | | | Documentation updates by Martin Panter.
* | remove unused c_encoding struct memberBenjamin Peterson2016-02-261-17/+4
| |
* | rewrite parsestr() so it's comprehensible; remove dead codeBenjamin Peterson2016-02-261-24/+12
| |
* | c_encoding can never be NULL, which allows some code simplificationBenjamin Peterson2016-02-261-47/+43
| |
* | Issue #26146: enhance ast.Constant error messageVictor Stinner2016-01-261-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.
* | Fix a refleak in validate_constant()Victor Stinner2016-01-261-0/+2
| | | | | | | | Issue #26146.
* | Add ast.ConstantVictor Stinner2016-01-251-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix two instances of wrong indentation.Georg Brandl2016-01-181-2/+2
| |
* | Issue #20440: More use of Py_SETREF.Serhiy Storchaka2015-12-271-7/+3
|\ \ | |/ | | | | | | This patch is manually crafted and contains changes that couldn't be handled automatically.
| * Issue #25555: Fix parser and AST: fill lineno and col_offset of "arg" node whenVictor Stinner2015-11-061-6/+3
| | | | | | | | compiling AST from Python objects.
* | Issue #25923: Added the const qualifier to static constant arrays.Serhiy Storchaka2015-12-251-2/+2
| |
* | Issue #25555: Fix parser and AST: fill lineno and col_offset of "arg" node whenVictor Stinner2015-11-061-6/+3
| | | | | | | | compiling AST from Python objects.
* | One more typo in a commentMartin Panter2015-10-071-1/+1
| |
* | merge 3.5 (#25131)Benjamin Peterson2015-09-261-4/+10
|\ \ | |/
| * make opening brace of container literals and comprehensions correspond to ↵Benjamin Peterson2015-09-261-4/+10
| | | | | | | | the line number and col offset of the AST node (closes #25131)
* | Fixed error creation if the problem is an empty expression in an f-string: ↵Eric V. Smith2015-09-241-6/+5
| | | | | | | | use ast_error instead of PyErr_SetString.
* | Move f-string compilation of the expression earlier, before the conversion ↵Eric V. Smith2015-09-231-15/+51
| | | | | | | | character and format_spec are checked. This allows for error messages that more closely match what a user would expect.
* | Issue #24779: Remove unused rawmode parameter to unicode_decode.Eric V. Smith2015-09-211-6/+3
| |
* | Issue #24965: Implement PEP 498 "Literal String Interpolation". ↵Eric V. Smith2015-09-191-56/+929
| | | | | | | | Documentation is still needed, I'll open an issue for that.
* | Fix ast_for_atom()Victor Stinner2015-09-031-0/+1
| | | | | | | | | | Clear PyObject_Str() exception if it failed, ast_error() should not be called with an exception set.
* | Merge 3.5 (issue #24975)Yury Selivanov2015-09-021-2/+4
|\ \ | |/