lib/scanner: cache! before fetch in scan_next_token

This commit is contained in:
Paul Stemmet 2021-09-09 12:18:41 +00:00
parent 71dd1a52d5
commit 55b8f31b7b
Signed by: Paul Stemmet
GPG key ID: EDEA539F594E7E75

View file

@ -125,6 +125,12 @@ impl Scanner
return self.fetch_stream_end(*base, tokens);
}
// 4 characters is the longest token we can encounter, one
// of:
// - '--- '
// - '... '
cache!(~base, 4, opts)?;
// Fetch the next token(s)
match base.as_bytes()
{