Reputation: 473
Under the Grammar folder in Cpython there is a file Grammar which specifies the main grammar of the Python programming language. Does modifying this alter the main grammar of the programming language?
Upvotes: 3
Views: 792
Reputation: 280648
The Grammar file controls the grammar of the language, but just modifying that is only one step of the process of changing the grammar. Many other files work closely with the grammar and need to be changed as well, such as Parser/Python.asdl
, Python/ast.c
, and Python/compile.c
. The Python developer's guide has a checklist of files that will likely need changing for any Python grammar change.
Upvotes: 10