Yury Selivanov
8085b80c18
Issue 24226: Fix parsing of many sequential one-line 'def' statements.
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
Benjamin Peterson
d73aca769f
do not call into python api if an exception is set ( #24022 )
11 years ago
Serhiy Storchaka
45ec3288d0
Removed trailing whitespaces in miscalenous files.
11 years ago
Serhiy Storchaka
a8cd4d482f
Got rid of warnings "suggest braces around empty body in an ‘else’ statement"
in Parser/pgen.c.
11 years ago
Raymond Hettinger
df1b699447
Issue #22823 : Use set literals instead of creating a set from a list
11 years ago
Serhiy Storchaka
67c719b34b
Silenced some warnings about comparison between signed and unsigned integer
expressions.
11 years ago
Guido van Rossum
416b516d46
Fix bootstrapping asdl -- it didn't work with Python 2.7.
12 years ago
Benjamin Peterson
c416162302
allow the keyword else immediately after (no space) an integer ( closes #21642 )
12 years ago
Eli Bendersky
5e3d338a74
Issue #19655 : Replace the ASDL parser carried with CPython
The new parser does not rely on Spark (which is now removed from our repo),
uses modern 3.x idioms and is significantly smaller and simpler.
It generates exactly the same AST files (.h and .c), so in practice no builds
should be affected.
12 years ago
Benjamin Peterson
d51374ed78
PEP 465: a dedicated infix operator for matrix multiplication ( closes #21176 )
12 years ago
Martin v. Löwis
815b41b1cd
Issue #20731 : Properly position in source code files even if they
are opened in text mode. Patch by Serhiy Storchaka.
12 years ago
Benjamin Peterson
c2f665e721
don't put runtime values in array initializer for C89 compliance ( closes #20588 )
12 years ago
Serhiy Storchaka
1064a13bb0
Do not reset the line number because we already set file position to correct
value.
(fixes error in patch for issue #18960 )
12 years ago
Serhiy Storchaka
768c16ce02
Issue #18960 : Fix bugs with Python source code encoding in the second line.
* The first line of Python script could be executed twice when the source
encoding (not equal to 'utf-8') was specified on the second line.
* Now the source encoding declaration on the second line isn't effective if
the first line contains anything except a comment.
* As a consequence, 'python -x' works now again with files with the source
encoding declarations specified on the second file, and can be used again
to make Python batch files on Windows.
* The tokenize module now ignore the source encoding declaration on the second
line if the first line contains anything except a comment.
* IDLE now ignores the source encoding declaration on the second line if the
first line contains anything except a comment.
* 2to3 and the findnocoding.py script now ignore the source encoding
declaration on the second line if the first line contains anything except
a comment.
12 years ago
Christian Heimes
af01f66817
Issue #16136 : Remove VMS support and VMS-related code
12 years ago
Christian Heimes
724b828e79
upcast int to size_t to silence two autological-constant-out-of-range-compare warnings with clang.
12 years ago
Victor Stinner
cad876d542
Fix a compiler warning on Windows 64-bit in parsetok.c
Python parser doesn't support lines longer than INT_MAX bytes yet
12 years ago
Victor Stinner
3a8a333942
Fix compiler warnings on Windows 64-bit in grammar.c
INT_MAX states and labels should be enough for everyone
12 years ago
Serhiy Storchaka
c679227e31
Issue #1772673 : The type of `char*` arguments now changed to `const char*`.
12 years ago
Victor Stinner
c548660af5
Issue #16742 : My fix on PyOS_StdioReadline() was incomplete, PyMem_FREE() was
not patched
12 years ago
Antoine Pitrou
d01d396e7f
Issue #4555 : All exported C symbols are now prefixed with either "Py" or "_Py".
("make smelly" now clean)
12 years ago
Victor Stinner
2fe9bac4dc
Close #16742 : Fix misuse of memory allocations in PyOS_Readline()
The GIL must be held to call PyMem_Malloc(), whereas PyOS_Readline() releases
the GIL to read input.
The result of the C callback PyOS_ReadlineFunctionPointer must now be a string
allocated by PyMem_RawMalloc() or PyMem_RawRealloc() (or NULL if an error
occurred), instead of a string allocated by PyMem_Malloc() or PyMem_Realloc().
Fixing this issue was required to setup a hook on PyMem_Malloc(), for example
using the tracemalloc module.
PyOS_Readline() copies the result of PyOS_ReadlineFunctionPointer() into a new
buffer allocated by PyMem_Malloc(). So the public API of PyOS_Readline() does
not change.
12 years ago
Eli Bendersky
1891cff587
Move open outside try/finally
12 years ago
Eli Bendersky
99081238e9
Don't use fancy new Python features like 'with' - some bots don't have them
and can't bootstrap the parser.
12 years ago
Eli Bendersky
58fe1b1307
Normalize whitespace
12 years ago
Eli Bendersky
b788a385cd
Small fixes in Parser/asdl.py - no change in functionality.
1. Make it work when invoked directly from the command-line. It was failing
due to a couple of stale function/class usages in the __main__ section.
2. Close the parsed file in the parse() function after opening it.
12 years ago
Victor Stinner
daf455554b
Issue #18571 : Implementation of the PEP 446: file descriptors and file handles
are now created non-inheritable; add functions os.get/set_inheritable(),
os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
13 years ago
Victor Stinner
14e461d5b9
Close #11619 : The parser and the import machinery do not encode Unicode
filenames anymore on Windows.
13 years ago
Ezio Melotti
7c4a7e6f3c
#18803 : fix more typos. Patch by Févry Thibault.
13 years ago
Antoine Pitrou
9ed5f27266
Issue #18722 : Remove uses of the "register" keyword in C code.
13 years ago
Christian Heimes
9ae513caa7
Issue #18368 : PyOS_StdioReadline() no longer leaks memory when realloc() fails.
13 years ago
Christian Heimes
5e4d372524
Silence warning about set but unused variable inside compile_atom() in non-debug builds
13 years ago
Christian Heimes
70c94e7896
Issue #18552 : Check return value of PyArena_AddPyObject() in obj2ast_object().
13 years ago
Victor Stinner
1acc129d48
Parser/asdl_c.py: use Py_CLEAR()
13 years ago
Victor Stinner
ce72e1ce6c
According to the PEP 7, C code must "use 4-space indents"
Replace 8 spaces with 4.
13 years ago
Christian Heimes
1eb0cb12ac
Some compilers complain about 'control reaches end of non-void function'
because they don't understand that Py_FatalError() terminates the program.
13 years ago
Christian Heimes
53d2dc4045
Add sanity check to PyGrammar_LabelRepr() in order to catch invalid tokens when debugging
a new grammar.
CID 715360
13 years ago
Victor Stinner
bdf630c4a7
Issue #18408 : Fix Python-ast.c: handle init_types() failure (ex: MemoryError)
13 years ago
Benjamin Peterson
265fba40c8
move declaration to top of block
13 years ago
Benjamin Peterson
2dbfd88245
check the return value of new_string() ( closes #18470 )
13 years ago
Victor Stinner
526daabf34
Issue #18408 : parsetok() must not write into stderr on memory allocation error
The caller gets an error code and can raise a classic Python exception.
13 years ago
Victor Stinner
3bf5f530d9
Issue #18408 : parsetok() must not write into stderr on memory allocation error
The caller gets an error code and can raise a classic Python exception.
13 years ago
Christian Heimes
22ed7fe906
Fix resource leak in parser, free node ptr
CID 1028068 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable n going out of scope leaks the storage it points to.
13 years ago
Serhiy Storchaka
3af14aaba5
Issue #18038 : SyntaxError raised during compilation sources with illegal
encoding now always contains an encoding name.
13 years ago
Victor Stinner
796977360f
Issue #9566 : Fix compiler warning on Windows 64-bit
13 years ago
Benjamin Peterson
8d89c2aaba
change AST codegen to use PyModule_AddIntMacro
13 years ago
Benjamin Peterson
7654ab9ef0
placate msvc
13 years ago
Benjamin Peterson
b72406b8fa
refactor to fix refleaks
13 years ago