From 596d465c1762367a7b0e469007f1ea4ddbfed854 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 17 Jun 2016 14:39:18 -0500 Subject: [PATCH] Add SubscriptAccess Syntax --- src/Syntax.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Syntax.hs b/src/Syntax.hs index ddd3d5c85..684ea5fee 100644 --- a/src/Syntax.hs +++ b/src/Syntax.hs @@ -36,6 +36,9 @@ data Syntax | VarDecl f -- | A variable assignment in a variable declaration. var foo = bar; | VarAssignment { varId :: f, varValue :: f } + -- | A subscript access contains a syntax, and another syntax that indefies a property or value in the first syntax. + -- | e.g. in Javascript x["y"] represents a subscript access syntax. + | SubscriptAccess { subscriptId :: f, subscriptElement :: f } | Switch { switchExpr :: f, cases :: [f] } | Case { caseExpr :: f, caseStatements :: f } deriving (Functor, Show, Eq, Foldable, Traversable)