mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-05-09 08:18:05 +00:00
resolc crate (#328)
- Factor the YUL crate out of `revive-solidity`. - `revive-solidity` is in reality not a Solidity implementation but the revive solidity compiler driver (`resolc`). By renaming we not only get this straight but also a binary with the same name as the crate which should be less confusing. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
//! The YUL code block.
|
||||
|
||||
pub mod error;
|
||||
pub mod identifier;
|
||||
pub mod statement;
|
||||
pub mod r#type;
|
||||
|
||||
use crate::lexer::error::Error as LexerError;
|
||||
use crate::lexer::token::Token;
|
||||
use crate::lexer::Lexer;
|
||||
|
||||
/// Returns the `token` value if it is `Some(_)`, otherwise takes the next token from the `stream`.
|
||||
pub fn take_or_next(mut token: Option<Token>, lexer: &mut Lexer) -> Result<Token, LexerError> {
|
||||
match token.take() {
|
||||
Some(token) => Ok(token),
|
||||
None => lexer.next(),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user