You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 1, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: src/Language/Python/Assignment.hs
+7-8Lines changed: 7 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -249,22 +249,22 @@ withStatement = mk <$> symbol WithStatement <*> children (someTerm with)
249
249
<|>flipStatement.Let<$> term expression <*> emptyTerm
250
250
251
251
forStatement::AssignmentTerm
252
-
forStatement = symbol ForStatement>>=\ loc -> children (make loc <$> (symbol Variables*> children expressions) <*> term expressionList <*>(makeTerm <$> location <*> manyTermsTill expression (void (symbol ElseClause) <|> eof))<*> optional (symbol ElseClause*> children expressions))
252
+
forStatement = symbol ForStatement>>=\ loc -> children (make loc <$> (symbol Variables*> children expressions) <*> term expressionList <*>term block'<*> optional (symbol ElseClause*> children expressions))
253
253
where
254
254
make loc binding subject body forElseClause =case forElseClause of
255
255
Nothing-> makeTerm loc (Statement.ForEach binding subject body)
256
256
Just a -> makeTerm loc (Statement.Else (makeTerm loc $Statement.ForEach binding subject body) a)
257
257
258
258
whileStatement::AssignmentTerm
259
-
whileStatement = symbol WhileStatement>>=\ loc -> children (make loc <$> term expression <*>expressions<*> optional (symbol ElseClause*> children expressions))
259
+
whileStatement = symbol WhileStatement>>=\ loc -> children (make loc <$> term expression <*>term block<*> optional (symbol ElseClause*> children expressions))
260
260
where
261
261
make loc whileCondition whileBody whileElseClause =case whileElseClause of
262
262
Nothing-> makeTerm loc (Statement.While whileCondition whileBody)
263
263
Just a -> makeTerm loc (Statement.Else (makeTerm loc $Statement.While whileCondition whileBody) a)
264
264
265
265
tryStatement::AssignmentTerm
266
-
tryStatement = makeTerm <$> symbol TryStatement<*> children (Statement.Try<$> term expression<*> manyTerm (expression <|> elseClause))
267
-
where elseClause = makeTerm <$> symbol ElseClause<*> children (Statement.Else<$> emptyTerm <*>expressions)
266
+
tryStatement = makeTerm <$> symbol TryStatement<*> children (Statement.Try<$> term block<*> manyTerm (expression <|> elseClause))
267
+
where elseClause = makeTerm <$> symbol ElseClause<*> children (Statement.Else<$> emptyTerm <*>term block)
268
268
269
269
exceptClause::AssignmentTerm
270
270
exceptClause = makeTerm <$> symbol ExceptClause<*> children
@@ -291,9 +291,8 @@ functionDefinition =
291
291
inmaybe fn (makeTerm loc .Type.Annotation fn) ty
292
292
293
293
classDefinition::AssignmentTerm
294
-
classDefinition = makeTerm <$> symbol ClassDefinition<*> children (Declaration.Class[]<$> term expression <*> argumentList <*>expressions')
294
+
classDefinition = makeTerm <$> symbol ClassDefinition<*> children (Declaration.Class[]<$> term expression <*> argumentList <*>term block')
0 commit comments