Skip to content

Commit

Permalink
we are no longer assuming .token() takes ascii string
Browse files Browse the repository at this point in the history
  • Loading branch information
amitu committed Oct 29, 2024
1 parent cfc96be commit 3e47817
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions v0.5/fastn-p1/src/parser/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pub struct Scanner<'input> {
input: &'input str,
chars: std::iter::Peekable<std::str::CharIndices<'input>>,
/// index is byte position in the input
pub index: usize,
index: usize,
fuel: fastn_p1::Fuel,
pub output: fastn_p1::ParseOutput,
}
Expand Down Expand Up @@ -132,7 +132,6 @@ impl<'input> Scanner<'input> {
pub fn token(&mut self, t: &'static str) -> Option<fastn_p1::Span> {
let start = self.index();
for char in t.chars() {
assert!(char.is_ascii()); // we are assuming this is ascii string
if self.peek() != Some(char) {
self.reset(start);
return None;
Expand Down

0 comments on commit 3e47817

Please sign in to comment.