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
Benjamin Peterson
202803a0c0
c_encoding can never be NULL, which allows some code simplification
10 years ago
Victor Stinner
be59d1489b
Issue #26146 : enhance ast.Constant error message
Mention the name of the invalid type in error message of AST validation for
constants.
Suggestion made by Joseph Jevnik on a review.
10 years ago
Victor Stinner
726f6902ce
Fix a refleak in validate_constant()
Issue #26146 .
10 years ago
Victor Stinner
f2c1aa1661
Add ast.Constant
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
10 years ago
Georg Brandl
5c60ea3fa1
Fix two instances of wrong indentation.
10 years ago
Serhiy Storchaka
2d06e84455
Issue #25923 : Added the const qualifier to static constant arrays.
10 years ago
Victor Stinner
f9827ea618
Issue #25555 : Fix parser and AST: fill lineno and col_offset of "arg" node when
compiling AST from Python objects.
10 years ago
Victor Stinner
c106c68aeb
Issue #25555 : Fix parser and AST: fill lineno and col_offset of "arg" node when
compiling AST from Python objects.
10 years ago
Martin Panter
c2432f6edb
One more typo in a comment
10 years ago
Benjamin Peterson
58b53953f8
make opening brace of container literals and comprehensions correspond to the line number and col offset of the AST node ( closes #25131 )
10 years ago
Eric V. Smith
1e5fcc3dea
Fixed error creation if the problem is an empty expression in an f-string: use ast_error instead of PyErr_SetString.
10 years ago
Eric V. Smith
1d44c41b0c
Move f-string compilation of the expression earlier, before the conversion character and format_spec are checked. This allows for error messages that more closely match what a user would expect.
10 years ago
Eric V. Smith
5567f89c6f
Issue #24779 : Remove unused rawmode parameter to unicode_decode.
10 years ago
Eric V. Smith
235a6f0984
Issue #24965 : Implement PEP 498 "Literal String Interpolation". Documentation is still needed, I'll open an issue for that.
10 years ago
Victor Stinner
00723e0353
Fix ast_for_atom()
Clear PyObject_Str() exception if it failed, ast_error() should not be called
with an exception set.
10 years ago
Yury Selivanov
b3d531348c
Issue #24975 : Fix AST compilation for PEP 448 syntax.
10 years ago
Eric V. Smith
163b5c668d
Fix a trivial typo.
11 years ago
Robert Collins
df395991f6
Issue #9232 : Support trailing commas in function declarations.
For example, "def f(*, a = 3,): pass" is now legal.
Patch from Mark Dickinson.
11 years ago
Yury Selivanov
14acf5f41d
Issue #24791 : Fix grammar regression for call syntax: 'g(*a or b)'.
11 years ago
Yury Selivanov
7544508f02
PEP 0492 -- Coroutines with async and await syntax. Issue #24017 .
11 years ago
Benjamin Peterson
025e9ebd0a
PEP 448: additional unpacking generalizations ( closes #2292 )
Patch by Neil Girdhar.
11 years ago
Victor Stinner
0c39b1b970
Initialize variables to prevent GCC warnings
11 years ago
Benjamin Peterson
7a66fc22ad
revert lineno and col_offset changes from #16795 ( closes #21295 )
11 years ago
Benjamin Peterson
d51374ed78
PEP 465: a dedicated infix operator for matrix multiplication ( closes #21176 )
12 years ago