Do not remove tokens before AST json serialization

This commit is contained in:
Vadim Petrochenkov 2020-10-31 22:47:57 +03:00
parent 4f7612ac14
commit 6b63e9b990
10 changed files with 30 additions and 145 deletions

View file

@ -153,8 +153,9 @@ impl fmt::Debug for LazyTokenStream {
}
impl<S: Encoder> Encodable<S> for LazyTokenStream {
fn encode(&self, _s: &mut S) -> Result<(), S::Error> {
panic!("Attempted to encode LazyTokenStream");
fn encode(&self, s: &mut S) -> Result<(), S::Error> {
// Used by AST json printing.
Encodable::encode(&self.create_token_stream(), s)
}
}