| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
| |
it a Sum.
|
|
|
|
| |
compile() when compiling an AST node.
|
| |
|
|
|
|
|
| |
allow compiling Python AST objects into code objects
in compile().
|
|
|
|
|
|
| |
Rather than sprinkle casts throughout the code, change Py_CHARMASK to
always cast it's result to an unsigned char. This should ensure we
do the right thing when accessing an array with the result.
|
| |
|
|
|
|
| |
The new PyParser_*Ex() functions are based on Neal's suggestion and initial patch. The new __future__ feature makes all '' and r'' unicode strings. b'' and br'' stay (byte) strings.
|
|
|
|
| |
EOL 80 limit and supply more alternatives in warning messages.
|
|
|
|
|
|
|
|
| |
This work is substantially Anthony Baxter's, from issue
1633807. I just freshened it, made a few minor tweaks,
and added the test cases. I also created issue 2412,
which is to check for 2to3's behavior with the print
function. I also added myself to ACKS.
|
|
|
|
|
|
|
|
| |
Added 0b and 0o literals to tokenizer.
Modified PyOS_strtoul to support 0b and 0o inputs.
Modified PyLong_FromString to support guessing 0b and 0o inputs.
Renamed test_hexoct.py to test_int_literal.py and added binary tests.
Added upper and lower case 0b, 0O, and 0X tests to test_int_literal.py
|
| |
|
|
|
|
| |
with some help from Georg
|
|
|
|
|
|
| |
a test for this (and because of this test you'll see in stderr a
message that parser.c sends before raising MemoryError).
Thanks Ralf Schmitt.
|
| |
|
|
|
|
| |
several extension methods and modules do not work without unicode support.
|
| |
|
|
|
|
| |
second line of code were not always recognized correctly.
|
|
|
|
|
| |
Fixes the tokenizer, tokenize.py and int() to reject this.
Patches by Malte Helmert.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Event alloc_fn: Called allocation function "metacompile" [model]
Event var_assign: Assigned variable "gr" to storage returned from "metacompile"
gr = metacompile(n);
Event pass_arg: Variable "gr" not freed or pointed-to in function "maketables" [model]
g = maketables(gr);
translatelabels(g);
addfirstsets(g);
Event leaked_storage: Returned without freeing storage "gr"
return g;
|
| |
|
| |
|
|
|
|
| |
is set.
|
|
|
|
|
|
| |
reported correctly.
Backquotes still don't report the correct file. The AST nodes only contain the line number but not the file name.
|
|
|
|
| |
The patches are adding deprecation warnings for back ticks and <>
|
|
|
|
| |
per discussion in issue 1031213.
|
|
|
|
| |
Also fix a memory leak.
|
|
|
|
| |
source encoding. Will backport to 2.5.
|
|
|
|
|
|
| |
* use %r instead of backticks since backticks are going away in Py3k
* PyArena_Malloc() already sets PyErr_NoMemory so we don't need to do it again
* the signature for ast2obj_int incorrectly used a bool, rather than a long
|
|
|
|
|
|
| |
is specified at the top of the file. Also add a note that Python/Python-ast.c
needs to be committed separately after a change to the AST grammar to capture
the revision number of the change (which is what __version__ is set to).
|
|
|
|
| |
definition.
|
|
|
|
| |
Will backport.
|
| |
|
|
|
|
|
| |
not being recognized as a keyword after, e.g., this statement:
from __future__ import division, with_statement
|
| |
|
|
|
|
| |
Klocwork 281
|
|
|
|
|
|
| |
There might be something else that needs to be done to setup the error.
Klocwork #295.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Prevent an invalid memory read from test_coding in case the done flag is set.
In that case, the loop isn't entered. I wonder if rather than setting
the done flag in the cases before the loop, if they should just exit early.
This code looks like it should be refactored.
Backport candidate (also the early break above if decoding_fgets fails)
|
| |
|
| |
|
|
|
|
| |
independently. Fixes #1355883.
|
| |
|
|
|
|
|
| |
entirely happy with the two new VISIT macros in compile.c, but I
couldn't see a better approach.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mismatches. At least I hope this fixes them all.
This reverts part of my change from yesterday that converted everything
in Parser/*.c to use PyObject_* API. The encoding doesn't really need
to use PyMem_*, however, it uses new_string() which must return PyMem_*
for handling the result of PyOS_Readline() which returns PyMem_* memory.
If there were 2 versions of new_string() one that returned PyMem_*
for tokens and one that return PyObject_* for encodings that could
also fix this problem. I'm not sure which version would be clearer.
This seems to fix both Guido's and Phillip's problems, so it's good enough
for now. After this change, it would be good to review Parser/*.c
for consistent use of the 2 memory APIs.
|
|
|
|
| |
Explicitly cast void* to int to cmpop_ty.
|
|
|
|
|
|
|
| |
malloc/realloc type functions, as well as renaming one variable called 'new'
in tokensizer.c. Still lots more to be done, going to be checking in one
chunk at a time or the patch will be massively huge. Still compiles ok with
gcc.
|
|
|
|
|
|
| |
This was the result of inconsistent use of PyMem_* and PyObject_* allocators.
By changing to use PyObject_* allocator almost everywhere, this removes
the inconsistency.
|