mirror of
https://github.com/github/semantic.git
synced 2024-12-20 05:11:44 +03:00
Elide comments from comprehensions
This commit is contained in:
parent
f486f2c41a
commit
a2bb8479a3
@ -461,7 +461,7 @@ comprehension = makeTerm <$> symbol GeneratorExpression <*> children (comprehen
|
|||||||
<|> makeTerm <$> symbol DictionaryComprehension <*> children (comprehensionDeclaration keyValue)
|
<|> makeTerm <$> symbol DictionaryComprehension <*> children (comprehensionDeclaration keyValue)
|
||||||
where
|
where
|
||||||
keyValue = makeTerm <$> location <*> (Literal.KeyValue <$> expression <*> expression)
|
keyValue = makeTerm <$> location <*> (Literal.KeyValue <$> expression <*> expression)
|
||||||
comprehensionDeclaration preceeding = Declaration.Comprehension <$> preceeding <* symbol Variables <*> children (many expression) <*> (flip (foldr makeComprehension) <$> many nestedComprehension <*> expression)
|
comprehensionDeclaration preceeding = Declaration.Comprehension <$ many comment <*> preceeding <* symbol Variables <*> children (many expression) <*> (flip (foldr makeComprehension) <$> many nestedComprehension <*> expression)
|
||||||
makeComprehension (loc, makeRest) rest = makeTerm loc (makeRest rest)
|
makeComprehension (loc, makeRest) rest = makeTerm loc (makeRest rest)
|
||||||
nestedComprehension = (,) <$> location <*> (Declaration.Comprehension <$> expression <* symbol Variables <*> children (many expression))
|
nestedComprehension = (,) <$> location <*> (Declaration.Comprehension <$> expression <* symbol Variables <*> children (many expression))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user