cpython/Parser
Andy Lester 384f3c536d
closes bpo-39721: Fix constness of members of tok_state struct. (GH-18600)
The function PyTokenizer_FromUTF8 from Parser/tokenizer.c had a comment:

    /* XXX: constify members. */

This patch addresses that.

In the tok_state struct:
    * end and start were non-const but could be made const
    * str and input were const but should have been non-const

Changes to support this include:
    * decode_str() now returns a char * since it is allocated.
    * PyTokenizer_FromString() and PyTokenizer_FromUTF8() each creates a
        new char * for an allocate string instead of reusing the input
        const char *.
    * PyTokenizer_Get() and tok_get() now take const char ** arguments.
    * Various local vars are const or non-const accordingly.

I was able to remove five casts that cast away constness.
2020-02-27 18:44:52 -08:00
..
pgen Allow pgen to produce a DOT format dump of the grammar (GH-18005) 2020-01-14 22:32:55 +00:00
Python.asdl bpo-37593: Swap the positions of posonlyargs and args in the constructor of ast.parameters nodes (GH-14778) 2019-07-14 16:32:18 -07:00
acceler.c fix warnings by adding more const (GH-12924) 2019-04-23 20:39:37 +09:00
asdl.py Add ast.Constant 2016-01-26 00:40:57 +01:00
asdl_c.py bpo-38823: Fix refleaks in _ast initialization error path (GH-17276) 2020-02-06 15:45:46 +01:00
grammar1.c fix warnings by adding more const (GH-12924) 2019-04-23 20:39:37 +09:00
listnode.c bpo-36876: Moved Parser/listnode.c statics to interpreter state. (GH-16328) 2019-11-07 10:08:58 +00:00
myreadline.c bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. (GH-11015) 2018-12-07 12:11:30 +02:00
node.c bpo-33416: Add end positions to Python AST (GH-11605) 2019-01-22 11:18:22 +00:00
parser.c fix warnings by adding more const (GH-12924) 2019-04-23 20:39:37 +09:00
parser.h fix warnings by adding more const (GH-12924) 2019-04-23 20:39:37 +09:00
parsetok.c closes bpo-39721: Fix constness of members of tok_state struct. (GH-18600) 2020-02-27 18:44:52 -08:00
token.c bpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086) 2019-03-07 12:38:08 -08:00
tokenizer.c closes bpo-39721: Fix constness of members of tok_state struct. (GH-18600) 2020-02-27 18:44:52 -08:00
tokenizer.h closes bpo-39721: Fix constness of members of tok_state struct. (GH-18600) 2020-02-27 18:44:52 -08:00