let lexing_store s buff max =
let rec self n s =
if n >= max
then n
else
(match Stream.peek s with
| Some x -> (Stream.junk s; buff.[n] <- x; succ n)
| _ -> n)
in self 0 s