Skip to content

Commit 7899ddc

Browse files
committed
Improved module exporting and not panicing anymore
1 parent 5e4ef1d commit 7899ddc

File tree

6 files changed

+464
-456
lines changed

6 files changed

+464
-456
lines changed

crates/solidity-v2/outputs/cargo/parser/src/lexer/definition.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,12 @@ impl Lexer<'_> {
131131
}
132132
}
133133

134-
pub type Spanned<Tok, Loc, Error> = Result<(Loc, Tok, Loc), Error>;
135-
136134
/// Iterate over the lexemes and their offsets
137135
///
138136
/// TODO(v2): This iterator skips all trivia, we'll want to include it in
139137
/// future versions
140138
impl Iterator for Lexer<'_> {
141-
type Item = Spanned<LexemeKind, usize, ()>;
139+
type Item = Result<(usize, LexemeKind, usize), ()>;
142140

143141
fn next(&mut self) -> Option<Self::Item> {
144142
while let Some(lexeme) = self.next_lexeme() {
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#[path = "contexts.generated.rs"]
2-
pub(crate) mod contexts;
3-
pub(crate) mod definition;
2+
mod contexts;
3+
mod definition;
44
#[path = "lexemes.generated.rs"]
5-
pub(crate) mod lexemes;
5+
mod lexemes;
66

77
#[cfg(test)]
88
mod tests;
99

1010
pub mod temp_sourcify;
11+
12+
pub(crate) use contexts::ContextKind;
13+
pub(crate) use definition::Lexer;
14+
pub(crate) use lexemes::LexemeKind;

0 commit comments

Comments
 (0)