mirror of
https://github.com/github/semantic.git
synced 2024-12-20 21:31:48 +03:00
flatten expressionList for single element lists
This commit is contained in:
parent
fed576137d
commit
a7df785093
@ -175,6 +175,11 @@ expressionStatement = mk <$> symbol ExpressionStatement <*> children (some expre
|
||||
where mk _ [child] = child
|
||||
mk location children = makeTerm location children
|
||||
|
||||
expressionList :: Assignment
|
||||
expressionList = mk <$> symbol ExpressionList <*> children (some expression)
|
||||
where mk _ [child] = child
|
||||
mk location children = makeTerm location children
|
||||
|
||||
argument :: Assignment
|
||||
argument = makeTerm <$> symbol ListSplatArgument <*> (Syntax.Identifier <$> source)
|
||||
<|> makeTerm <$> symbol DictionarySplatArgument <*> (Syntax.Identifier <$> source)
|
||||
@ -277,10 +282,6 @@ keyword = makeTerm <$> symbol KeywordIdentifier <*> children (Syntax.Identifier
|
||||
tuple :: Assignment
|
||||
tuple = makeTerm <$> symbol Tuple <*> children (Literal.Tuple <$> many expression)
|
||||
|
||||
-- TODO: Consider flattening single element lists
|
||||
expressionList :: Assignment
|
||||
expressionList = makeTerm <$> symbol ExpressionList <*> children (many expression)
|
||||
|
||||
unaryOperator :: Assignment
|
||||
unaryOperator = symbol UnaryOperator >>= \ location -> arithmetic location <|> bitwise location <|> children ( symbol AnonPlus *> expression )
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user