mirror of
https://github.com/github/semantic.git
synced 2024-12-11 08:45:48 +03:00
use withLexicalScopeAndFrame in Statements
This commit is contained in:
parent
f2754368cb
commit
1020f6dc61
@ -32,10 +32,8 @@ instance Show1 Statements where liftShowsPrec = genericLiftShowsPrec
|
|||||||
instance ToJSON1 Statements
|
instance ToJSON1 Statements
|
||||||
|
|
||||||
instance Evaluatable Statements where
|
instance Evaluatable Statements where
|
||||||
eval eval (Statements xs) = do
|
eval eval (Statements xs) =
|
||||||
currentScope' <- currentScope -- TODO: currentScope should return a Maybe
|
withLexicalScopeAndFrame $ maybe (rvalBox unit) (runApp . foldMap1 (App . eval)) (nonEmpty xs)
|
||||||
scope <- newScope (Map.singleton Lexical [ currentScope' ])
|
|
||||||
withScope scope $ maybe (rvalBox unit) (runApp . foldMap1 (App . eval)) (nonEmpty xs)
|
|
||||||
|
|
||||||
instance Tokenize Statements where
|
instance Tokenize Statements where
|
||||||
tokenize = imperative
|
tokenize = imperative
|
||||||
|
Loading…
Reference in New Issue
Block a user