Remove asdl (#21)

This removes the ASDL code generation in favor of handwriting the AST. 

The motivations for moving away from the ASDL are:

* CPython compatibility is no longer a goal
* The ASDL grammar isn't as expressive as we would like
* The codegen scripts have a high complexity which makes extensions time
consuming
* We don't make heavy use of code generation (compared to e.g.
RustPython that generates Pyo3 bindings, a fold implementation etc).

We may want to revisit a grammar based code generation in the future,
e.g. by using [ungrammar](https://github.com/rust-analyzer/ungrammar)
This commit is contained in:
konsti
2023-07-05 14:25:26 +02:00
committed by GitHub
parent 0f2e295f3a
commit 2d1f69cbb9
12 changed files with 3641 additions and 5003 deletions

View File

@@ -1,3 +1,2 @@
#!/bin/bash
cspell "ast/**/*.rs" "literal/**/*.rs" "core/**/*.rs" "parser/**/*.rs"
cspell ast/asdl_rs.py

View File

@@ -1,8 +0,0 @@
#!/bin/bash
set -e
cd "$(dirname "$(dirname "$0")")"
# rm ast/src/gen/*.rs
python ast/asdl_rs.py --ast-dir ast/src/gen/ --parser-dir parser/src/gen/ ast/Python.asdl
rustfmt ast/src/gen/*.rs parser/src/gen/*.rs