Tracking: Use Solar for Solidity AST
Component
Other (please describe)
Describe the feature you would like
Replace solang-parser and solc AST usage with Solar.
Part 1 of the migration to Solar. See the blog post for more details.
Solang usage:
- [ ] Chisel
- [x] Syntax highlighting using lexer (https://github.com/foundry-rs/foundry/blob/3b2e99973badc1d1597e37ae37dceb398fef4f8f/crates/chisel/src/solidity_helper.rs)
- [ ] Type introspection; requires type-checking in Solar
- [ ] Forge
- [x] Inline config parser (https://github.com/foundry-rs/foundry/blob/3b2e99973badc1d1597e37ae37dceb398fef4f8f/crates/config/src/inline/natspec.rs)
- [ ] doc (https://github.com/foundry-rs/foundry/blob/3b2e99973badc1d1597e37ae37dceb398fef4f8f/crates/doc)
- [x] EVM traces - finding contract definitions (https://github.com/foundry-rs/foundry/blob/3b2e99973badc1d1597e37ae37dceb398fef4f8f/crates/evm/traces/src/debug/sources.rs)
- [ ] fmt (https://github.com/foundry-rs/foundry/blob/3b2e99973badc1d1597e37ae37dceb398fef4f8f/crates/fmt)
- [x] bind-json (https://github.com/foundry-rs/foundry/blob/3b2e99973badc1d1597e37ae37dceb398fef4f8f/crates/forge/bin/cmd/bind_json.rs)
- [x] geiger (https://github.com/foundry-rs/foundry/blob/3b2e99973badc1d1597e37ae37dceb398fef4f8f/crates/forge/bin/cmd/geiger)
Solc AST usage:
- [x] forge bind-json
- [ ] forge coverage
- [x] forge eip712
- [ ] forge flatten (in foundry-compilers)
Additional context
No response
Hey @DaniPopes! When do you plan to do the refactor for fmt? Otherwise do you think that this could be a first good issue?
Note that fmt stills breaks with the transient keyword (see #9088).
Hi @MathisGD, it is currently part of our 1.1 milestone and in focus - fmt is quite large / complex unfortunately, I wouldn't consider it a good first issue. In the meantime I'm still trying to get solang to support the transient keyword to unblock this for our users, see: https://github.com/hyperledger-solang/solang/issues/1670#issuecomment-2694596377. An additional comment underscoring this is a blocker for you may help.
cc @grandizzy