mirror of
https://github.com/github/semantic.git
synced 2024-12-03 00:16:52 +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 Evaluatable Statements where
|
||||
eval eval (Statements xs) = do
|
||||
currentScope' <- currentScope -- TODO: currentScope should return a Maybe
|
||||
scope <- newScope (Map.singleton Lexical [ currentScope' ])
|
||||
withScope scope $ maybe (rvalBox unit) (runApp . foldMap1 (App . eval)) (nonEmpty xs)
|
||||
eval eval (Statements xs) =
|
||||
withLexicalScopeAndFrame $ maybe (rvalBox unit) (runApp . foldMap1 (App . eval)) (nonEmpty xs)
|
||||
|
||||
instance Tokenize Statements where
|
||||
tokenize = imperative
|
||||
|
Loading…
Reference in New Issue
Block a user