From 3bb6bb3d6f0e8f3918d3543dceeeafa32b896371 Mon Sep 17 00:00:00 2001 From: Greg Brown Date: Mon, 23 Nov 2020 21:36:30 +0000 Subject: Change syntax --- src/ast/mod.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/ast/mod.rs') diff --git a/src/ast/mod.rs b/src/ast/mod.rs index bbd7d1d..09b89e7 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -30,16 +30,7 @@ fn fix R>(init: R, mut step: F) -> R { res } -#[derive(Copy, Clone, Debug)] -pub struct Epsilon { - span: Span, -} - -impl Epsilon { - pub fn new(span: Span) -> Self { - Self { span } - } -} +pub type Epsilon = Token![_]; impl Type for Epsilon { type Err = Never; @@ -826,7 +817,7 @@ impl TypeKind { impl Display for TypeKind { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::Epsilon => write!(f, "()"), + Self::Epsilon => write!(f, "_"), Self::Literal(s) => write!(f, "{:?}", s), Self::Cat(fst, snd) => write!(f, "{}.{}", fst, snd), Self::Alt(left, right) => write!(f, "({} | {})", left, right), -- cgit v1.2.3