A Python parser for Rust libraries and programs.
Currently supports Python 3.8's syntax (except type comments, which are ignored like regular comments)
A Python parser written in Rust using nom
Home Page: https://docs.rs/python-parser
License: GNU General Public License v3.0
Are there any plans to support newer features in Python?
In particular, I see that the parser will panic when it tries to read a type annotation like:
foo: int
foo = 22
Currently they are just parsed as regular strings with a prefix
Trying to parse some code and found a problem that seems to be caused with two consecutive if
statements.
Input:
if True:
pass
if True:
pass
Causes a panic when parsing the second statement.
Starting with python 3.8, type comments are parsed by cpython's parser. We might want to support them.
But that's a lot of work, so I'm not sure it's worth it
Currently, the pretty-printer handles f-string like regular strings, which means it may output this: f"foo {d[\"bar\"]} baz"
, which is invalid syntax, as backslashes are not allowed between curly brackets
The parser is a little too greedy currently...
Input that fails:
if_foo = 3
print(if_foo)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.