From d92175e8e98c55e8b2dd23df2a68794a90b96e83 Mon Sep 17 00:00:00 2001 From: Sasial <44125644+sasial-dev@users.noreply.github.com> Date: Thu, 28 Dec 2023 08:16:10 +1000 Subject: [PATCH] Make unit enums have quotes around literal (#25) --- zap/src/parser/grammar.lalrpop | 2 +- zap/src/parser/syntax_tree.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zap/src/parser/grammar.lalrpop b/zap/src/parser/grammar.lalrpop index 0bfd652e..6fdb9152 100644 --- a/zap/src/parser/grammar.lalrpop +++ b/zap/src/parser/grammar.lalrpop @@ -103,7 +103,7 @@ Enum: SyntaxEnum<'input> = { } EnumKind: SyntaxEnumKind<'input> = { - "{" > "}" => SyntaxEnumKind::Unit(enumerators), + "{" > "}" => SyntaxEnumKind::Unit(enumerators), "{" )>> "}" => SyntaxEnumKind::Tagged { tag, variants }, } diff --git a/zap/src/parser/syntax_tree.rs b/zap/src/parser/syntax_tree.rs index 00850926..17bdc426 100644 --- a/zap/src/parser/syntax_tree.rs +++ b/zap/src/parser/syntax_tree.rs @@ -145,7 +145,7 @@ impl<'src> Spanned for SyntaxEnum<'src> { #[derive(Debug, Clone, PartialEq)] pub enum SyntaxEnumKind<'src> { - Unit(Vec>), + Unit(Vec>), Tagged { tag: SyntaxStrLit<'src>,