pub fn serialize<S: Serializer>(
span: &Span,
serializer: S,
) -> Result<S::Ok, S::Error>
Expand description
The AST contains a few tuple-like enum variants that contain spans.
#[derive(Serialize, Deserialize)] outputs these fields as anonymous
mappings, which makes them difficult to remove from the JSON AST.
This function provides a custom serialization that maps the keyword
span
to the span information.