From 80d7de737694000f2ee3907d8bfff0edc0dc8f0a Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Mon, 19 Sep 2022 16:21:41 -0400 Subject: [PATCH] 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 --- tamer/src/nir.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tamer/src/nir.rs b/tamer/src/nir.rs index c049cec6..0455b68f 100644 --- a/tamer/src/nir.rs +++ b/tamer/src/nir.rs @@ -57,7 +57,7 @@ use crate::{ diagnose::{Annotate, Diagnostic}, fmt::{DisplayWrapper, TtQuote}, parse::{Object, Token}, - span::Span, + span::{Span, UNKNOWN_SPAN}, sym::SymbolId, xir::{attr::Attr, fmt::TtXmlAttr, QName}, }; @@ -73,19 +73,27 @@ pub enum Nir { impl Token for Nir { fn ir_name() -> &'static str { - todo!() + "NIR" } fn span(&self) -> crate::span::Span { - todo!() + use Nir::*; + + match self { + Todo => UNKNOWN_SPAN, + } } } impl Object for Nir {} impl Display for Nir { - fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result { - todo!() + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + use Nir::*; + + match self { + Todo => write!(f, "TODO"), + } } }