diff --git a/Gopkg.lock b/Gopkg.lock index bdfc898c..771868af 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -88,6 +88,12 @@ revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39" version = "v0.0.3" +[[projects]] + branch = "master" + name = "github.com/mcuadros/go-lookup" + packages = ["."] + revision = "5650f26be7675b629fff8356a50d906fa03e9c8b" + [[projects]] branch = "master" name = "github.com/mgutz/ansi" @@ -266,26 +272,40 @@ revision = "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" version = "v1.13.0" +[[projects]] + name = "gopkg.in/bblfsh/sdk.v1" + packages = [ + "manifest", + "protocol", + "uast" + ] + revision = "94e3b212553e761677da180f321d9a7a60ebec5f" + version = "v1.16.1" + [[projects]] branch = "v2" name = "gopkg.in/bblfsh/sdk.v2" packages = [ + "driver", + "driver/fixtures", + "driver/manifest", + "driver/native", + "driver/native/jsonlines", + "driver/server", "internal/docker", - "manifest", "protocol", - "sdk/driver", - "sdk/driver/fixtures", - "sdk/jsonlines", - "sdk/server", - "sdk/viewer", + "protocol/v1", "uast", "uast/nodes", + "uast/nodes/nodesproto", + "uast/nodes/nodesproto/pio", "uast/role", "uast/transformer", "uast/transformer/positioner", + "uast/viewer", "uast/yaml" ] - revision = "2aca0d0dad8fe47b8ed5e87d2f3616c7e3f4ef16" + revision = "d129d7e699d8cf18b8b07075090127e57b2be2a6" [[projects]] name = "gopkg.in/src-d/go-errors.v1" @@ -302,6 +322,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "740175acd0ef88548095eb82b0fcebd7447f63405f3e43de46593ca5a126f1d2" + inputs-digest = "3475e183627f94765a60f577e760b9bec3f1b21583f4a252999a5fca8b8fdb65" solver-name = "gps-cdcl" solver-version = 1 diff --git a/driver/fixtures/fixtures_test.go b/driver/fixtures/fixtures_test.go index 6e75dd48..a1fb4bc1 100644 --- a/driver/fixtures/fixtures_test.go +++ b/driver/fixtures/fixtures_test.go @@ -5,8 +5,9 @@ import ( "testing" "github.com/bblfsh/python-driver/driver/normalizer" - "gopkg.in/bblfsh/sdk.v2/sdk/driver" - "gopkg.in/bblfsh/sdk.v2/sdk/driver/fixtures" + "gopkg.in/bblfsh/sdk.v2/driver" + "gopkg.in/bblfsh/sdk.v2/driver/fixtures" + "gopkg.in/bblfsh/sdk.v2/driver/native" ) const projectRoot = "../../" @@ -15,8 +16,8 @@ var Suite = &fixtures.Suite{ Lang: "python", Ext: ".py", Path: filepath.Join(projectRoot, fixtures.Dir), - NewDriver: func() driver.BaseDriver { - return driver.NewExecDriverAt(filepath.Join(projectRoot, "build/bin/native")) + NewDriver: func() driver.Native { + return native.NewDriverAt(filepath.Join(projectRoot, "build/bin/native"), native.UTF8) }, Transforms: normalizer.Transforms, BenchName: "issue_server101", diff --git a/driver/impl/impl.go b/driver/impl/impl.go index 552b5c88..98616d7e 100644 --- a/driver/impl/impl.go +++ b/driver/impl/impl.go @@ -1,8 +1,11 @@ package impl -import "gopkg.in/bblfsh/sdk.v2/sdk/driver" +import ( + "gopkg.in/bblfsh/sdk.v2/driver/native" + "gopkg.in/bblfsh/sdk.v2/driver/server" +) func init() { // Can be overridden to link a native driver into a Go driver server. - driver.DefaultDriver = driver.NewExecDriver() + server.DefaultDriver = native.NewDriver(native.UTF8) } diff --git a/driver/main.go b/driver/main.go index d18a58b0..19768afe 100644 --- a/driver/main.go +++ b/driver/main.go @@ -4,9 +4,9 @@ import ( _ "github.com/bblfsh/python-driver/driver/impl" "github.com/bblfsh/python-driver/driver/normalizer" - "gopkg.in/bblfsh/sdk.v2/sdk/driver" + "gopkg.in/bblfsh/sdk.v2/driver/server" ) func main() { - driver.Run(normalizer.Transforms) + server.Run(normalizer.Transforms) } diff --git a/driver/normalizer/transforms.go b/driver/normalizer/transforms.go index 0cce101c..3df31552 100644 --- a/driver/normalizer/transforms.go +++ b/driver/normalizer/transforms.go @@ -1,10 +1,10 @@ package normalizer -import "gopkg.in/bblfsh/sdk.v2/sdk/driver" +import "gopkg.in/bblfsh/sdk.v2/driver" var Transforms = driver.Transforms{ - Preprocess: Preprocess, - Normalize: Normalize, - Native: Native, - Code: Code, + Preprocess: Preprocess, + Normalize: Normalize, + Annotations: Native, + Code: Code, } diff --git a/fixtures/_integration.py.legacy b/fixtures/_integration.py.legacy index 8a04234b..18b291e9 100644 --- a/fixtures/_integration.py.legacy +++ b/fixtures/_integration.py.legacy @@ -2,7 +2,7 @@ Module { . Roles: File,Module . Children: { . . 0: ClassDef { -. . . Roles: Declaration,Identifier,Statement,Type +. . . Roles: Type,Declaration,Identifier,Statement . . . TOKEN "testcls1" . . . StartPosition: { . . . . Offset: 6 @@ -19,19 +19,19 @@ Module { . . . } . . . Children: { . . . . 0: ClassDef.bases { -. . . . . Roles: Base,Declaration,Type +. . . . . Roles: Type,Declaration,Base . . . . . Properties: { . . . . . . internalRole: bases . . . . . } . . . . } . . . . 1: ClassDef.decorator_list { -. . . . . Roles: Call,Declaration,Incomplete,Type +. . . . . Roles: Type,Declaration,Call,Incomplete . . . . . Properties: { . . . . . . internalRole: decorator_list . . . . . } . . . . } . . . . 2: ClassDef.body { -. . . . . Roles: Body,Declaration,Type +. . . . . Roles: Type,Declaration,Body . . . . . Properties: { . . . . . . internalRole: body . . . . . }