diff options
author | Greg Brown <gmb60@cam.ac.uk> | 2020-11-23 21:36:30 +0000 |
---|---|---|
committer | Greg Brown <gmb60@cam.ac.uk> | 2020-11-25 12:11:17 +0000 |
commit | 3bb6bb3d6f0e8f3918d3543dceeeafa32b896371 (patch) | |
tree | 59902cf6157c116598511ac228abd5da7ca72eb5 /src/ast | |
parent | 15f0c0a1d0d000683101dedb8be56d058ee979c6 (diff) |
Change syntax
Diffstat (limited to 'src/ast')
-rw-r--r-- | src/ast/mod.rs | 13 |
1 files changed, 2 insertions, 11 deletions
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: PartialEq, F: FnMut(&R) -> 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), |