RustPython / Parser

MIT License
77 stars 29 forks source link

Add trait Parse and Parse::parse to use with each types. #32

Closed youknowone closed 1 year ago

youknowone commented 1 year ago

With code

let parsed = parse(code, path, Mode::Exec)

The result parsed is always ast::ModModule. But it currently returns ast::Mod::Module.

suggestion:

let parsed = ast::ModModule::parse(code, path)

previous parse_* functions can remains for CPython friendly API