Lunarity - a Solidity parser in Rust
Switch branches/tags
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ast Replacing the Lexer with Logos (#8) Nov 27, 2018
lexer Lookup tables (#10) Dec 3, 2018
lunarity Published 0.2.1 parser/lexer on crates.io Dec 4, 2018
parser Published 0.2.1 parser/lexer on crates.io Dec 4, 2018
.gitignore added TypeBytes for solidity bytes Oct 11, 2018
.travis.yml Enable Travis Dec 5, 2017
Cargo.toml split lunarity to packages Oct 11, 2018
LICENSE
README.md Relicense to GPLv3 Jun 14, 2018

README.md

Lunarity

A high performance, correctness-oriented Solidity parser + other tools.

The produced AST is mostly grammar.txt compliant. The AST is statically typed to make sure that it is not possible to construct an AST representation of what would be illegal grammar.

Performance

It's really fast.

Running target/release/deps/second_price_auction-2b369ce54b97fb9f

running 2 tests
test parse_to_ast ... bench:      24,028 ns/iter (+/- 573) = 562 MB/s
test tokenize     ... bench:      15,037 ns/iter (+/- 1,405) = 898 MB/s

Neither the lexer nor the parser ever backtrack while reading bytes/tokens. The parser is using a paginated arena allocator to avoid heap allocation costs (or garbage collection costs, or anything else).

Feel free to rerun the benchmarks (requires nightly Rust, with rustup: rustup run nightly cargo bench)

License

This crate is distributed under the terms of GNU GENERAL PUBLIC LICENSE version 3.0.

See LICENSE for details.