Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 0 additions & 183 deletions ANNOTATION.md

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions driver/normalizer/annotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ var AnnotationRules = On(Any).Self(
SimpleIdentifier),
On(HasInternalType(pyast.AsyncFunctionDef)).Roles(FunctionDeclaration,
FunctionDeclarationName, SimpleIdentifier, Incomplete),
On(HasInternalType("FunctionDef.decorator_list")).Roles(Call, SimpleIdentifier, Incomplete),
On(HasInternalType("FunctionDef.decorator_list")).Roles(Call, Incomplete),
On(HasInternalType("FunctionDef.body")).Roles(FunctionDeclarationBody),
// FIXME: change to FunctionDeclarationArgumentS once the PR has been merged
On(HasInternalType(pyast.Arguments)).Roles(FunctionDeclarationArgument, Incomplete).Children(
Expand All @@ -132,12 +132,11 @@ var AnnotationRules = On(Any).Self(
// TODO: create an issue for the SDK
On(HasInternalType("arguments.defaults")).Roles(FunctionDeclarationArgumentDefaultValue, Incomplete),
On(HasInternalType("arguments.keywords")).Roles(FunctionDeclarationArgumentDefaultValue, Incomplete),
On(HasInternalType("AsyncFunctionDef.decorator_list")).Roles(Call, SimpleIdentifier, Incomplete),
On(HasInternalType("AsyncFunctionDef.decorator_list")).Roles(Call, Incomplete),
On(HasInternalType("AsyncFunctionDef.body")).Roles(FunctionDeclarationBody),
// FIXME: change to FunctionDeclarationArgumentS once the PR has been merged
),
On(HasInternalType(pyast.Lambda)).Roles(FunctionDeclaration, SimpleIdentifier, Expression,
Incomplete).Children(
On(HasInternalType(pyast.Lambda)).Roles(FunctionDeclaration, Expression, Incomplete).Children(
On(HasInternalType("Lambda.body")).Roles(FunctionDeclarationBody),
// FIXME: change to FunctionDeclarationArgumentS once the PR has been merged
On(HasInternalType(pyast.Arguments)).Roles(FunctionDeclarationArgument, Incomplete).Children(
Expand All @@ -156,9 +155,9 @@ var AnnotationRules = On(Any).Self(
// defaults [2,3]
// TODO: create an issue for the SDK
On(HasInternalType("arguments.defaults")).Roles(FunctionDeclarationArgumentDefaultValue,
SimpleIdentifier, Incomplete),
Incomplete),
On(HasInternalType("arguments.keywords")).Roles(FunctionDeclarationArgumentDefaultValue,
SimpleIdentifier, Incomplete),
Incomplete),
),
),

Expand Down Expand Up @@ -317,7 +316,7 @@ var AnnotationRules = On(Any).Self(

// Python very odd ellipsis operator. Has a special rule in tonoder synthetic tokens
// map to load it with the token "PythonEllipsisOperator" and gets the role SimpleIdentifier
On(HasInternalType(pyast.Ellipsis)).Roles(SimpleIdentifier),
On(HasInternalType(pyast.Ellipsis)).Roles(SimpleIdentifier, Incomplete),

// List/Map/Set comprehensions. We map the "for x in y" to ForEach roles and the
// "if something" to If* roles. FIXME: missing the top comprehension roles in the UAST, change
Expand Down
4 changes: 2 additions & 2 deletions tests/classdef.py.uast
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ Module {
. . . . . . . . . }
. . . . . . . . }
. . . . . . . . 2: FunctionDef.decorator_list {
. . . . . . . . . Roles: Call,SimpleIdentifier,Incomplete
. . . . . . . . . Roles: Call,Incomplete
. . . . . . . . . Properties: {
. . . . . . . . . . promotedPropertyList: true
. . . . . . . . . }
Expand Down Expand Up @@ -667,7 +667,7 @@ Module {
. . . . . . . . . }
. . . . . . . . }
. . . . . . . . 2: FunctionDef.decorator_list {
. . . . . . . . . Roles: Call,SimpleIdentifier,Incomplete
. . . . . . . . . Roles: Call,Incomplete
. . . . . . . . . Properties: {
. . . . . . . . . . promotedPropertyList: true
. . . . . . . . . }
Expand Down
2 changes: 1 addition & 1 deletion tests/ellipsis.py.uast
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Module {
. . . . . }
. . . . . Children: {
. . . . . . 0: Ellipsis {
. . . . . . . Roles: SimpleIdentifier
. . . . . . . Roles: SimpleIdentifier,Incomplete
. . . . . . . TOKEN "PythonEllipsisOperator"
. . . . . . . StartPosition: {
. . . . . . . . Offset: 1
Expand Down
4 changes: 2 additions & 2 deletions tests/functiondef_decorated.py.uast
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Module {
. . . . . }
. . . . }
. . . . 2: FunctionDef.decorator_list {
. . . . . Roles: Call,SimpleIdentifier,Incomplete
. . . . . Roles: Call,Incomplete
. . . . . Properties: {
. . . . . . promotedPropertyList: true
. . . . . }
Expand Down Expand Up @@ -180,7 +180,7 @@ Module {
. . . . . }
. . . . }
. . . . 2: FunctionDef.decorator_list {
. . . . . Roles: Call,SimpleIdentifier,Incomplete
. . . . . Roles: Call,Incomplete
. . . . . Properties: {
. . . . . . promotedPropertyList: true
. . . . . }
Expand Down
2 changes: 1 addition & 1 deletion tests/lambda.py.uast
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Module {
. . . }
. . . Children: {
. . . . 0: Lambda {
. . . . . Roles: FunctionDeclaration,SimpleIdentifier,Expression,Incomplete
. . . . . Roles: FunctionDeclaration,Expression,Incomplete
. . . . . StartPosition: {
. . . . . . Offset: 0
. . . . . . Line: 1
Expand Down