Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 8de4427

Browse files
authored
Merge pull request #21 from juanjux/fix/20_unroledTest
Fix for missing IfCondition role on non-expression If nodes
2 parents bfbccd8 + f5630df commit 8de4427

File tree

4 files changed

+440
-83
lines changed

4 files changed

+440
-83
lines changed

driver/normalizer/annotation.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,9 @@ var AnnotationRules = On(Any).Self(
262262
// "If that sounds awkward is because it is" (their words)
263263
On(HasInternalType(pyast.If)).Roles(If).Children(
264264
On(HasInternalType("If.body")).Roles(IfBody),
265+
On(HasInternalRole("test")).Roles(IfCondition),
265266
On(HasInternalType("If.orelse")).Roles(IfElse),
266-
On(HasInternalType(pyast.Compare)).Roles(IfCondition, BinaryExpression).Children(
267+
On(HasInternalType(pyast.Compare)).Roles(BinaryExpression).Children(
267268
On(HasInternalType("Compare.ops")).Roles(BinaryExpressionOp),
268269
On(HasInternalType("Compare.comparators")).Roles(BinaryExpressionRight),
269270
On(HasInternalRole("left")).Roles(BinaryExpressionLeft),

0 commit comments

Comments
 (0)