From d64e12d868d0add82e3e98c7557768c70733b236 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 17 Jun 2019 11:18:08 -0400 Subject: [PATCH] Compile identifiers. Co-Authored-By: Patrick Thomson --- semantic-python/src/Language/Python/Core.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/semantic-python/src/Language/Python/Core.hs b/semantic-python/src/Language/Python/Core.hs index 14a3d1066..2fe47fe19 100644 --- a/semantic-python/src/Language/Python/Core.hs +++ b/semantic-python/src/Language/Python/Core.hs @@ -5,6 +5,7 @@ module Language.Python.Core import Control.Monad.Fail import Data.Core as Core +import Data.Name as Name import GHC.Generics import Prelude hiding (fail) import qualified TreeSitter.Python.AST as Py @@ -55,7 +56,9 @@ instance Compile Py.FunctionDefinition instance Compile Py.FutureImportStatement instance Compile Py.GeneratorExpression instance Compile Py.GlobalStatement -instance Compile Py.Identifier + +instance Compile Py.Identifier where + compile (Py.Identifier text) = pure (Var (User text)) instance Compile Py.IfStatement where compile Py.IfStatement{..} = If <$> compile condition <*> compile consequence <*> case alternative of