parse lifetimes

This commit is contained in:
Jana Dönszelmann 2026-04-03 17:24:45 +02:00
parent 53fc09c02f
commit 47f4c1e8c2
No known key found for this signature in database
6 changed files with 402 additions and 12 deletions

View file

@ -14,6 +14,8 @@ pub enum SpanKind {
Number,
/// Known literals, like `true`, `false`, `None`, `Ok`, `Err`
Literal,
/// Lifetimes (`'foo`)
Lifetime,
/// Strings
String,
/// Paths
@ -193,6 +195,10 @@ mod private {
Token::Atom(atom) => {
atom.into_spans(cx);
}
Token::Lifetime(lifetime) => {
cx.push("'", SpanKind::Surroundings);
cx.push(lifetime, SpanKind::Lifetime);
}
}
}
}