Christian Heimes
c6cc23d0b9
Skip unused value in tokenizer code
In the case of an escape character, c is never read. tok_next() is
used to advance the pointer.
CID 1225097
9 years ago
Serhiy Storchaka
48842714b9
Issue #22570 : Renamed Py_SETREF to Py_XSETREF.
10 years ago
Benjamin Peterson
7285d520e0
remove duplicated check for fractions and complex numbers ( closes #26076 )
Patch by Oren Milman.
10 years ago
Serhiy Storchaka
e431d3c9aa
Issue #26581 : Use the first coding cookie on a line, not the last one.
10 years ago
Serhiy Storchaka
ef1585eb9a
Issue #25923 : Added more const qualifiers to signatures of static and private functions.
10 years ago
Serhiy Storchaka
5a57ade58e
Issue #20440 : Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
10 years ago
Serhiy Storchaka
0d441119f5
Issue #25388 : Fixed tokenizer crash when processing undecodable source code
with a null byte.
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
Eric V. Smith
6408dc82fa
Fixed indentation.
10 years ago
Yury Selivanov
96ec934e75
Issue #24619 : Simplify async/await tokenization.
This commit simplifies async/await tokenization in tokenizer.c,
tokenize.py & lib2to3/tokenize.py. Previous solution was to keep
a stack of async-def & def blocks, whereas the new approach is just
to remember position of the outermost async-def block.
This change won't bring any parsing performance improvements, but
it makes the code much easier to read and validate.
11 years ago
Yury Selivanov
8fb307cd65
Issue #24619 : New approach for tokenizing async/await.
This commit fixes how one-line async-defs and defs are tracked
by tokenizer. It allows to correctly parse invalid code such
as:
>>> async def f():
... def g(): pass
... async = 10
and valid code such as:
>>> async def f():
... async def g(): pass
... await z
As a consequence, is is now possible to have one-line
'async def foo(): await ..' functions:
>>> async def foo(): return await bar()
11 years ago
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
d73aca769f
do not call into python api if an exception is set ( #24022 )
11 years ago
Benjamin Peterson
c416162302
allow the keyword else immediately after (no space) an integer ( closes #21642 )
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
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
Serhiy Storchaka
c679227e31
Issue #1772673 : The type of `char*` arguments now changed to `const char*`.
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
Antoine Pitrou
9ed5f27266
Issue #18722 : Remove uses of the "register" keyword in C code.
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
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
d0845588b8
make _PyParser_TokenNames const
13 years ago
Christian Heimes
0b3847de6d
Issue #15096 : Drop support for the ur string prefix
14 years ago
Armin Ronacher
6ecf77b3f8
Basic support for PEP 414 without docs or tests.
14 years ago
Antoine Pitrou
3a5d4cb940
Issue #13748 : Raw bytes literals can now be written with the `rb` prefix as well as `br`.
14 years ago
Martin v. Löwis
bd928fef42
Rename _Py_identifier to _Py_IDENTIFIER.
14 years ago
Martin v. Löwis
1ee1b6fe0d
Use identifier API for PyObject_GetAttrString.
14 years ago
Martin v. Löwis
afe55bba33
Add API for static strings, primarily good for identifiers.
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
14 years ago
Martin v. Löwis
d63a3b8beb
Implement PEP 393.
14 years ago
Jesus Cea
c1935d2abf
Revert bb62908896fe, but keep the test
15 years ago
Victor Stinner
c68b6aaec8
Issue #9319 : Fix a crash on parsing a Python source code without encoding
cookie and not valid in UTF-8: use "<file>" as the filename instead of
reading from NULL.
15 years ago
Victor Stinner
fe7c5b5bdf
Issue #9319 : Include the filename in "Non-UTF8 code ..." syntax error.
15 years ago
Victor Stinner
7f2fee3640
Issue #10785 : Store the filename as Unicode in the Python parser.
15 years ago
Victor Stinner
034c7537d8
Issue #10841 : don't translate newlines for pgen
15 years ago
Victor Stinner
89e3436606
Issue #10841 : set binary mode on files; the parser translates newlines
On Windows, set the binary mode on stdin, stdout, stderr and all
io.FileIO objects (to not translate newlines, \r\n <=> \n). The Python parser
translates newlines (\r\n => \n).
15 years ago
Victor Stinner
aaa4e9a438
Remove arbitrary string length limits
PyUnicode_FromFormat() and PyErr_Format() allocates a buffer of the needed
size, it is no more a fixed-buffer of 500 bytes.
15 years ago
Victor Stinner
83098a4095
Issue #10778 : decoding_fgets() decodes the filename from the filesystem
encoding instead of UTF-8.
15 years ago
Victor Stinner
22a351aabf
Issue #10095 : fp_setreadl() doesn't reopen the file, reuse instead the file
descriptor.
15 years ago
Stefan Krah
3db4161011
Issue #9020 : The Py_IS* macros from pyctype.h should generally only be
used with signed/unsigned char arguments. For integer arguments, EOF
has to be handled separately.
16 years ago
Antoine Pitrou
7f14f0d8a0
Recorded merge of revisions 81032 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
Untabify C files. Will watch buildbots.
........
................
16 years ago
Antoine Pitrou
f95a1b3c53
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
Untabify C files. Will watch buildbots.
........
16 years ago
Antoine Pitrou
c7c96a90bc
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
Untabify C files. Will watch buildbots.
........
16 years ago
Antoine Pitrou
c83ea137d7
Untabify C files. Will watch buildbots.
16 years ago
Victor Stinner
003a5e702b
Use PyErr_Format() in decoding_fgets()
Avoid a buffer of 500 bytes allocated on the stack.
16 years ago
Benjamin Peterson
4893abc77a
Merged revisions 79725 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79725 | benjamin.peterson | 2010-04-03 18:03:35 -0500 (Sat, 03 Apr 2010) | 4 lines
use our own locale independent ctype macros
requires building pyctype.o into pgen
........
16 years ago