Crates.io | yul |
lib.rs | yul |
version | 0.1.1 |
source | src |
created_at | 2022-05-21 14:44:55.147811 |
updated_at | 2022-05-22 14:53:40.649495 |
description | Yul language tools |
homepage | https://github.com/recmo/yul |
repository | https://github.com/recmo/yul |
max_upload_size | |
id | 590750 |
size | 30,074 |
The parser uses [Logos][https://docs.rs/logos/latest/logos] for tokenization and [Rowan][https://docs.rs/rowan/latest/rowan] for a parsing. The tokens (aka lexer) are defined in the [token.rs][./src/tokens.rs] and the syntax (aka grammar) is defined in [syntax.rs][./src/syntax.rs].
The architecture is based on that of rust-analyzer. In fact, rowan
is part of the rust-analyzer project. I recommend reading their write-up to understand rowan
. Another great introduction is this tutorial by Luna Razzaghipour.
Specifically the architecture is for lossless parsing with good error recovery. This means that the original source file can always be perfectly reconstructed from the parse tree, even if it has errors. Comments, whitespace and parse errors are explicitly included in the parse tree.
Format, lint, build and test everything (I recommend creating a shell alias for this):
cargo fmt &&\
cargo clippy --all-features --all-targets &&\
cargo test --workspace --all-features --doc -- --nocapture &&\
cargo test --workspace --all-features --all-targets -- --nocapture &&\
cargo doc --workspace --all-features --no-deps
Run benchmarks with the provided .cargo/config.toml
alias
cargo criterion
Check documentation coverage
RUSTDOCFLAGS="-Z unstable-options --show-coverage" cargo doc --workspace --all-features --no-deps
Goals:
Maybe:
solc
frontend for Solidity compatibility.