tamer: nir: Remove token `todo!`s

Just preparing to actually define NIR itself.  The _grammar_ has been
represented (derived from our internal systems, using them as a test case),
but the IR itself has not yet received a definition.

DEV-7145
main
Mike Gerwitz 2022-09-19 16:21:41 -04:00
parent 3456bd593a
commit 80d7de7376
1 changed files with 13 additions and 5 deletions

View File

@ -57,7 +57,7 @@ use crate::{
diagnose::{Annotate, Diagnostic}, diagnose::{Annotate, Diagnostic},
fmt::{DisplayWrapper, TtQuote}, fmt::{DisplayWrapper, TtQuote},
parse::{Object, Token}, parse::{Object, Token},
span::Span, span::{Span, UNKNOWN_SPAN},
sym::SymbolId, sym::SymbolId,
xir::{attr::Attr, fmt::TtXmlAttr, QName}, xir::{attr::Attr, fmt::TtXmlAttr, QName},
}; };
@ -73,19 +73,27 @@ pub enum Nir {
impl Token for Nir { impl Token for Nir {
fn ir_name() -> &'static str { fn ir_name() -> &'static str {
todo!() "NIR"
} }
fn span(&self) -> crate::span::Span { fn span(&self) -> crate::span::Span {
todo!() use Nir::*;
match self {
Todo => UNKNOWN_SPAN,
}
} }
} }
impl Object for Nir {} impl Object for Nir {}
impl Display for Nir { impl Display for Nir {
fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
todo!() use Nir::*;
match self {
Todo => write!(f, "TODO"),
}
} }
} }