diff --git a/.travis.yml b/.travis.yml index c92bd0c..b9a3009 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,13 @@ language: go go: - - '1.10' + - '1.11' services: - docker env: - - BBLFSHD_VERSION=v2.9.1 + - BBLFSHD_VERSION=v2.11.7 install: - curl -L https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 > $GOPATH/bin/dep diff --git a/Gopkg.lock b/Gopkg.lock index feeb605..6fc3490 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -376,8 +376,8 @@ "uast/viewer", "uast/yaml" ] - revision = "d506b5408b0afda31d07e9a90343769efbfef837" - version = "v2.13.4" + revision = "7f43f27c14a259a0a396cc70c911424b8e8b11c1" + version = "v2.15.0" [[projects]] name = "gopkg.in/src-d/go-errors.v1" @@ -394,6 +394,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "1a1638644957a6bb7a516fb8173086bbf172fb3b4e043edac13a31441a129ade" + inputs-digest = "05bdcb307ccc0a7ce51cc978e69766d1f27ef0ca80c2ac509a97d6f4a8aa8453" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index f437441..112dec7 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -3,7 +3,7 @@ [[constraint]] name = "gopkg.in/bblfsh/sdk.v2" - version = "2.13.x" + version = "2.15.x" [prune] go-tests = true diff --git a/driver/fixtures/fixtures_test.go b/driver/fixtures/fixtures_test.go index b5a35fd..ec7a98d 100644 --- a/driver/fixtures/fixtures_test.go +++ b/driver/fixtures/fixtures_test.go @@ -36,9 +36,6 @@ var Suite = &fixtures.Suite{ "Stmt_Function", }, }, - Docker: fixtures.DockerConfig{ - Image: "php:7", - }, } func TestPHPDriver(t *testing.T) { diff --git a/driver/normalizer/normalizer.go b/driver/normalizer/normalizer.go index 36eb711..2c97bdd 100644 --- a/driver/normalizer/normalizer.go +++ b/driver/normalizer/normalizer.go @@ -100,24 +100,27 @@ var PreNormilizers = []Mapping{ // Normalizers is the main block of normalization rules to convert native AST to semantic UAST. var Normalizers = []Mapping{ MapSemantic("Name", uast.Identifier{}, MapObj( - Obj{ - uast.KeyToken: Var("name"), + Fields{ + {Name: uast.KeyToken, Op: Var("name")}, + {Name: "comments", Drop: true, Op: Any()}, // FIXME(dennwc): handle comments }, Obj{ "Name": Var("name"), }, )), MapSemantic("Name", uast.Identifier{}, MapObj( - Obj{ - "parts": One(Var("name")), + Fields{ + {Name: "parts", Op: One(Var("name"))}, + {Name: "comments", Drop: true, Op: Any()}, // FIXME(dennwc): handle comments }, Obj{ "Name": Var("name"), }, )), MapSemantic("Name", uast.QualifiedIdentifier{}, MapObj( - Obj{ - "parts": Each("names", Var("name")), + Fields{ + {Name: "parts", Op: Each("names", Var("name"))}, + {Name: "comments", Drop: true, Op: Any()}, // FIXME(dennwc): handle comments }, Obj{ "Names": Each("names", UASTType(uast.Identifier{}, Obj{ @@ -352,15 +355,16 @@ var Normalizers = []Mapping{ }, )), MapSemantic("Stmt_Function", uast.FunctionGroup{}, MapObj( - Obj{ - "byRef": Cases("by_ref", + Fields{ + {Name: "byRef", Op: Cases("by_ref", Bool(false), Bool(true), - ), - "name": Var("name"), - "params": Var("params"), - "returnType": typeCaseLeft("return"), - "stmts": Var("body"), + )}, + {Name: "name", Op: Var("name")}, + {Name: "params", Op: Var("params")}, + {Name: "returnType", Op: typeCaseLeft("return")}, + {Name: "stmts", Op: Var("body")}, + {Name: "comments", Drop: true, Op: Any()}, // FIXME(dennwc): handle comments }, Obj{ "Nodes": Arr(