mirror of
https://github.com/github/semantic.git
synced 2024-12-21 05:41:54 +03:00
Fix python assignment for multiple statements in if body
This commit is contained in:
parent
2ca5412769
commit
996b8fbf30
@ -133,6 +133,9 @@ statement = assertStatement
|
||||
<|> withStatement
|
||||
<|> parseError
|
||||
|
||||
statements :: Assignment
|
||||
statements = makeTerm <$> location <*> many statement
|
||||
|
||||
literal :: Assignment
|
||||
literal = boolean
|
||||
<|> concatenatedString
|
||||
@ -400,7 +403,7 @@ raiseStatement :: Assignment
|
||||
raiseStatement = makeTerm <$> symbol RaiseStatement <*> children (Statement.Throw <$> (makeTerm <$> location <*> many expression))
|
||||
|
||||
ifStatement :: Assignment
|
||||
ifStatement = makeTerm <$> symbol IfStatement <*> children (Statement.If <$> expression <*> statement <*> (flip (foldr makeElif) <$> many elifClause <*> optionalElse))
|
||||
ifStatement = makeTerm <$> symbol IfStatement <*> children (Statement.If <$> expression <*> statements <*> (flip (foldr makeElif) <$> many elifClause <*> optionalElse))
|
||||
where elseClause = symbol ElseClause *> children statement
|
||||
elifClause = (,) <$ symbol ElifClause <*> location <*> children (Statement.If <$> expression <*> statement)
|
||||
optionalElse = fromMaybe <$> emptyTerm <*> optional elseClause
|
||||
|
Loading…
Reference in New Issue
Block a user