mirror of
https://github.com/github/semantic.git
synced 2024-12-21 13:51:44 +03:00
Alias and undef just as function calls
This commit is contained in:
parent
d470d3218d
commit
b63e86a9a5
@ -154,19 +154,3 @@ newtype ScopeExit a = ScopeExit [a]
|
||||
|
||||
instance Eq1 ScopeExit where liftEq = genericLiftEq
|
||||
instance Show1 ScopeExit where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
|
||||
-- | 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)
|
||||
|
||||
instance Eq1 Undef where liftEq = genericLiftEq
|
||||
instance Show1 Undef where liftShowsPrec = genericLiftShowsPrec
|
||||
|
@ -48,7 +48,6 @@ type Syntax = '[
|
||||
, Literal.String
|
||||
, Literal.Symbol
|
||||
, Literal.TextElement
|
||||
, Statement.Alias
|
||||
, Statement.Assignment
|
||||
, Statement.Break
|
||||
, Statement.Catch
|
||||
@ -62,7 +61,6 @@ type Syntax = '[
|
||||
, Statement.ScopeEntry
|
||||
, Statement.ScopeExit
|
||||
, Statement.Try
|
||||
, Statement.Undef
|
||||
, Statement.While
|
||||
, Statement.Yield
|
||||
, Syntax.Empty
|
||||
@ -223,10 +221,12 @@ comment :: Assignment
|
||||
comment = makeTerm <$> symbol Comment <*> (Comment.Comment <$> source)
|
||||
|
||||
alias :: Assignment
|
||||
alias = makeTerm <$> symbol Alias <*> children (Statement.Alias <$> methodName <*> methodName)
|
||||
alias = makeTerm <$> symbol Alias <*> children (Expression.Call <$> name <*> some methodName)
|
||||
where name = makeTerm <$> location <*> (Syntax.Identifier <$> source)
|
||||
|
||||
undef :: Assignment
|
||||
undef = makeTerm <$> symbol Undef <*> children (Statement.Undef <$> some methodName)
|
||||
undef = makeTerm <$> symbol Undef <*> children (Expression.Call <$> name <*> some methodName)
|
||||
where name = makeTerm <$> location <*> (Syntax.Identifier <$> source)
|
||||
|
||||
if' :: Assignment
|
||||
if' =
|
||||
|
Loading…
Reference in New Issue
Block a user