tamer: asg::air::Air::span: Provide spans

Not that they're loaded from object files yet, but this will at least work
once they are.

DEV-13160
main
Mike Gerwitz 2023-01-04 14:46:38 -05:00
parent 8e328d2828
commit 4b9b173e30
1 changed files with 14 additions and 3 deletions

View File

@ -139,9 +139,20 @@ impl Token for Air {
}
fn span(&self) -> crate::span::Span {
// TODO: This can be provided once the xmlo files store source
// locations for symbols.
UNKNOWN_SPAN
use Air::*;
match self {
Todo => UNKNOWN_SPAN,
OpenExpr(_, span) | CloseExpr(span) => *span,
IdentExpr(spair)
| IdentDecl(spair, _, _)
| IdentExternDecl(spair, _, _)
| IdentDep(spair, _)
| IdentFragment(spair, _)
| IdentRoot(spair) => spair.span(),
}
}
}