scrabsha / expandable Goto Github PK
View Code? Open in Web Editor NEWWhat if we could check declarative macros before using them?
License: MIT License
What if we could check declarative macros before using them?
License: MIT License
expandable
works quite well, but it only supports a very reduced subset of Rust.
In order to make it complete, we have to write a state machine that accepts every syntactically valid Rust code (and nothing more!). This is currently done thanks to a 260 line-long invocation of the generate_grammar
macro. This is very painful to understand and update properly. It certainly won't scale to the whole Rust grammar.
The other solution is to write a parser for Rust in a dsl that is then turned into a state machine by a custom compiler, and replace the generate_grammar
stuff with this shiny state machine. This means more code to maintain, document and test, but this would make future development so much easier that it's worth it.
Here are the different steps we will follow:
rustc_parse
or even syn
.generate_grammar
state machine, use the generated state machine instead.||
operator in grammar_gen
grammar.rs
weird_exprs.rs
may be a challenging one :DIt could be interesting to benchmark the parser, but I don't consider it an important item.
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.