1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00

Don't require statements in foreach

This commit is contained in:
joshvera 2018-02-05 14:10:28 -05:00
parent 3a1026a7f1
commit 680861f9c2

View File

@ -532,7 +532,7 @@ forStatement :: Assignment
forStatement = makeTerm <$> symbol ForStatement <*> children (Statement.For <$> (term expressions <|> emptyTerm) <*> (term expressions <|> emptyTerm) <*> (term expressions <|> emptyTerm) <*> (statement <|> (makeTerm <$> location <*> manyTerm statement)))
foreachStatement :: Assignment
foreachStatement = makeTerm <$> symbol ForeachStatement <*> children (forEachStatement' <$> term expression <*> term (pair <|> expression <|> list) <*> (makeTerm <$> location <*> someTerm statement))
foreachStatement = makeTerm <$> symbol ForeachStatement <*> children (forEachStatement' <$> term expression <*> term (pair <|> expression <|> list) <*> (makeTerm <$> location <*> manyTerm statement))
where forEachStatement' array value body = Statement.ForEach value array body
pair :: Assignment