Track variables created through coproc.

This commit is contained in:
Vidar Holen
2015-01-27 10:11:17 -08:00
parent a485482979
commit 33c78b7c95
4 changed files with 24 additions and 7 deletions

View File

@@ -124,6 +124,7 @@ data Token =
| T_Annotation Id [Annotation] Token
| T_Pipe Id String
| T_CoProc Id (Maybe String) Token
| T_CoProcBody Id Token
deriving (Show)
data Annotation = DisableComment Integer deriving (Show, Eq)
@@ -250,6 +251,7 @@ analyze f g i =
delve (TA_Index id t) = d1 t $ TA_Index id
delve (T_Annotation id anns t) = d1 t $ T_Annotation id anns
delve (T_CoProc id var body) = d1 body $ T_CoProc id var
delve (T_CoProcBody id t) = d1 t $ T_CoProcBody id
delve t = return t
getId t = case t of
@@ -344,6 +346,7 @@ getId t = case t of
T_Annotation id _ _ -> id
T_Pipe id _ -> id
T_CoProc id _ _ -> id
T_CoProcBody id _ -> id
blank :: Monad m => Token -> m ()
blank = const $ return ()