mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-05-06 09:17:55 +00:00
426f673b0a
Signed-off-by: xermicus <cyrill@parity.io>
19 lines
508 B
Rust
19 lines
508 B
Rust
//! The YUL code block.
|
|
|
|
pub mod error;
|
|
pub mod identifier;
|
|
pub mod statement;
|
|
pub mod r#type;
|
|
|
|
use crate::yul::lexer::error::Error as LexerError;
|
|
use crate::yul::lexer::token::Token;
|
|
use crate::yul::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(),
|
|
}
|
|
}
|