diff --git a/libconlang/src/ast.rs b/libconlang/src/ast.rs index c1a2e14..174791c 100644 --- a/libconlang/src/ast.rs +++ b/libconlang/src/ast.rs @@ -146,7 +146,8 @@ pub struct Variant { #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] pub enum VariantKind { - Named(Identifier), + Plain, + CLike(u128), Tuple(Vec), Struct(Vec), } diff --git a/libconlang/src/ast/ast_impl.rs b/libconlang/src/ast/ast_impl.rs index da533aa..b74db4f 100644 --- a/libconlang/src/ast/ast_impl.rs +++ b/libconlang/src/ast/ast_impl.rs @@ -186,7 +186,8 @@ mod display { impl Display for VariantKind { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - VariantKind::Named(n) => n.fmt(f), + VariantKind::Plain => Ok(()), + VariantKind::CLike(n) => n.fmt(f), VariantKind::Tuple(v) => delimit(separate(v, ", "), INLINE_PARENS)(f), VariantKind::Struct(v) => delimit(separate(v, ",\n"), BRACES)(f), } @@ -664,7 +665,7 @@ mod convert { Vec => EnumKind::Variants, } impl From for VariantKind { - Identifier => VariantKind::Named, + u128 => VariantKind::CLike, Vec => VariantKind::Tuple, // TODO: enum struct variants }