diff options
| author | Tolmachev Igor <me@igorek.dev> | 2026-05-08 17:05:01 +0300 |
|---|---|---|
| committer | Tolmachev Igor <me@igorek.dev> | 2026-05-08 18:22:09 +0300 |
| commit | 323ddffe325a4bffec89447c75cc27a81315abc1 (patch) | |
| tree | 1391ea326e73a6bfff2f244cddb967593b382ee9 /compiler/src/lexer/tests.rs | |
| parent | 58b937521f3e459089c0d475551bf9a49f930657 (diff) | |
| download | crisp-323ddffe325a4bffec89447c75cc27a81315abc1.tar.gz crisp-323ddffe325a4bffec89447c75cc27a81315abc1.zip | |
Split Spanned<T> from Span and expose fields
Spanned<T> wraps a value with a Span.
Public fields enable destructuring in pattern matches.
Diffstat (limited to 'compiler/src/lexer/tests.rs')
| -rw-r--r-- | compiler/src/lexer/tests.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/src/lexer/tests.rs b/compiler/src/lexer/tests.rs index 30be85a..2dce2e3 100644 --- a/compiler/src/lexer/tests.rs +++ b/compiler/src/lexer/tests.rs | |||
| @@ -4,7 +4,7 @@ use super::Token::*; | |||
| 4 | use super::*; | 4 | use super::*; |
| 5 | 5 | ||
| 6 | fn tokenize<'a>(input: &'a str) -> Vec<Token<'a>> { | 6 | fn tokenize<'a>(input: &'a str) -> Vec<Token<'a>> { |
| 7 | Lexer::new(input).map(|s| s.into_inner()).collect() | 7 | Lexer::new(input).map(|s| s.inner).collect() |
| 8 | } | 8 | } |
| 9 | 9 | ||
| 10 | #[test] | 10 | #[test] |
| @@ -289,7 +289,9 @@ fn test_comments() { | |||
| 289 | } | 289 | } |
| 290 | 290 | ||
| 291 | fn spans(input: &str) -> Vec<(Pos, Pos)> { | 291 | fn spans(input: &str) -> Vec<(Pos, Pos)> { |
| 292 | Lexer::new(input).map(|s| (s.start(), s.end())).collect() | 292 | Lexer::new(input) |
| 293 | .map(|s| (s.span.start, s.span.end)) | ||
| 294 | .collect() | ||
| 293 | } | 295 | } |
| 294 | 296 | ||
| 295 | #[test] | 297 | #[test] |
