summaryrefslogtreecommitdiff
path: root/Python/ast.c
AgeCommit message (Collapse)AuthorLines
2017-06-16[3.6] bpo-30682: Removed a too-strict assertion that failed for certain ↵Serhiy Storchaka-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)
2017-06-09[3.6] bpo-30529: Fix errors for invalid whitespaces in f-string ↵Serhiy Storchaka-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)
2017-05-25[3.6] bpo-29104: Fixed parsing backslashes in f-strings. (GH-490) (#1812)Serhiy Storchaka-21/+32
(cherry picked from commit 0cd7a3f)
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-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.
2016-01-27Fix a refleak in validate_constant()Victor Stinner-0/+2
Issue #26146.
2016-01-26Add ast.ConstantVictor Stinner-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
2016-01-18Fix two instances of wrong indentation.Georg Brandl-2/+2
2015-12-27Issue #20440: More use of Py_SETREF.Serhiy Storchaka-7/+3
This patch is manually crafted and contains changes that couldn't be handled automatically.
2015-12-25Issue #25923: Added the const qualifier to static constant arrays.Serhiy Storchaka-2/+2
2015-11-06Issue #25555: Fix parser and AST: fill lineno and col_offset of "arg" node whenVictor Stinner-6/+3
compiling AST from Python objects.
2015-11-06Issue #25555: Fix parser and AST: fill lineno and col_offset of "arg" node whenVictor Stinner-6/+3
compiling AST from Python objects.
2015-10-07One more typo in a commentMartin Panter-1/+1
2015-09-25merge 3.5 (#25131)Benjamin Peterson-4/+10
2015-09-25make opening brace of container literals and comprehensions correspond to ↵Benjamin Peterson-4/+10
the line number and col offset of the AST node (closes #25131)
2015-09-24Fixed error creation if the problem is an empty expression in an f-string: ↵Eric V. Smith-6/+5
use ast_error instead of PyErr_SetString.
2015-09-23Move f-string compilation of the expression earlier, before the conversion ↵Eric V. Smith-15/+51
character and format_spec are checked. This allows for error messages that more closely match what a user would expect.
2015-09-21Issue #24779: Remove unused rawmode parameter to unicode_decode.Eric V. Smith-6/+3
2015-09-19Issue #24965: Implement PEP 498 "Literal String Interpolation". ↵Eric V. Smith-56/+929
Documentation is still needed, I'll open an issue for that.
2015-09-03Fix ast_for_atom()Victor Stinner-0/+1
Clear PyObject_Str() exception if it failed, ast_error() should not be called with an exception set.
2015-09-02Merge 3.5 (issue #24975)Yury Selivanov-2/+4
2015-09-01Issue #24975: Fix AST compilation for PEP 448 syntax.Yury Selivanov-2/+4
2015-08-21Fix a trivial typo.Eric V. Smith-1/+1
2015-08-12Issue #9232: Support trailing commas in function declarations.Robert Collins-9/+14
For example, "def f(*, a = 3,): pass" is now legal. Patch from Mark Dickinson.
2015-08-05Issue #24791: Fix grammar regression for call syntax: 'g(*a or b)'.Yury Selivanov-33/+32