Serhiy Storchaka
3f22811fef
bpo-32892: Use ast.Constant instead of specific constant AST types. (GH-9445)
7 years ago
Ammar Askar
025eb98dc0
bpo-34683: Make SyntaxError column offsets consistently 1-indexed (gh-9338)
Also point to start of tokens in parsing errors.
Fixes bpo-34683
7 years ago
Benjamin Peterson
c9a71dd223
closes bpo-34641: Further restrict the LHS of keyword argument function call syntax. (GH-9212)
7 years ago
Benjamin Peterson
d13e59c1b5
Make sure the line comes from the same node as the col offset. (GH-9189)
Followup to 90fc8980bb .
<!--
Thanks for your contribution!
Please read this comment in its entirety. It's quite important.
# 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.
# 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`.
-->
7 years ago
guoci
90fc8980bb
closes bpo-31902: Fix the col_offset attribute for ast.Async* nodes to point to the "async" keyword. (GH-4175)
Previously, col_offset points to the keyword after "async".
7 years ago
Alexey Izbyshev
28853a249b
bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (GH-8852)
Reported by Svace static analyzer.
7 years ago
Serhiy Storchaka
143ce5c6db
bpo-33691: Add _PyAST_GetDocString(). (GH-7236)
8 years ago
Serhiy Storchaka
73cbe7a01a
bpo-32911: Revert bpo-29463. (GH-7121) (GH-7197)
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>
8 years ago
Jelle Zijlstra
898ff92dac
fix error message in ast.c ( #6776 )
small_stmt -> compound_stmt
8 years ago
Victor Stinner
fb7e7992be
bpo-30465: Fix C downcast warning on Windows in ast.c ( #6593 )
ast.c: fstring_fix_node_location() downcasts a pointer difference to
a C int. Replace int with Py_ssize_t to fix the compiler warning.
8 years ago
Serhiy Storchaka
a561862048
Don't hide unexpected errors in PyErr_WarnExplicitObject(). ( #4585 )
8 years ago
Serhiy Storchaka
ddbce13786
bpo-32023: Disallow genexprs without parenthesis in class definitions. ( #4400 )
8 years ago
Serhiy Storchaka
9165f77d5f
bpo-32012: Disallow trailing comma after genexpr without parenthesis. ( #4382 )
8 years ago
luzpaz
a5293b4ff2
Fix miscellaneous typos ( #4275 )
8 years ago
Serhiy Storchaka
56cb465cc9
bpo-31825: Fixed OverflowError in the 'unicode-escape' codec ( #4058 )
and in codecs.escape_decode() when decode an escaped non-ascii byte.
8 years ago
Jelle Zijlstra
ac317700ce
bpo-30406: Make async and await proper keywords ( #1669 )
Per PEP 492, 'async' and 'await' should become proper keywords in 3.7.
8 years ago
Oren Milman
7dc46d8cf5
bpo-31592: Fix an assertion failure in Python parser in case of a bad unicodedata.normalize(). ( #3767 )
8 years ago
Barry Warsaw
b2e5794870
bpo-31338 ( #3374 )
* 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.
8 years ago
Łukasz Langa
e7c566caf1
bpo-30465: Fix lineno and col_offset in fstring AST nodes ( #1800 )
For f-string ast nodes, fix the line and columns so that tools such as flake8 can identify them correctly.
8 years ago
Stefan Krah
f432a3234f
bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. ( #3157 )
8 years ago
ericvsmith
11e97f2f80
bpo-30682: Removed a too-strict assertion that failed for certain f-strings. ( #2232 )
This caused a segfault on eval("f'\\\n'") and eval("f'\\\r'") in debug build.
9 years ago
Serhiy Storchaka
2e9cd5825c
bpo-30529: Fix errors for invalid whitespaces in f-string subexpressions. ( #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.
9 years ago
Serhiy Storchaka
0cd7a3f196
bpo-29104: Fixed parsing backslashes in f-strings. ( #490 )
9 years ago
Serhiy Storchaka
fff9a31a91
bpo-29865: Use PyXXX_GET_SIZE macros rather than Py_SIZE for concrete types. ( #748 )
9 years ago
INADA Naoki
cb41b2766d
bpo-29463: Add docstring field to some AST nodes. ( #46 )
* 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
9 years ago
Serhiy Storchaka
5bb8b9134b
Issue #18896 : Python function can now have more than 255 parameters.
collections.namedtuple() now supports tuples with more than 255 elements.
9 years ago
Serhiy Storchaka
4cc30ae313
Issue #28739 : f-string expressions no longer accepted as docstrings and
by ast.literal_eval() even if they do not include subexpressions.
9 years ago
Serhiy Storchaka
214678e44b
Issue #12844 : More than 255 arguments can now be passed to a function.
9 years ago
Serhiy Storchaka
144f77a981
Issue #28715 : Added error checks for PyUnicode_AsUTF8().
9 years ago
Serhiy Storchaka
f4934ea77d
Issue #28701 : Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
9 years ago
Victor Stinner
f9cca365c7
Fix warn_invalid_escape_sequence()
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.
9 years ago
Yury Selivanov
1a9d687a49
Issue #26182 : Fix ia refleak in code that raises DeprecationWarning.
9 years ago
Eric V. Smith
9b88fdf4f0
Fixed issue #28633 : segfault when concatenating bytes literal and f-string.
9 years ago
Eric V. Smith
5646648678
Issue 28128: Print out better error/warning messages for invalid string escapes. Backport to 3.6.
9 years ago
Eric V. Smith
42454af094
Issue 28128: Print out better error/warning messages for invalid string escapes.
9 years ago
Benjamin Peterson
286987bbac
delete dead code
9 years ago
Yury Selivanov
8987c9d219
Issue #26182 : Raise DeprecationWarning for improper use of async/await keywords
9 years ago
Eric V. Smith
09835dcdbb
Make an f-string error message more exact and consistent.
9 years ago
Benjamin Peterson
4ba5c88a3f
just start with an int rather than casting
9 years ago
Eric V. Smith
451d0e38fc
Issue 27948: Allow backslashes in the literal string portion of f-strings, but not in the expressions. Also, require expressions to begin and end with literal curly braces.
9 years ago
Brett Cannon
a721abac29
Issue #26331 : Implement the parsing part of PEP 515.
Thanks to Georg Brandl for the patch.
9 years ago
Yury Selivanov
52c4e7cc84
Issue #28008 : Implement PEP 530 -- asynchronous comprehensions.
9 years ago
Yury Selivanov
f8cb8a16a3
Issue #27985 : Implement PEP 526 -- Syntax for Variable Annotations.
Patch by Ivan Levkivskyi.
9 years ago
Benjamin Peterson
2f8bfef158
replace PY_SIZE_MAX with SIZE_MAX
9 years ago
Eric V. Smith
6a4efce7a5
Closes issue 27921: Disallow backslashes anywhere in f-strings. This is a 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.
9 years ago
Martin Panter
69332c1a64
Fix spelling and grammar in documentation and code comments
10 years ago
Serhiy Storchaka
fbd1523525
Issue #27352 : Correct the validation of the ImportFrom AST node and simplify
the implementation of the IMPORT_NAME opcode.
10 years ago
Berker Peksag
094c9c921c
Issue #23275 : Allow () = iterable assignment syntax
Documentation updates by Martin Panter.
10 years ago
Benjamin Peterson
9d66d4af06
remove unused c_encoding struct member
10 years ago
Benjamin Peterson
768921cf33
rewrite parsestr() so it's comprehensible; remove dead code
10 years ago