mirror of
https://github.com/github/semantic.git
synced 2024-12-01 09:15:01 +03:00
Call it scope entry/exit instead
This commit is contained in:
parent
f761f62f8a
commit
ccc1146656
@ -129,29 +129,31 @@ instance Eq1 Finally where liftEq = genericLiftEq
|
||||
instance Show1 Finally where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
|
||||
-- | BEGIN block statement.
|
||||
newtype BeginBlock a = BeginBlock [a]
|
||||
-- | ScopeEntry (e.g. `BEGIN {}` block in Ruby or Perl).
|
||||
newtype ScopeEntry a = ScopeEntry [a]
|
||||
deriving (Eq, Foldable, Functor, GAlign, Generic1, Show, Traversable)
|
||||
|
||||
instance Eq1 BeginBlock where liftEq = genericLiftEq
|
||||
instance Show1 BeginBlock where liftShowsPrec = genericLiftShowsPrec
|
||||
instance Eq1 ScopeEntry where liftEq = genericLiftEq
|
||||
instance Show1 ScopeEntry where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
|
||||
-- | END block statement.
|
||||
newtype EndBlock a = EndBlock [a]
|
||||
-- | ScopeExit (e.g. `END {}` block in Ruby or Perl).
|
||||
newtype ScopeExit a = ScopeExit [a]
|
||||
deriving (Eq, Foldable, Functor, GAlign, Generic1, Show, Traversable)
|
||||
|
||||
instance Eq1 EndBlock where liftEq = genericLiftEq
|
||||
instance Show1 EndBlock where liftShowsPrec = genericLiftShowsPrec
|
||||
instance Eq1 ScopeExit where liftEq = genericLiftEq
|
||||
instance Show1 ScopeExit where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
|
||||
-- | Alias statement
|
||||
-- | Alias statement.
|
||||
data Alias a = Alias { aliasFrom :: !a, aliasTo :: !a }
|
||||
deriving (Eq, Foldable, Functor, GAlign, Generic1, Show, Traversable)
|
||||
|
||||
instance Eq1 Alias where liftEq = genericLiftEq
|
||||
instance Show1 Alias where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
|
||||
-- | Undef statement.
|
||||
newtype Undef a = Undef [a]
|
||||
deriving (Eq, Foldable, Functor, GAlign, Generic1, Show, Traversable)
|
||||
|
||||
|
@ -39,16 +39,16 @@ type Syntax = '[
|
||||
, Literal.Symbol
|
||||
, Statement.Alias
|
||||
, Statement.Assignment
|
||||
, Statement.BeginBlock
|
||||
, Statement.Break
|
||||
, Statement.Continue
|
||||
, Statement.EndBlock
|
||||
, Statement.ForEach
|
||||
, Statement.If
|
||||
, Statement.Return
|
||||
, Statement.ScopeEntry
|
||||
, Statement.ScopeExit
|
||||
, Statement.Undef
|
||||
, Statement.While
|
||||
, Statement.Yield
|
||||
, Statement.Undef
|
||||
, Syntax.Empty
|
||||
, Syntax.Error Error
|
||||
, Syntax.Identifier
|
||||
@ -93,10 +93,10 @@ statement = handleError
|
||||
|
||||
|
||||
beginBlock :: Assignment
|
||||
beginBlock = makeTerm <$> symbol BeginBlock <*> children (Statement.BeginBlock <$> many topLevelStatement)
|
||||
beginBlock = makeTerm <$> symbol BeginBlock <*> children (Statement.ScopeEntry <$> many topLevelStatement)
|
||||
|
||||
endBlock :: Assignment
|
||||
endBlock = makeTerm <$> symbol EndBlock <*> children (Statement.EndBlock <$> many topLevelStatement)
|
||||
endBlock = makeTerm <$> symbol EndBlock <*> children (Statement.ScopeExit <$> many topLevelStatement)
|
||||
|
||||
|
||||
-- class' :: Assignment
|
||||
|
Loading…
Reference in New Issue
Block a user