From cbd132c8dc5f21d2bc0ad172076a15e6d1f8a4ca Mon Sep 17 00:00:00 2001 From: joshvera Date: Tue, 10 Jan 2017 16:05:55 -0500 Subject: [PATCH] Add a Default Syntax for default cases --- src/Category.hs | 2 ++ src/Syntax.hs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Category.hs b/src/Category.hs index 3097ed669..05f766c23 100644 --- a/src/Category.hs +++ b/src/Category.hs @@ -188,6 +188,8 @@ data Category -- | An END {} block of statements. | EndBlock | ParameterDecl + -- | A default case in a switch statement. + | Default deriving (Eq, Generic, Ord, Show) -- Instances diff --git a/src/Syntax.hs b/src/Syntax.hs index 5e2ffab67..d872fe08f 100644 --- a/src/Syntax.hs +++ b/src/Syntax.hs @@ -47,6 +47,8 @@ data Syntax a f | SubscriptAccess { subscriptId :: f, subscriptElement :: f } | Switch { switchExpr :: f, cases :: [f] } | Case { caseExpr :: f, caseStatements :: [f] } + -- | A default case in a switch statement. + | Default [f] | Select { cases :: [f] } | Object { objectTy :: Maybe f, keyValues :: [f] } -- | A pair in an Object. e.g. foo: bar or foo => bar