cpython/Parser
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
2016-01-26 00:40:57 +01:00
..
acceler.c
asdl.py Add ast.Constant 2016-01-26 00:40:57 +01:00
asdl_c.py Add ast.Constant 2016-01-26 00:40:57 +01:00
bitset.c
firstsets.c
grammar.c
grammar1.c
listnode.c
metagrammar.c
myreadline.c
node.c Silenced some warnings about comparison between signed and unsigned integer 2014-09-05 10:10:23 +03:00
parser.c
parser.h
parsetok.c Issue #25923: Added the const qualifier to static constant arrays. 2015-12-25 19:53:18 +02:00
parsetok_pgen.c
pgen.c Issue #25923: Added more const qualifiers to signatures of static and private functions. 2015-12-25 20:01:53 +02:00
pgenmain.c Issue #25923: Added more const qualifiers to signatures of static and private functions. 2015-12-25 20:01:53 +02:00
printgrammar.c Silenced some warnings about comparison between signed and unsigned integer 2014-09-05 10:10:23 +03:00
Python.asdl Add ast.Constant 2016-01-26 00:40:57 +01:00
tokenizer.c Issue #25923: Added more const qualifiers to signatures of static and private functions. 2015-12-25 20:01:53 +02:00
tokenizer.h Issue #24619: Simplify async/await tokenization. 2015-07-23 15:01:58 +03:00
tokenizer_pgen.c