@@ -71,26 +71,26 @@ var AnnotationRules = On(Any).Self(
7171 ),
7272
7373 // Comparison operators
74- On (pyast .Eq ).Roles (uast .Binary , uast .Operator , uast .Equal ),
75- On (pyast .NotEq ).Roles (uast .Binary , uast .Operator , uast .Equal , uast .Not ),
76- On (pyast .Lt ).Roles (uast .Binary , uast .Operator , uast .LessThan ),
77- On (pyast .LtE ).Roles (uast .Binary , uast .Operator , uast .LessThanOrEqual ),
78- On (pyast .Gt ).Roles (uast .Binary , uast .Operator , uast .GreaterThan ),
79- On (pyast .GtE ).Roles (uast .Binary , uast .Operator , uast .GreaterThanOrEqual ),
80- On (pyast .Is ).Roles (uast .Binary , uast .Operator , uast .Identical ),
81- On (pyast .IsNot ).Roles (uast .Binary , uast .Operator , uast .Identical , uast .Not ),
82- On (pyast .In ).Roles (uast .Binary , uast .Operator , uast .Contains ),
83- On (pyast .NotIn ).Roles (uast .Binary , uast .Operator , uast .Contains , uast .Not ),
84-
85- // Aritmetic operators
86- On (pyast .Add ).Roles (uast .Binary , uast .Operator , uast .Add ),
87- On (pyast .Sub ).Roles (uast .Binary , uast .Operator , uast .Substract ),
88- On (pyast .Mult ).Roles (uast .Binary , uast .Operator , uast .Multiply ),
89- On (pyast .Div ).Roles (uast .Binary , uast .Operator , uast .Divide ),
90- On (pyast .Mod ).Roles (uast .Binary , uast .Operator , uast .Modulo ),
91- On (pyast .FloorDiv ).Roles (uast .Binary , uast .Operator , uast .Divide , uast .Incomplete ),
92- On (pyast .Pow ).Roles (uast .Binary , uast .Operator , uast .Incomplete ),
93- On (pyast .MatMult ).Roles (uast .Binary , uast .Operator , uast .Multiply , uast .Incomplete ),
74+ On (pyast .Eq ).Roles (uast .Binary , uast .Operator , uast .Equal , uast . Relational ),
75+ On (pyast .NotEq ).Roles (uast .Binary , uast .Operator , uast .Equal , uast .Not , uast . Relational ),
76+ On (pyast .Lt ).Roles (uast .Binary , uast .Operator , uast .LessThan , uast . Relational ),
77+ On (pyast .LtE ).Roles (uast .Binary , uast .Operator , uast .LessThanOrEqual , uast . Relational ),
78+ On (pyast .Gt ).Roles (uast .Binary , uast .Operator , uast .GreaterThan , uast . Relational ),
79+ On (pyast .GtE ).Roles (uast .Binary , uast .Operator , uast .GreaterThanOrEqual , uast . Relational ),
80+ On (pyast .Is ).Roles (uast .Binary , uast .Operator , uast .Identical , uast . Relational ),
81+ On (pyast .IsNot ).Roles (uast .Binary , uast .Operator , uast .Identical , uast .Not , uast . Relational ),
82+ On (pyast .In ).Roles (uast .Binary , uast .Operator , uast .Contains , uast . Relational ),
83+ On (pyast .NotIn ).Roles (uast .Binary , uast .Operator , uast .Contains , uast .Not , uast . Relational ),
84+
85+ // Arithmetic operators
86+ On (pyast .Add ).Roles (uast .Binary , uast .Operator , uast .Add , uast . Arithmetic ),
87+ On (pyast .Sub ).Roles (uast .Binary , uast .Operator , uast .Substract , uast . Arithmetic ),
88+ On (pyast .Mult ).Roles (uast .Binary , uast .Operator , uast .Multiply , uast . Arithmetic ),
89+ On (pyast .Div ).Roles (uast .Binary , uast .Operator , uast .Divide , uast . Arithmetic ),
90+ On (pyast .Mod ).Roles (uast .Binary , uast .Operator , uast .Modulo , uast . Arithmetic ),
91+ On (pyast .FloorDiv ).Roles (uast .Binary , uast .Operator , uast .Divide , uast .Arithmetic , uast . Incomplete ),
92+ On (pyast .Pow ).Roles (uast .Binary , uast .Operator , uast .Arithmetic , uast . Incomplete ),
93+ On (pyast .MatMult ).Roles (uast .Binary , uast .Operator , uast .Multiply , uast .Arithmetic , uast . Incomplete ),
9494
9595 // Bitwise operators
9696 On (pyast .LShift ).Roles (uast .Binary , uast .Operator , uast .Bitwise , uast .LeftShift ),
@@ -151,7 +151,7 @@ var AnnotationRules = On(Any).Self(
151151 On (pyast .AsyncFuncDecorators ).Roles (uast .Function , uast .Declaration , uast .Call , uast .Incomplete ),
152152 On (pyast .AsyncFuncDefBody ).Roles (uast .Function , uast .Declaration , uast .Body ),
153153 // FIXME: change to Function, Declaration, ArgumentS once the PR has been merged
154- On (pyast .Lambda ).Roles (uast .Function , uast .Declaration , uast .Expression , uast .Incomplete ).Children (
154+ On (pyast .Lambda ).Roles (uast .Function , uast .Declaration , uast .Expression , uast .Anonymous ).Children (
155155 On (pyast .LambdaBody ).Roles (uast .Function , uast .Declaration , uast .Body ),
156156 argumentsAnn ,
157157 ),
@@ -304,12 +304,12 @@ var AnnotationRules = On(Any).Self(
304304 // have any semantic information by themselves and this we consider it comments
305305 // (some preprocessors or linters can use them, the runtimes ignore them). The
306306 // TOKEN will take the annotation in the UAST node so the information is keept in
307- // any case. FIXME: need annotation or type UAST roles
308- On (pyast .AnnAssign ).Roles (uast .Operator , uast .Binary , uast .Assignment , uast . Comment , uast . Incomplete ),
309- On (HasInternalRole ("annotation" )).Roles (uast .Comment , uast . Incomplete ),
310- On (HasInternalRole ("returns" )).Roles (uast .Comment , uast . Incomplete ),
307+ // any case.
308+ On (pyast .AnnAssign ).Roles (uast .Operator , uast .Binary , uast .Assignment ),
309+ On (HasInternalRole ("annotation" )).Roles (uast .Annotation ),
310+ On (HasInternalRole ("returns" )).Roles (uast .Annotation ),
311311
312- // Python very odd ellipsis operatouast . Has a special rule in tonoder synthetic tokens
312+ // Python very odd ellipsis operator . Has a special rule in tonoder synthetic tokens
313313 // map to load it with the token "PythonEllipsisuast.Operator" and gets the role uast.Identifier
314314 On (pyast .Ellipsis ).Roles (uast .Identifier , uast .Incomplete ),
315315
0 commit comments