8
Guido 写的新 Parser 真的很好用
source link: https://www.v2ex.com/t/798188
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
之前我搞了个 Python 超集,用的方式是字符串替换,很垃圾。然后我复习了一下编译原理,用 Guido 为 Python3.9 之后的版本写的 Parser 整了个新版本。
几乎没有额外的代码,只需要修改一下 gram 文件,就可以增加新的语法编译到 Python AST 对象。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK