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

Commit 6b92e7a

Browse files
authored
Merge pull request #90 from juanjux/feature/bip003_roles
Upgrades for UAST/SDK v1
2 parents d3b389e + a28480f commit 6b92e7a

File tree

76 files changed

+2932
-1415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2932
-1415
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
- docker
88

99
before_script:
10-
- go get -v gopkg.in/bblfsh/sdk.v0/...
10+
- go get -v gopkg.in/bblfsh/sdk.v1/...
1111
- bblfsh-sdk prepare-build .
1212
- go get -v -t ./...
1313

ANNOTATION.md

Lines changed: 150 additions & 153 deletions
Large diffs are not rendered by default.

driver/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
import (
4-
"gopkg.in/bblfsh/sdk.v0/protocol/driver"
4+
"gopkg.in/bblfsh/sdk.v1/protocol/driver"
55

66
"github.com/bblfsh/python-driver/driver/normalizer"
77
)

driver/normalizer/annotation.go

Lines changed: 230 additions & 256 deletions
Large diffs are not rendered by default.

driver/normalizer/annotation_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"testing"
88

99
"github.com/stretchr/testify/require"
10-
"gopkg.in/bblfsh/sdk.v0/uast"
10+
"gopkg.in/bblfsh/sdk.v1/uast"
1111
)
1212

1313
var (

driver/normalizer/parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package normalizer
22

33
import (
4-
"gopkg.in/bblfsh/sdk.v0/protocol/driver"
5-
"gopkg.in/bblfsh/sdk.v0/protocol/native"
4+
"gopkg.in/bblfsh/sdk.v1/protocol/driver"
5+
"gopkg.in/bblfsh/sdk.v1/protocol/native"
66
)
77

88
var ToNoder = &native.ObjectToNoder{

driver/normalizer/pyast/pyast.go

Lines changed: 161 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,172 @@
11
// Package pyast defines constants from Python 2 and 3 AST.
22
package pyast
33

4-
// GENERATED BY python-driver/native/gogen/gogen.py
5-
// DO NOT EDIT
4+
import "gopkg.in/bblfsh/sdk.v1/uast/ann"
65

76
// Python 2+3 AST node types.
8-
// FIXME: ColumnKey? (col_offset in Python)
97
// This includes all classes extending from _ast.AST for both Python 2 and 3.
108
// See:
119
// https://docs.python.org/3.6/library/ast.html#abstract-grammar
1210
// https://docs.python.org/2.7/library/ast.html#abstract-grammar
1311

14-
const (
15-
Add = "Add"
16-
Alias = "alias"
17-
And = "And"
18-
AnnAssign = "AnnAssign"
19-
Annotation = "Annotation"
20-
Arg = "arg"
21-
Arguments = "arguments"
22-
Assert = "Assert"
23-
Assign = "Assign"
24-
AsyncFor = "AsyncFor"
25-
AsyncFunctionDef = "AsyncFunctionDef"
26-
AsyncWith = "AsyncWith"
27-
Attribute = "Attribute"
28-
AugAssign = "AugAssign"
29-
AugLoad = "AugLoad"
30-
AugStore = "AugStore"
31-
Await = "Await"
32-
BinOp = "BinOp"
33-
BitAnd = "BitAnd"
34-
BitOr = "BitOr"
35-
BitXor = "BitXor"
36-
BoolLiteral = "BoolLiteral"
37-
BoolOp = "BoolOp"
38-
BoolopInternal = "boolop"
39-
Break = "Break"
40-
Bytes = "Bytes"
41-
Call = "Call"
42-
ClassDef = "ClassDef"
43-
Cmpop = "cmpop"
44-
Compare = "Compare"
45-
Comprehension = "comprehension"
46-
Constant = "Constant"
47-
Continue = "Continue"
48-
Del = "Del"
49-
Delete = "Delete"
50-
Dict = "Dict"
51-
DictComp = "DictComp"
52-
Div = "Div"
53-
Ellipsis = "Ellipsis"
54-
Eq = "Eq"
55-
ExceptHandler = "ExceptHandler"
56-
ExcepthandlerInternal = "excepthandler"
57-
Exec = "Exec"
58-
Expr = "Expr"
59-
ExprInternal = "expr"
60-
Expr_context = "expr_context"
61-
Expression = "Expression"
62-
ExtSlice = "ExtSlice"
63-
FloorDiv = "FloorDiv"
64-
For = "For"
65-
FormattedValue = "FormattedValue"
66-
FunctionDef = "FunctionDef"
67-
GeneratorExp = "GeneratorExp"
68-
Global = "Global"
69-
Gt = "Gt"
70-
GtE = "GtE"
71-
If = "If"
72-
IfExp = "IfExp"
73-
Import = "Import"
74-
ImportFrom = "ImportFrom"
75-
In = "In"
76-
Index = "Index"
77-
Interactive = "Interactive"
78-
Invert = "Invert"
79-
Is = "Is"
80-
IsNot = "IsNot"
81-
JoinedStr = "JoinedStr"
82-
Keyword = "keyword"
83-
LShift = "LShift"
84-
Lambda = "Lambda"
85-
List = "List"
86-
ListComp = "ListComp"
87-
Load = "Load"
88-
Lt = "Lt"
89-
LtE = "LtE"
90-
MatMult = "MatMult"
91-
Mod = "Mod"
92-
ModInternal = "mod"
93-
Module = "Module"
94-
Mult = "Mult"
95-
Name = "Name"
96-
NameConstant = "NameConstant"
97-
NoneLiteral = "NoneLiteral"
98-
Nonlocal = "Nonlocal"
99-
NoopLine = "NoopLine"
100-
Noop_lineInternal = "noop_line"
101-
Not = "Not"
102-
NotEq = "NotEq"
103-
NotIn = "NotIn"
104-
Num = "Num"
105-
Operator = "operator"
106-
Or = "Or"
107-
Param = "Param"
108-
Pass = "Pass"
109-
Pow = "Pow"
110-
PreviousNoops = "PreviousNoops"
111-
Print = "Print"
112-
RShift = "RShift"
113-
Raise = "Raise"
114-
RemainderNoops = "RemainderNoops"
115-
Repr = "Repr"
116-
Return = "Return"
117-
Returns = "returns"
118-
SameLineNoops = "SameLineNoops"
119-
Set = "Set"
120-
SetComp = "SetComp"
121-
Slice = "Slice"
122-
SliceInternal = "slice"
123-
Starred = "Starred"
124-
Stmt = "stmt"
125-
Store = "Store"
126-
Str = "Str"
127-
Sub = "Sub"
128-
Subscript = "Subscript"
129-
Suite = "Suite"
130-
Try = "Try"
131-
TryExcept = "TryExcept"
132-
TryFinally = "TryFinally"
133-
Tuple = "Tuple"
134-
UAdd = "UAdd"
135-
USub = "USub"
136-
UnaryOp = "UnaryOp"
137-
UnaryopInternal = "unaryop"
138-
While = "While"
139-
With = "With"
140-
Withitem = "withitem"
141-
Yield = "Yield"
142-
YieldFrom = "YieldFrom"
12+
var (
13+
Add = ann.HasInternalType("Add")
14+
Alias = ann.HasInternalType("alias")
15+
AliasAsName = ann.HasInternalType("alias.asname")
16+
And = ann.HasInternalType("And")
17+
AnnAssign = ann.HasInternalType("AnnAssign")
18+
Annotation = ann.HasInternalType("Annotation")
19+
Arg = ann.HasInternalType("arg")
20+
ArgumentDefaults = ann.HasInternalType("arguments.defaults")
21+
Arguments = ann.HasInternalType("arguments")
22+
Assert = ann.HasInternalType("Assert")
23+
Assign = ann.HasInternalType("Assign")
24+
AsyncFor = ann.HasInternalType("AsyncFor")
25+
AsyncForBody = ann.HasInternalType("AsyncFor.body")
26+
AsyncForElse = ann.HasInternalType("AsyncFor.orelse")
27+
AsyncFuncDecorators = ann.HasInternalType("AsyncFunctionDef.decorator_list")
28+
AsyncFuncDefBody = ann.HasInternalType("AsyncFunctionDef.body")
29+
AsyncFunctionDef = ann.HasInternalType("AsyncFunctionDef")
30+
AsyncWith = ann.HasInternalType("AsyncWith")
31+
Attribute = ann.HasInternalType("Attribute")
32+
AugAssign = ann.HasInternalType("AugAssign")
33+
AugLoad = ann.HasInternalType("AugLoad")
34+
AugStore = ann.HasInternalType("AugStore")
35+
Await = ann.HasInternalType("Await")
36+
BinOp = ann.HasInternalType("BinOp")
37+
BitAnd = ann.HasInternalType("BitAnd")
38+
BitOr = ann.HasInternalType("BitOr")
39+
BitXor = ann.HasInternalType("BitXor")
40+
BoolLiteral = ann.HasInternalType("BoolLiteral")
41+
BoolOp = ann.HasInternalType("BoolOp")
42+
BoolopInternal = ann.HasInternalType("boolop")
43+
Break = ann.HasInternalType("Break")
44+
ByteLiteral = ann.HasInternalType("ByteLiteral")
45+
Bytes = ann.HasInternalType("Bytes")
46+
Call = ann.HasInternalType("Call")
47+
ClassDef = ann.HasInternalType("ClassDef")
48+
ClassDefDecorators = ann.HasInternalType("ClassDef.decorator_list")
49+
ClassDefBases = ann.HasInternalType("ClassDef.bases")
50+
ClassDefBody = ann.HasInternalType("ClassDef.body")
51+
ClassDefKeywords = ann.HasInternalType("ClassDef.keywords")
52+
Cmpop = ann.HasInternalType("cmpop")
53+
Compare = ann.HasInternalType("Compare")
54+
CompareComparators = ann.HasInternalType("Compare.comparators")
55+
CompareOps = ann.HasInternalType("Compare.ops")
56+
Comprehension = ann.HasInternalType("comprehension")
57+
Constant = ann.HasInternalType("Constant")
58+
Continue = ann.HasInternalType("Continue")
59+
Del = ann.HasInternalType("Del")
60+
Delete = ann.HasInternalType("Delete")
61+
Dict = ann.HasInternalType("Dict")
62+
DictComp = ann.HasInternalType("DictComp")
63+
Div = ann.HasInternalType("Div")
64+
Ellipsis = ann.HasInternalType("Ellipsis")
65+
Eq = ann.HasInternalType("Eq")
66+
ExceptHandler = ann.HasInternalType("ExceptHandler")
67+
ExceptHandlerName = ann.HasInternalType("ExceptHandler.name")
68+
ExcepthandlerInternal = ann.HasInternalType("excepthandler")
69+
Exec = ann.HasInternalType("Exec")
70+
Expr = ann.HasInternalType("Expr")
71+
ExprInternal = ann.HasInternalType("expr")
72+
ExprContext = ann.HasInternalType("expr_context")
73+
Expression = ann.HasInternalType("Expression")
74+
ExtSlice = ann.HasInternalType("ExtSlice")
75+
FloorDiv = ann.HasInternalType("FloorDiv")
76+
For = ann.HasInternalType("For")
77+
ForBody = ann.HasInternalType("For.body")
78+
ForElse = ann.HasInternalType("For.orelse")
79+
FormattedValue = ann.HasInternalType("FormattedValue")
80+
FuncDecorators = ann.HasInternalType("FunctionDef.decorator_list")
81+
FuncDefBody = ann.HasInternalType("FunctionDef.body")
82+
FunctionDef = ann.HasInternalType("FunctionDef")
83+
GeneratorExp = ann.HasInternalType("GeneratorExp")
84+
Global = ann.HasInternalType("Global")
85+
Gt = ann.HasInternalType("Gt")
86+
GtE = ann.HasInternalType("GtE")
87+
If = ann.HasInternalType("If")
88+
IfBody = ann.HasInternalType("If.body")
89+
IfElse = ann.HasInternalType("If.orelse")
90+
IfExp = ann.HasInternalType("IfExp")
91+
Import = ann.HasInternalType("Import")
92+
ImportFrom = ann.HasInternalType("ImportFrom")
93+
ImportFromModule = ann.HasInternalType("ImportFrom.module")
94+
In = ann.HasInternalType("In")
95+
Index = ann.HasInternalType("Index")
96+
Interactive = ann.HasInternalType("Interactive")
97+
Invert = ann.HasInternalType("Invert")
98+
Is = ann.HasInternalType("Is")
99+
IsNot = ann.HasInternalType("IsNot")
100+
JoinedStr = ann.HasInternalType("JoinedStr")
101+
Keyword = ann.HasInternalType("keyword")
102+
LShift = ann.HasInternalType("LShift")
103+
Lambda = ann.HasInternalType("Lambda")
104+
LambdaBody = ann.HasInternalType("Lambda.body")
105+
List = ann.HasInternalType("List")
106+
ListComp = ann.HasInternalType("ListComp")
107+
Load = ann.HasInternalType("Load")
108+
Lt = ann.HasInternalType("Lt")
109+
LtE = ann.HasInternalType("LtE")
110+
MatMult = ann.HasInternalType("MatMult")
111+
Mod = ann.HasInternalType("Mod")
112+
ModInternal = ann.HasInternalType("mod")
113+
Module = ann.HasInternalType("Module")
114+
Mult = ann.HasInternalType("Mult")
115+
Name = ann.HasInternalType("Name")
116+
NameConstant = ann.HasInternalType("NameConstant")
117+
NoneLiteral = ann.HasInternalType("NoneLiteral")
118+
Nonlocal = ann.HasInternalType("Nonlocal")
119+
NoopLine = ann.HasInternalType("NoopLine")
120+
Noop_lineInternal = ann.HasInternalType("noop_line")
121+
Not = ann.HasInternalType("Not")
122+
NotEq = ann.HasInternalType("NotEq")
123+
NotIn = ann.HasInternalType("NotIn")
124+
Num = ann.HasInternalType("Num")
125+
Operator = ann.HasInternalType("operator")
126+
Or = ann.HasInternalType("Or")
127+
Param = ann.HasInternalType("Param")
128+
Pass = ann.HasInternalType("Pass")
129+
Pow = ann.HasInternalType("Pow")
130+
PreviousNoops = ann.HasInternalType("PreviousNoops")
131+
Print = ann.HasInternalType("Print")
132+
RShift = ann.HasInternalType("RShift")
133+
Raise = ann.HasInternalType("Raise")
134+
RemainderNoops = ann.HasInternalType("RemainderNoops")
135+
Repr = ann.HasInternalType("Repr")
136+
Return = ann.HasInternalType("Return")
137+
Returns = ann.HasInternalType("returns")
138+
SameLineNoops = ann.HasInternalType("SameLineNoops")
139+
Set = ann.HasInternalType("Set")
140+
SetComp = ann.HasInternalType("SetComp")
141+
Slice = ann.HasInternalType("Slice")
142+
SliceInternal = ann.HasInternalType("slice")
143+
StringLiteral = ann.HasInternalType("StringLiteral")
144+
Starred = ann.HasInternalType("Starred")
145+
Stmt = ann.HasInternalType("stmt")
146+
Store = ann.HasInternalType("Store")
147+
Str = ann.HasInternalType("Str")
148+
Sub = ann.HasInternalType("Sub")
149+
Subscript = ann.HasInternalType("Subscript")
150+
Suite = ann.HasInternalType("Suite")
151+
Try = ann.HasInternalType("Try")
152+
TryBody = ann.HasInternalType("Try.body")
153+
TryElse = ann.HasInternalType("Try.orelse")
154+
TryExcept = ann.HasInternalType("TryExcept")
155+
TryFinalBody = ann.HasInternalType("Try.finalbody")
156+
TryFinally = ann.HasInternalType("TryFinally")
157+
TryHandlers = ann.HasInternalType("Try.handlers")
158+
Tuple = ann.HasInternalType("Tuple")
159+
UAdd = ann.HasInternalType("UAdd")
160+
USub = ann.HasInternalType("USub")
161+
UnaryOp = ann.HasInternalType("UnaryOp")
162+
UnaryopInternal = ann.HasInternalType("unaryop")
163+
While = ann.HasInternalType("While")
164+
WhileBody = ann.HasInternalType("While.body")
165+
WhileElse = ann.HasInternalType("While.orelse")
166+
With = ann.HasInternalType("With")
167+
WithBody = ann.HasInternalType("With.body")
168+
WithItems = ann.HasInternalType("With.items")
169+
Withitem = ann.HasInternalType("withitem")
170+
Yield = ann.HasInternalType("Yield")
171+
YieldFrom = ann.HasInternalType("YieldFrom")
143172
)

0 commit comments

Comments
 (0)