From 82e1deaab8f1047592682a091e64ef1436c28e8f Mon Sep 17 00:00:00 2001 From: Juanjo Alvarez Date: Wed, 4 Oct 2017 18:16:51 +0200 Subject: [PATCH 1/2] Misc annotation fixes - Restore the annotations of Lambda and AsyncFunctionDef arguments. - Annotate (incomplete) the virtual grouping node BoolOp. - Update integration tests. Signed-off-by: Juanjo Alvarez --- ANNOTATION.md | 363 ---------------------------- driver/normalizer/annotation.go | 17 +- fixtures/functiondef_simple.py.uast | 4 +- fixtures/issue_server101.py.uast | 44 ++-- fixtures/lambda.py.uast | 4 +- 5 files changed, 42 insertions(+), 390 deletions(-) delete mode 100644 ANNOTATION.md diff --git a/ANNOTATION.md b/ANNOTATION.md deleted file mode 100644 index 89b90b3e..00000000 --- a/ANNOTATION.md +++ /dev/null @@ -1,363 +0,0 @@ -| Path | Action | -|------|--------| -| /self::\*\[not\(@InternalType='Module'\)\] | Error | -| /self::\*\[@InternalType='Module'\] | File | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BinOp'\] | Expression, Binary | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BinOp'\]/\*\[@internalRole\]\[@internalRole='op'\] | Expression, Binary, Operator | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BinOp'\]/\*\[@internalRole\]\[@internalRole='left'\] | Expression, Binary, Left | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BinOp'\]/\*\[@internalRole\]\[@internalRole='right'\] | Expression, Binary, Right | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Eq'\] | Binary, Operator, Equal | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='NotEq'\] | Binary, Operator, Equal, Not | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Lt'\] | Binary, Operator, LessThan | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='LtE'\] | Binary, Operator, LessThanOrEqual | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Gt'\] | Binary, Operator, GreaterThan | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='GtE'\] | Binary, Operator, GreaterThanOrEqual | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Is'\] | Binary, Operator, Identical | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='IsNot'\] | Binary, Operator, Identical, Not | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='In'\] | Binary, Operator, Contains | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='NotIn'\] | Binary, Operator, Contains, Not | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Add'\] | Binary, Operator, Add | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Sub'\] | Binary, Operator, Substract | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Mult'\] | Binary, Operator, Multiply | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Div'\] | Binary, Operator, Divide | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Mod'\] | Binary, Operator, Modulo | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FloorDiv'\] | Binary, Operator, Divide, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Pow'\] | Binary, Operator, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='MatMult'\] | Binary, Operator, Multiply, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='LShift'\] | Binary, Operator, Bitwise, LeftShift | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='RShift'\] | Binary, Operator, Bitwise, RightShift | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BitOr'\] | Binary, Operator, Bitwise, Or | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BitXor'\] | Binary, Operator, Bitwise, Xor | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BitAnd'\] | Binary, Operator, Bitwise, And | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='And'\] | Binary, Operator, Boolean, And | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Or'\] | Binary, Operator, Boolean, Or | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Not'\] | Binary, Operator, Boolean, Not | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='UnaryOp'\] | Binary, Operator, Unary, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Invert'\] | Operator, Unary, Bitwise, Not | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='UAdd'\] | Operator, Unary, Positive | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='USub'\] | Operator, Unary, Negative | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Str'\] | Literal, String, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='StringLiteral'\] | Literal, String, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Bytes'\] | Literal, ByteString, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Num'\] | Literal, Number, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Num'\]/\*\[@internalRole\]\[@internalRole='n'\] | Literal, Number, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BoolLiteral'\] | Literal, Boolean, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='JoinedStr'\] | Literal, String, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='JoinedStr'\]/\*\[@InternalType='FormattedValue'\] | Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='NoneLiteral'\] | Literal, Null, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Set'\] | Literal, Set, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='List'\] | Literal, List, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Dict'\] | Literal, Map, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Dict'\]/\*\[@internalRole\]\[@internalRole='keys'\] | Map, Key | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Dict'\]/\*\[@internalRole\]\[@internalRole='values'\] | Map, Value | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Tuple'\] | Literal, Tuple, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FunctionDef'\] | Function, Declaration, Name, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFunctionDef'\] | Function, Declaration, Name, Identifier, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FunctionDef\.decorator\_list'\] | Function, Declaration, Call, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FunctionDef\.body'\] | Function, Declaration, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@internalRole\]\[@internalRole='arguments'\] | Function, Declaration, Argument, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@internalRole\]\[@internalRole='args'\] | Function, Declaration, Argument, Name, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@internalRole\]\[@internalRole='vararg'\] | Function, Declaration, Argument, ArgsList, Name, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@internalRole\]\[@internalRole='kwarg'\] | Function, Declaration, Argument, ArgsList, Map, Name, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@internalRole\]\[@internalRole='kwonlyargs'\] | Function, Declaration, Argument, ArgsList, Map, Name, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='arguments\.defaults'\] | Function, Declaration, Argument, Value, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFunctionDef\.decorator\_list'\] | Function, Declaration, Call, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFunctionDef\.body'\] | Function, Declaration, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Lambda'\] | Function, Declaration, Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Lambda'\]/\*\[@InternalType='Lambda\.body'\] | Function, Declaration, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Attribute'\] | Identifier, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Attribute'\]/\*\[@InternalType='Name'\] | Identifier, Qualified | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\] | Function, Call, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\]/\*\[@internalRole\]\[@internalRole='args'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\]/\*\[@internalRole\]\[@internalRole='keywords'\] | Call, Argument, Name | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\]/\*\[@internalRole\]\[@internalRole='keywords'\]/\*\[@internalRole\]\[@internalRole='value'\] | Call, Argument, Value | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\]/\*\[@internalRole\]\[@internalRole='func'\]/self::\*\[@InternalType='Name'\] | Call, Callee | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\]/\*\[@internalRole\]\[@internalRole='func'\]/self::\*\[@InternalType='Attribute'\] | Call, Callee | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\]/\*\[@internalRole\]\[@internalRole='func'\]/self::\*\[@InternalType='Attribute'\]/\*\[@internalRole\]\[@internalRole='value'\] | Call, Receiver | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Assign'\] | Binary, Assignment, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Assign'\]/\*\[@internalRole\]\[@internalRole='targets'\] | Left | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Assign'\]/\*\[@internalRole\]\[@internalRole='value'\] | Right | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AugAssign'\] | Operator, Binary, Assignment, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AugAssign'\]/\*\[@internalRole\]\[@internalRole='op'\] | Operator, Binary | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AugAssign'\]/\*\[@internalRole\]\[@internalRole='target'\] | Left | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AugAssign'\]/\*\[@internalRole\]\[@internalRole='value'\] | Right | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Expression'\] | Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Expr'\] | Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Name'\] | Identifier, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='SameLineNoops'\] | Comment | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='PreviousNoops'\] | Whitespace | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='PreviousNoops'\]/\*\[@internalRole\]\[@internalRole='lines'\] | Comment | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='RemainderNoops'\] | Whitespace | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='RemainderNoops'\]/\*\[@internalRole\]\[@internalRole='lines'\] | Comment | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Constant'\] | Identifier, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Try'\] | Try, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Try'\]/\*\[@InternalType='Try\.body'\] | Try, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Try'\]/\*\[@InternalType='Try\.finalbody'\] | Try, Finally | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Try'\]/\*\[@InternalType='Try\.handlers'\] | Try, Catch | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Try'\]/\*\[@InternalType='Try\.orelse'\] | Try, Body, Else | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='TryExcept'\] | Try, Catch, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ExceptHandler'\] | Try, Catch, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ExceptHandler\.name'\] | Try, Catch, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='TryFinally'\] | Try, Finally, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Raise'\] | Throw, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='With'\] | Block, Scope, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='With\.body'\] | Block, Scope, Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='With\.items'\] | Identifier, Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncWith'\] | Block, Scope, Statement, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='withitem'\] | Identifier, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Return'\] | Return, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Break'\] | Break, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Continue'\] | Continue, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Compare'\] | Expression, Binary | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Compare'\]/\*\[@InternalType='Compare\.ops'\] | Expression, Binary, Operator | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Compare'\]/\*\[@internalRole\]\[@internalRole='left'\] | Expression, Binary, Left | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Compare\.comparators'\] | Expression, Binary, Right | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='If'\] | If, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='If'\]/\*\[@InternalType='If\.body'\] | If, Body, Then | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='If'\]/\*\[@internalRole\]\[@internalRole='test'\] | If, Condition | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='If'\]/\*\[@InternalType='If\.orelse'\] | If, Body, Else | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='IfExp'\] | If, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='IfExp'\]/\*\[@internalRole\]\[@internalRole='body'\] | If, Body, Then | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='IfExp'\]/\*\[@internalRole\]\[@internalRole='test'\] | If, Condition | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='IfExp'\]/\*\[@internalRole\]\[@internalRole='orelse'\] | If, Body, Else | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Import'\] | Import, Declaration, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='alias'\] | Import, Pathname, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ImportFrom\.module'\] | Import, Pathname, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='alias\.asname'\] | Import, Alias, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ImportFrom'\] | Import, Declaration, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ClassDef'\] | Type, Declaration, Identifier, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ClassDef'\]/\*\[@InternalType='ClassDef\.decorator\_list'\] | Type, Call, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ClassDef'\]/\*\[@InternalType='ClassDef\.body'\] | Type, Declaration, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ClassDef'\]/\*\[@InternalType='ClassDef\.bases'\] | Type, Declaration, Base | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ClassDef'\]/\*\[@InternalType='ClassDef\.keywords'\] | Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ClassDef'\]/\*\[@InternalType='ClassDef\.keywords'\]/\*\[@InternalType='keyword'\] | Identifier, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='For'\] | For, Iterator, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='For'\]/\*\[@InternalType='For\.body'\] | For, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='For'\]/\*\[@internalRole\]\[@internalRole='iter'\] | For, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='For'\]/\*\[@internalRole\]\[@internalRole='target'\] | For, Update | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='For'\]/\*\[@InternalType='For\.orelse'\] | For, Body, Else | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFor'\] | For, Iterator, Statement, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFor'\]/\*\[@InternalType='AsyncFor\.body'\] | For, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFor'\]/\*\[@internalRole\]\[@internalRole='iter'\] | For, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFor'\]/\*\[@internalRole\]\[@internalRole='target'\] | For, Update | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFor'\]/\*\[@InternalType='AsyncFor\.orelse'\] | For, Body, Else | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='While'\] | While, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='While'\]/\*\[@InternalType='While\.body'\] | While, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='While'\]/\*\[@internalRole\]\[@internalRole='test'\] | While, Condition | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='While'\]/\*\[@InternalType='While\.orelse'\] | While, Body, Else | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Pass'\] | Noop, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Assert'\] | Assert, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Exec'\] | Function, Call, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Exec'\]/\*\[@internalRole\]\[@internalRole='body'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Exec'\]/\*\[@internalRole\]\[@internalRole='globals'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Exec'\]/\*\[@internalRole\]\[@internalRole='locals'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Print'\] | Function, Call, Callee, Identifier, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Print'\]/\*\[@internalRole\]\[@internalRole='dest'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Print'\]/\*\[@internalRole\]\[@internalRole='nl'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Print'\]/\*\[@internalRole\]\[@internalRole='values'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Print'\]/\*\[@internalRole\]\[@internalRole='values'\]/\*\[\*\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AnnAssign'\] | Operator, Binary, Assignment, Comment, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@internalRole\]\[@internalRole='annotation'\] | Comment, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@internalRole\]\[@internalRole='returns'\] | Comment, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Ellipsis'\] | Identifier, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ListComp'\] | List, For, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='DictComp'\] | Map, For, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='SetComp'\] | Set, For, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='comprehension'\] | For, Iterator, Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='comprehension'\]/\*\[@internalRole\]\[@internalRole='iter'\] | For, Update, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='comprehension'\]/\*\[@internalRole\]\[@internalRole='target'\] | For, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='comprehension'\]/\*\[@InternalType='Compare'\] | If, Condition, Expression, Binary | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='comprehension'\]/\*\[@InternalType='Compare'\]/\*\[@InternalType='Compare\.ops'\] | Expression, Binary, Operator | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='comprehension'\]/\*\[@InternalType='Compare'\]/\*\[@internalRole\]\[@internalRole='left'\] | Expression, Binary, Left | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Delete'\] | Statement, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Await'\] | Statement, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Global'\] | Statement, Visibility, World, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Nonlocal'\] | Statement, Visibility, Module, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Yield'\] | Return, Statement, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='YieldFrom'\] | Return, Statement, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Yield'\] | Literal, List, Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Subscript'\] | Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Index'\] | Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Slice'\] | Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ExtSlice'\] | Expression, Incomplete | -======= -| Path | Action | -|------|--------| -| /self::\*\[not\(@InternalType='Module'\)\] | Error | -| /self::\*\[@InternalType='Module'\] | File, Module | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BinOp'\] | Expression, Binary | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BinOp'\]/\*\[@internalRole\]\[@internalRole='op'\] | Expression, Binary, Operator | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BinOp'\]/\*\[@internalRole\]\[@internalRole='left'\] | Expression, Binary, Left | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BinOp'\]/\*\[@internalRole\]\[@internalRole='right'\] | Expression, Binary, Right | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Eq'\] | Binary, Operator, Equal | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='NotEq'\] | Binary, Operator, Equal, Not | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Lt'\] | Binary, Operator, LessThan | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='LtE'\] | Binary, Operator, LessThanOrEqual | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Gt'\] | Binary, Operator, GreaterThan | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='GtE'\] | Binary, Operator, GreaterThanOrEqual | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Is'\] | Binary, Operator, Identical | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='IsNot'\] | Binary, Operator, Identical, Not | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='In'\] | Binary, Operator, Contains | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='NotIn'\] | Binary, Operator, Contains, Not | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Add'\] | Binary, Operator, Add | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Sub'\] | Binary, Operator, Substract | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Mult'\] | Binary, Operator, Multiply | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Div'\] | Binary, Operator, Divide | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Mod'\] | Binary, Operator, Modulo | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FloorDiv'\] | Binary, Operator, Divide, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Pow'\] | Binary, Operator, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='MatMult'\] | Binary, Operator, Multiply, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='LShift'\] | Binary, Operator, Bitwise, LeftShift | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='RShift'\] | Binary, Operator, Bitwise, RightShift | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BitOr'\] | Binary, Operator, Bitwise, Or | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BitXor'\] | Binary, Operator, Bitwise, Xor | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BitAnd'\] | Binary, Operator, Bitwise, And | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='And'\] | Binary, Operator, Boolean, And | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Or'\] | Binary, Operator, Boolean, Or | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Not'\] | Binary, Operator, Boolean, Not | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='UnaryOp'\] | Binary, Operator, Unary, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Invert'\] | Operator, Unary, Bitwise, Not | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='UAdd'\] | Operator, Unary, Positive | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='USub'\] | Operator, Unary, Negative | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Str'\] | Literal, String, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='StringLiteral'\] | Literal, String, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Bytes'\] | Literal, ByteString, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Num'\] | Literal, Number, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Num'\]/\*\[@internalRole\]\[@internalRole='n'\] | Literal, Number, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='BoolLiteral'\] | Literal, Boolean, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='JoinedStr'\] | Literal, String, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='JoinedStr'\]/\*\[@InternalType='FormattedValue'\] | Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='NoneLiteral'\] | Literal, Null, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Set'\] | Literal, Set, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='List'\] | Literal, List, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Dict'\] | Literal, Map, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Dict'\]/\*\[@internalRole\]\[@internalRole='keys'\] | Map, Key | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Dict'\]/\*\[@internalRole\]\[@internalRole='values'\] | Map, Value | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Tuple'\] | Literal, Tuple, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FunctionDef'\] | Function, Declaration, Name, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FunctionDef'\]/\*\[@InternalType='arguments'\] | Function, Declaration, Incomplete, Argument | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FunctionDef'\]/\*\[@InternalType='arguments'\]/\*\[@internalRole\]\[@internalRole='args'\] | Function, Declaration, Argument, Name, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FunctionDef'\]/\*\[@InternalType='arguments'\]/\*\[@internalRole\]\[@internalRole='vararg'\] | Function, Declaration, Argument, ArgsList, Name, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FunctionDef'\]/\*\[@InternalType='arguments'\]/\*\[@internalRole\]\[@internalRole='kwarg'\] | Function, Declaration, Argument, ArgsList, Map, Name, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FunctionDef'\]/\*\[@InternalType='arguments'\]/\*\[@internalRole\]\[@internalRole='kwonlyargs'\] | Function, Declaration, Argument, ArgsList, Map, Name, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFunctionDef'\] | Function, Declaration, Name, Identifier, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FunctionDef\.decorator\_list'\] | Function, Declaration, Call, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='FunctionDef\.body'\] | Function, Declaration, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='arguments\.defaults'\] | Function, Declaration, Argument, Value, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFunctionDef\.decorator\_list'\] | Function, Declaration, Call, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFunctionDef\.body'\] | Function, Declaration, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Lambda'\] | Function, Declaration, Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Lambda'\]/\*\[@InternalType='Lambda\.body'\] | Function, Declaration, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Attribute'\] | Identifier, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Attribute'\]/\*\[@InternalType='Name'\] | Identifier, Qualified | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\] | Function, Call, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\]/\*\[@internalRole\]\[@internalRole='args'\] | Function, Call, Positional, Argument, Name | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\]/\*\[@internalRole\]\[@internalRole='keywords'\] | Function, Call, Argument, Name | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\]/\*\[@internalRole\]\[@internalRole='keywords'\]/\*\[@internalRole\]\[@internalRole='value'\] | Argument, Value | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\]/\*\[@internalRole\]\[@internalRole='func'\]/self::\*\[@InternalType='Name'\] | Call, Callee | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\]/\*\[@internalRole\]\[@internalRole='func'\]/self::\*\[@InternalType='Attribute'\] | Call, Callee | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Call'\]/\*\[@internalRole\]\[@internalRole='func'\]/self::\*\[@InternalType='Attribute'\]/\*\[@internalRole\]\[@internalRole='value'\] | Call, Receiver | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Assign'\] | Binary, Assignment, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Assign'\]/\*\[@internalRole\]\[@internalRole='targets'\] | Left | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Assign'\]/\*\[@internalRole\]\[@internalRole='value'\] | Right | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AugAssign'\] | Operator, Binary, Assignment, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AugAssign'\]/\*\[@internalRole\]\[@internalRole='op'\] | Operator, Binary | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AugAssign'\]/\*\[@internalRole\]\[@internalRole='target'\] | Left | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AugAssign'\]/\*\[@internalRole\]\[@internalRole='value'\] | Right | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Expression'\] | Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Expr'\] | Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Name'\] | Identifier, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='SameLineNoops'\] | Comment | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='PreviousNoops'\] | Whitespace | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='PreviousNoops'\]/\*\[@internalRole\]\[@internalRole='lines'\] | Comment | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='RemainderNoops'\] | Whitespace | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='RemainderNoops'\]/\*\[@internalRole\]\[@internalRole='lines'\] | Comment | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Constant'\] | Identifier, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Try'\] | Try, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Try'\]/\*\[@InternalType='Try\.body'\] | Try, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Try'\]/\*\[@InternalType='Try\.finalbody'\] | Try, Finally | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Try'\]/\*\[@InternalType='Try\.handlers'\] | Try, Catch | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Try'\]/\*\[@InternalType='Try\.orelse'\] | Try, Body, Else | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='TryExcept'\] | Try, Catch, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ExceptHandler'\] | Try, Catch, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ExceptHandler\.name'\] | Try, Catch, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='TryFinally'\] | Try, Finally, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Raise'\] | Throw, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='With'\] | Block, Scope, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='With\.body'\] | Block, Scope, Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='With\.items'\] | Identifier, Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncWith'\] | Block, Scope, Statement, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='withitem'\] | Identifier, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Return'\] | Return, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Break'\] | Break, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Continue'\] | Continue, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Compare'\] | Expression, Binary | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Compare'\]/\*\[@InternalType='Compare\.ops'\] | Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Compare'\]/\*\[@internalRole\]\[@internalRole='left'\] | Expression, Left | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Compare'\]/\*\[@InternalType='Compare\.comparators'\] | Expression, Right | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='If'\] | If, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='If'\]/\*\[@InternalType='If\.body'\] | If, Body, Then | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='If'\]/\*\[@internalRole\]\[@internalRole='test'\] | If, Condition | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='If'\]/\*\[@InternalType='If\.orelse'\] | If, Body, Else | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='IfExp'\] | If, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='IfExp'\]/\*\[@internalRole\]\[@internalRole='body'\] | If, Body, Then | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='IfExp'\]/\*\[@internalRole\]\[@internalRole='test'\] | If, Condition | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='IfExp'\]/\*\[@internalRole\]\[@internalRole='orelse'\] | If, Body, Else | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Import'\] | Import, Declaration, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='alias'\] | Import, Pathname, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ImportFrom\.module'\] | Import, Pathname, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='alias\.asname'\] | Import, Alias, Identifier | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ImportFrom'\] | Import, Declaration, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ClassDef'\] | Type, Declaration, Identifier, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ClassDef'\]/\*\[@InternalType='ClassDef\.decorator\_list'\] | Type, Call, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ClassDef'\]/\*\[@InternalType='ClassDef\.body'\] | Type, Declaration, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ClassDef'\]/\*\[@InternalType='ClassDef\.bases'\] | Type, Declaration, Base | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ClassDef'\]/\*\[@InternalType='ClassDef\.keywords'\] | Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ClassDef'\]/\*\[@InternalType='ClassDef\.keywords'\]/\*\[@InternalType='keyword'\] | Identifier, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='For'\] | For, Iterator, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='For'\]/\*\[@InternalType='For\.body'\] | For, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='For'\]/\*\[@internalRole\]\[@internalRole='iter'\] | For, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='For'\]/\*\[@internalRole\]\[@internalRole='target'\] | For, Update | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='For'\]/\*\[@InternalType='For\.orelse'\] | For, Body, Else | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFor'\] | For, Iterator, Statement, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFor'\]/\*\[@InternalType='AsyncFor\.body'\] | For, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFor'\]/\*\[@internalRole\]\[@internalRole='iter'\] | For, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFor'\]/\*\[@internalRole\]\[@internalRole='target'\] | For, Update | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AsyncFor'\]/\*\[@InternalType='AsyncFor\.orelse'\] | For, Body, Else | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='While'\] | While, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='While'\]/\*\[@InternalType='While\.body'\] | While, Body | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='While'\]/\*\[@internalRole\]\[@internalRole='test'\] | While, Condition | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='While'\]/\*\[@InternalType='While\.orelse'\] | While, Body, Else | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Pass'\] | Noop, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Assert'\] | Assert, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Exec'\] | Function, Call, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Exec'\]/\*\[@internalRole\]\[@internalRole='body'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Exec'\]/\*\[@internalRole\]\[@internalRole='globals'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Exec'\]/\*\[@internalRole\]\[@internalRole='locals'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Print'\] | Function, Call, Callee, Identifier, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Print'\]/\*\[@internalRole\]\[@internalRole='dest'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Print'\]/\*\[@internalRole\]\[@internalRole='nl'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Print'\]/\*\[@internalRole\]\[@internalRole='values'\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Print'\]/\*\[@internalRole\]\[@internalRole='values'\]/\*\[\*\] | Call, Argument, Positional | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='AnnAssign'\] | Operator, Binary, Assignment, Comment, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@internalRole\]\[@internalRole='annotation'\] | Comment, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@internalRole\]\[@internalRole='returns'\] | Comment, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Ellipsis'\] | Identifier, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ListComp'\] | List, For, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='DictComp'\] | Map, For, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='SetComp'\] | Set, For, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='comprehension'\] | For, Iterator, Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='comprehension'\]/\*\[@internalRole\]\[@internalRole='iter'\] | For, Update, Statement | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='comprehension'\]/\*\[@internalRole\]\[@internalRole='target'\] | For, Expression | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='comprehension'\]/\*\[@InternalType='Compare'\] | If, Condition | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Delete'\] | Statement, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Await'\] | Statement, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Global'\] | Statement, Visibility, World, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Nonlocal'\] | Statement, Visibility, Module, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Yield'\] | Return, Statement, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='YieldFrom'\] | Return, Statement, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Yield'\] | Literal, List, Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Subscript'\] | Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Index'\] | Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='Slice'\] | Expression, Incomplete | -| /self::\*\[@InternalType='Module'\]//\*\[@InternalType='ExtSlice'\] | Expression, Incomplete | diff --git a/driver/normalizer/annotation.go b/driver/normalizer/annotation.go index e6230b4f..5e635ce2 100644 --- a/driver/normalizer/annotation.go +++ b/driver/normalizer/annotation.go @@ -113,6 +113,8 @@ var AnnotationRules = On(Any).Self( On(HasInternalRole("n")).Roles(uast.Literal, uast.Number, uast.Expression), ), On(pyast.BoolLiteral).Roles(uast.Literal, uast.Boolean, uast.Expression, uast.Primitive), + // another grouping node like "arguments" + On(pyast.BoolOp).Roles(uast.Expression, uast.Boolean, uast.Incomplete), On(pyast.JoinedStr).Roles(uast.Literal, uast.String, uast.Expression, uast.Primitive).Children( On(pyast.FormattedValue).Roles(uast.Expression, uast.Incomplete), ), @@ -135,7 +137,14 @@ var AnnotationRules = On(Any).Self( On(HasInternalRole("kwonlyargs")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), ), ), - On(pyast.AsyncFunctionDef).Roles(uast.Function, uast.Declaration, uast.Name, uast.Identifier, uast.Incomplete), + On(pyast.AsyncFunctionDef).Roles(uast.Function, uast.Declaration, uast.Name, uast.Identifier, uast.Incomplete).Children( + On(pyast.Arguments).Roles(uast.Function, uast.Declaration, uast.Incomplete, uast.Argument).Children( + On(HasInternalRole("args")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.Name, uast.Identifier), + On(HasInternalRole("vararg")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Name, uast.Identifier), + On(HasInternalRole("kwarg")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), + On(HasInternalRole("kwonlyargs")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), + ), + ), On(pyast.FuncDecorators).Roles(uast.Function, uast.Declaration, uast.Call, uast.Incomplete), On(pyast.FuncDefBody).Roles(uast.Function, uast.Declaration, uast.Body), // Default arguments: Python's AST puts default arguments on a sibling list to the one of @@ -150,6 +159,12 @@ var AnnotationRules = On(Any).Self( // FIXME: change to Function, Declaration, ArgumentS once the PR has been merged On(pyast.Lambda).Roles(uast.Function, uast.Declaration, uast.Expression, uast.Incomplete).Children( On(pyast.LambdaBody).Roles(uast.Function, uast.Declaration, uast.Body), + On(pyast.Arguments).Roles(uast.Function, uast.Declaration, uast.Incomplete, uast.Argument).Children( + On(HasInternalRole("args")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.Name, uast.Identifier), + On(HasInternalRole("vararg")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Name, uast.Identifier), + On(HasInternalRole("kwarg")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), + On(HasInternalRole("kwonlyargs")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), + ), ), On(pyast.Attribute).Roles(uast.Identifier, uast.Expression).Children( diff --git a/fixtures/functiondef_simple.py.uast b/fixtures/functiondef_simple.py.uast index 25cd0113..2695a379 100644 --- a/fixtures/functiondef_simple.py.uast +++ b/fixtures/functiondef_simple.py.uast @@ -385,7 +385,7 @@ Module { . . . } . . . Children: { . . . . 0: arguments { -. . . . . Roles: Unannotated +. . . . . Roles: Function,Declaration,Incomplete,Argument . . . . . Properties: { . . . . . . internalRole: args . . . . . . kwarg: @@ -393,7 +393,7 @@ Module { . . . . . } . . . . . Children: { . . . . . . 0: arg { -. . . . . . . Roles: Unannotated +. . . . . . . Roles: Function,Declaration,Argument,Name,Identifier . . . . . . . TOKEN "arg1" . . . . . . . StartPosition: { . . . . . . . . Offset: 125 diff --git a/fixtures/issue_server101.py.uast b/fixtures/issue_server101.py.uast index 8f27b730..b57a0290 100644 --- a/fixtures/issue_server101.py.uast +++ b/fixtures/issue_server101.py.uast @@ -2180,7 +2180,7 @@ pyid to C{bool}." . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . 2: BoolOp { -. . . . . . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . . . . . Offset: 4120 . . . . . . . . . . . . . . . . . . Line: 107 @@ -2339,7 +2339,7 @@ pyid to C{bool}." . . . . . . . . . . . . . } . . . . . . . . . . . . } . . . . . . . . . . . . 2: BoolOp { -. . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . Offset: 3899 . . . . . . . . . . . . . . Line: 102 @@ -2566,7 +2566,7 @@ pyid to C{bool}." . . . . . . . . . } . . . . . . . . } . . . . . . . . 2: BoolOp { -. . . . . . . . . Roles: If,Condition +. . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . StartPosition: { . . . . . . . . . . Offset: 3779 . . . . . . . . . . Line: 100 @@ -3150,7 +3150,7 @@ pyid to C{bool}." . . . . . . . . . . . . . } . . . . . . . . . . . . } . . . . . . . . . . . . 1: BoolOp { -. . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . Offset: 4605 . . . . . . . . . . . . . . Line: 120 @@ -4058,7 +4058,7 @@ pyid to C{bool}." . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: BoolOp { -. . . . . . . . . Roles: If,Condition +. . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . StartPosition: { . . . . . . . . . . Offset: 5124 . . . . . . . . . . Line: 134 @@ -4468,7 +4468,7 @@ pyid to C{bool}." . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: BoolOp { -. . . . . . . . . Roles: If,Condition +. . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . StartPosition: { . . . . . . . . . . Offset: 5291 . . . . . . . . . . Line: 138 @@ -5024,7 +5024,7 @@ pyid to C{bool}." . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: BoolOp { -. . . . . . . . . Roles: If,Condition +. . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . StartPosition: { . . . . . . . . . . Offset: 5421 . . . . . . . . . . Line: 141 @@ -6619,7 +6619,7 @@ pyid to C{bool}." . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . 1: BoolOp { -. . . . . . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . . . . . Offset: 6974 . . . . . . . . . . . . . . . . . . Line: 175 @@ -13238,7 +13238,7 @@ pyid to C{bool}." . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . 2: BoolOp { -. . . . . . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . . . . . Offset: 11161 . . . . . . . . . . . . . . . . . . Line: 282 @@ -13417,7 +13417,7 @@ pyid to C{bool}." . . . . . . . . . . . . . } . . . . . . . . . . . . } . . . . . . . . . . . . 2: BoolOp { -. . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . Offset: 10503 . . . . . . . . . . . . . . Line: 270 @@ -13428,7 +13428,7 @@ pyid to C{bool}." . . . . . . . . . . . . . } . . . . . . . . . . . . . Children: { . . . . . . . . . . . . . . 0: BoolOp { -. . . . . . . . . . . . . . . Roles: Unannotated +. . . . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete . . . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . . . Offset: 10504 . . . . . . . . . . . . . . . . Line: 270 @@ -13583,7 +13583,7 @@ pyid to C{bool}." . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . } . . . . . . . . . . . . . . 1: BoolOp { -. . . . . . . . . . . . . . . Roles: Unannotated +. . . . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete . . . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . . . Offset: 10593 . . . . . . . . . . . . . . . . Line: 272 @@ -17516,7 +17516,7 @@ pyid to C{bool}." . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: BoolOp { -. . . . . . . . . Roles: If,Condition +. . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . StartPosition: { . . . . . . . . . . Offset: 15326 . . . . . . . . . . Line: 384 @@ -18115,7 +18115,7 @@ pyid to C{bool}." . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . 1: BoolOp { -. . . . . . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . . . . . Offset: 15717 . . . . . . . . . . . . . . . . . . Line: 392 @@ -22242,7 +22242,7 @@ pyid to C{bool}." . . . . . . . . . . . . . } . . . . . . . . . . . . } . . . . . . . . . . . . 1: BoolOp { -. . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . Offset: 18014 . . . . . . . . . . . . . . Line: 450 @@ -32161,7 +32161,7 @@ pyid to C{bool}." . . . . . . . . . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . . . . . . . . . 2: BoolOp { -. . . . . . . . . . . . . . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . . . . . . . . . . . . . Offset: 25811 . . . . . . . . . . . . . . . . . . . . . . . . . . Line: 644 @@ -32363,7 +32363,7 @@ pyid to C{bool}." . . . . . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . . . . . 2: BoolOp { -. . . . . . . . . . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . . . . . . . . . Offset: 25545 . . . . . . . . . . . . . . . . . . . . . . Line: 639 @@ -32567,7 +32567,7 @@ pyid to C{bool}." . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . 2: BoolOp { -. . . . . . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . . . . . Offset: 25192 . . . . . . . . . . . . . . . . . . Line: 633 @@ -33640,7 +33640,7 @@ pyid to C{bool}." . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: BoolOp { -. . . . . . . . . Roles: If,Condition +. . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . StartPosition: { . . . . . . . . . . Offset: 26372 . . . . . . . . . . Line: 660 @@ -36128,7 +36128,7 @@ pyid to C{bool}." . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . 2: BoolOp { -. . . . . . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . . . . . Offset: 27328 . . . . . . . . . . . . . . . . . . Line: 692 @@ -37202,7 +37202,7 @@ pyid to C{bool}." . . . . . . . . . . . . . } . . . . . . . . . . . . } . . . . . . . . . . . . 1: BoolOp { -. . . . . . . . . . . . . Roles: If,Condition +. . . . . . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . . . . . StartPosition: { . . . . . . . . . . . . . . Offset: 28512 . . . . . . . . . . . . . . Line: 724 @@ -51241,7 +51241,7 @@ pyid to C{bool}." . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: BoolOp { -. . . . . . . . . Roles: If,Condition +. . . . . . . . . Roles: Expression,Boolean,Incomplete,If,Condition . . . . . . . . . StartPosition: { . . . . . . . . . . Offset: 37438 . . . . . . . . . . Line: 953 diff --git a/fixtures/lambda.py.uast b/fixtures/lambda.py.uast index 70e425f6..c2dd22a1 100644 --- a/fixtures/lambda.py.uast +++ b/fixtures/lambda.py.uast @@ -32,7 +32,7 @@ Module { . . . . . } . . . . . Children: { . . . . . . 0: arguments { -. . . . . . . Roles: Unannotated +. . . . . . . Roles: Function,Declaration,Incomplete,Argument . . . . . . . Properties: { . . . . . . . . internalRole: args . . . . . . . . kwarg: @@ -40,7 +40,7 @@ Module { . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: arg { -. . . . . . . . . Roles: Unannotated +. . . . . . . . . Roles: Function,Declaration,Argument,Name,Identifier . . . . . . . . . TOKEN "x" . . . . . . . . . StartPosition: { . . . . . . . . . . Offset: 7 From e4fb9ebaec033a6ace139bcb2ef7e44d24b87cd8 Mon Sep 17 00:00:00 2001 From: Juanjo Alvarez Date: Wed, 4 Oct 2017 18:30:05 +0200 Subject: [PATCH 2/2] Factorize the common annotation for function children arguments Signed-off-by: Juanjo Alvarez --- README.md | 2 +- driver/normalizer/annotation.go | 33 +++++++++++---------------------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 2de9e91e..e986f404 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To initialize the build system execute: `bblfsh-sdk prepare-build`, at the root To execute the tests just execute `make test`, this will execute the test over the native and the go components of the driver. Use `make test-native` to run the test only over the native component or `make test-driver` to run the test just over the go component. The build is done executing `make build`. To evaluate the result using a docker container, execute: -`docker run -it bblfsh/python-driver:dev-` +`docker run -it bblfsh/python-driver:dev--dirty` License diff --git a/driver/normalizer/annotation.go b/driver/normalizer/annotation.go index 5e635ce2..f026b38d 100644 --- a/driver/normalizer/annotation.go +++ b/driver/normalizer/annotation.go @@ -48,6 +48,14 @@ var Transformers = []transformer.Tranformer{ positioner.NewFillOffsetFromLineCol(), } +// Common for FunctionDef, AsyncFunctionDef and Lambda +var argumentsAnn = On(pyast.Arguments).Roles(uast.Function, uast.Declaration, uast.Incomplete, uast.Argument).Children( + On(HasInternalRole("args")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.Name, uast.Identifier), + On(HasInternalRole("vararg")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Name, uast.Identifier), + On(HasInternalRole("kwarg")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), + On(HasInternalRole("kwonlyargs")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), +) + // AnnotationRules describes how a UAST should be annotated with `uast.Role`. // // https://godoc.org/gopkg.in/bblfsh/sdk.v1/uast/ann @@ -129,22 +137,8 @@ var AnnotationRules = On(Any).Self( // FIXME: the FunctionDeclarationReceiver is not set for methods; it should be taken from the parent // Type node Token (2 levels up) but the SDK doesn't allow this - On(pyast.FunctionDef).Roles(uast.Function, uast.Declaration, uast.Name, uast.Identifier).Children( - On(pyast.Arguments).Roles(uast.Function, uast.Declaration, uast.Incomplete, uast.Argument).Children( - On(HasInternalRole("args")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.Name, uast.Identifier), - On(HasInternalRole("vararg")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Name, uast.Identifier), - On(HasInternalRole("kwarg")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), - On(HasInternalRole("kwonlyargs")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), - ), - ), - On(pyast.AsyncFunctionDef).Roles(uast.Function, uast.Declaration, uast.Name, uast.Identifier, uast.Incomplete).Children( - On(pyast.Arguments).Roles(uast.Function, uast.Declaration, uast.Incomplete, uast.Argument).Children( - On(HasInternalRole("args")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.Name, uast.Identifier), - On(HasInternalRole("vararg")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Name, uast.Identifier), - On(HasInternalRole("kwarg")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), - On(HasInternalRole("kwonlyargs")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), - ), - ), + On(pyast.FunctionDef).Roles(uast.Function, uast.Declaration, uast.Name, uast.Identifier).Children(argumentsAnn), + On(pyast.AsyncFunctionDef).Roles(uast.Function, uast.Declaration, uast.Name, uast.Identifier, uast.Incomplete).Children(argumentsAnn), On(pyast.FuncDecorators).Roles(uast.Function, uast.Declaration, uast.Call, uast.Incomplete), On(pyast.FuncDefBody).Roles(uast.Function, uast.Declaration, uast.Body), // Default arguments: Python's AST puts default arguments on a sibling list to the one of @@ -159,12 +153,7 @@ var AnnotationRules = On(Any).Self( // FIXME: change to Function, Declaration, ArgumentS once the PR has been merged On(pyast.Lambda).Roles(uast.Function, uast.Declaration, uast.Expression, uast.Incomplete).Children( On(pyast.LambdaBody).Roles(uast.Function, uast.Declaration, uast.Body), - On(pyast.Arguments).Roles(uast.Function, uast.Declaration, uast.Incomplete, uast.Argument).Children( - On(HasInternalRole("args")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.Name, uast.Identifier), - On(HasInternalRole("vararg")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Name, uast.Identifier), - On(HasInternalRole("kwarg")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), - On(HasInternalRole("kwonlyargs")).Roles(uast.Function, uast.Declaration, uast.Argument, uast.ArgsList, uast.Map, uast.Name, uast.Identifier), - ), + argumentsAnn, ), On(pyast.Attribute).Roles(uast.Identifier, uast.Expression).Children(