1
1
mirror of https://github.com/github/semantic.git synced 2025-01-02 20:41:38 +03:00

ruby: add Assignment' type so we can remove type constraints

This commit is contained in:
Charlie Somerville 2018-04-04 19:10:35 +10:00
parent 237ffea294
commit 5ff04bebcc

View File

@ -147,14 +147,14 @@ expressions = makeTerm'' <$> location <*> many expression
parenthesizedExpressions :: Assignment
parenthesizedExpressions = makeTerm'' <$> symbol ParenthesizedStatements <*> children (Syntax.Paren <$> expressions)
withExtendedScope :: (Enum grammar, Ix grammar, Eq1 ast) => Assignment.Assignment ast grammar a -> Assignment.Assignment ast grammar a
withExtendedScope :: Assignment' a -> Assignment' a
withExtendedScope inner = do
locals <- getRubyLocals
result <- inner
putRubyLocals locals
pure result
withNewScope :: (Enum grammar, Ix grammar, Eq1 ast) => Assignment.Assignment ast grammar a -> Assignment.Assignment ast grammar a
withNewScope :: Assignment' a -> Assignment' a
withNewScope inner = withExtendedScope $ do
putRubyLocals []
inner