1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// use crate::utils::Spanned;
// use super::*;
// /// An iterator over the tokens produced by a [`Input`].
// #[derive(derive_more::From, derive_more::Into)]
// pub struct IntoIter<'inp, 'closure, T: Token<'inp>, L: Lexer<'inp, T>, C> {
// stream: InputRef<'inp, 'closure, T, L, C>,
// }
// impl<'inp, 'closure, T, L, C> IntoIter<'inp, 'closure, T, L, C>
// where
// T: Token<'inp>,
// L: Lexer<'inp, T>,
// {
// pub(super) const fn new(stream: InputRef<'inp, 'closure, T, L, C>) -> Self {
// Self { stream }
// }
// }
// impl<'inp, T: Token<'inp>, L: Lexer<'inp, T>, C> Clone for IntoIter<'inp, '_, T, L, C>
// where
// L::State: Clone,
// C: Clone,
// {
// #[cfg_attr(not(tarpaulin), inline(always))]
// fn clone(&self) -> Self {
// Self {
// stream: self.stream.clone(),
// }
// }
// }
// impl<'inp, T, L, C> core::fmt::Debug for IntoIter<'inp, '_, T, L, C>
// where
// T: Token<'inp>,
// L: Lexer<'inp, T>,
// L::Source: core::fmt::Debug,
// L::State: core::fmt::Debug,
// C: core::fmt::Debug,
// {
// #[cfg_attr(not(tarpaulin), inline(always))]
// fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
// self.stream.fmt(f)
// }
// }
// impl<'inp, 'closure, T, L, C> IntoIterator for InputRef<'inp, 'closure, T, L, C>
// where
// T: Token<'inp>,
// L: Lexer<'inp, T>,
// L::State: Clone,
// C: Cache<'inp, T, L>,
// {
// type Item = Spanned<Lexed<'inp, T>>;
// type IntoIter = IntoIter<'inp, 'closure, T, L, C>;
// #[cfg_attr(not(tarpaulin), inline(always))]
// fn into_iter(self) -> Self::IntoIter {
// self.into_iter()
// }
// }
// impl<'inp, T, L, C> Iterator for IntoIter<'inp, '_, T, L, C>
// where
// T: Token<'inp>,
// L: Lexer<'inp, T>,
// L::State: Clone,
// C: Cache<'inp, T, L>,
// {
// type Item = Spanned<Lexed<'inp, T>>;
// #[cfg_attr(not(tarpaulin), inline(always))]
// fn next(&mut self) -> Option<Self::Item> {
// InputRef::next(&mut self.stream)
// }
// }
// /// An iterator over the tokens produced by a [`Input`].
// #[derive(derive_more::From, derive_more::Into)]
// pub struct Iter<'inp, 'closure, T: Token<'inp>, L: Lexer<'inp, T>, C> {
// stream: &'closure mut InputRef<'inp, 'closure, T, L, C>,
// }
// impl<'inp, 'closure, T, L, C> Iter<'inp, 'closure, T, L, C>
// where
// T: Token<'inp>,
// L: Lexer<'inp, T>,
// {
// #[cfg_attr(not(tarpaulin), inline(always))]
// pub(super) const fn new(stream: &'closure mut InputRef<'inp, 'closure, T, L, C>) -> Self {
// Self { stream }
// }
// }
// impl<'inp, 'closure, T, L, C> IntoIterator for &'closure mut InputRef<'inp, 'closure, T, L, C>
// where
// T: Token<'inp>,
// L: Lexer<'inp, T>,
// L::State: Clone,
// C: Cache<'inp, T, L>,
// {
// type Item = Spanned<Lexed<'inp, T>>;
// type IntoIter = Iter<'inp, 'closure, T, L, C>;
// #[cfg_attr(not(tarpaulin), inline(always))]
// fn into_iter(self) -> Self::IntoIter {
// self.iter()
// }
// }
// impl<'inp, T, L, C> Iterator for Iter<'inp, '_, T, L, C>
// where
// T: Token<'inp>,
// L: Lexer<'inp, T>,
// L::State: Clone,
// C: Cache<'inp, T, L>,
// {
// type Item = Spanned<Lexed<'inp, T>>;
// #[cfg_attr(not(tarpaulin), inline(always))]
// fn next(&mut self) -> Option<Self::Item> {
// Input::next(self.stream)
// }
// }