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

Commit

Permalink
uast/yaml: rename the package to match an import path
Browse files Browse the repository at this point in the history
Signed-off-by: Denys Smirnov <[email protected]>
  • Loading branch information
Denys Smirnov authored and dennwc committed Apr 12, 2019
1 parent 2228a84 commit 908126f
Show file tree
Hide file tree
Showing 7 changed files with 375 additions and 337 deletions.
4 changes: 2 additions & 2 deletions build/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/bblfsh/sdk/v3/driver"
"github.com/bblfsh/sdk/v3/internal/docker"
uastyml "github.com/bblfsh/sdk/v3/uast/yaml"
"github.com/bblfsh/sdk/v3/uast/uastyaml"
protocol1 "gopkg.in/bblfsh/sdk.v1/protocol"
uast1 "gopkg.in/bblfsh/sdk.v1/uast"
)
Expand Down Expand Up @@ -233,7 +233,7 @@ func (d *Driver) testIntegration(bblfshdVers, image string) error {
return err
}
buf.Reset()
exp, err := uastyml.Marshal(ast)
exp, err := uastyaml.Marshal(ast)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/bblfsh-sdk/cmd/ast2gv.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strconv"

"github.com/bblfsh/sdk/v3/uast/nodes"
"github.com/bblfsh/sdk/v3/uast/yaml"
"github.com/bblfsh/sdk/v3/uast/uastyaml"
"github.com/ghodss/yaml"
)

Expand Down Expand Up @@ -78,7 +78,7 @@ func (c *Ast2GraphvizCommand) processFile(name string) error {
if err != nil {
return err
}
ast, err := uastyml.Unmarshal(data)
ast, err := uastyaml.Unmarshal(data)
if err != nil {
return fmt.Errorf("cannot unmarshal uast: %v", err)
}
Expand Down
10 changes: 5 additions & 5 deletions driver/fixtures/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"github.com/bblfsh/sdk/v3/uast"
"github.com/bblfsh/sdk/v3/uast/nodes"
"github.com/bblfsh/sdk/v3/uast/transformer/positioner"
"github.com/bblfsh/sdk/v3/uast/uastyaml"
"github.com/bblfsh/sdk/v3/uast/viewer"
uastyml "github.com/bblfsh/sdk/v3/uast/yaml"
)

const Dir = "fixtures"
Expand Down Expand Up @@ -84,7 +84,7 @@ func (s *Suite) readFixturesFileUAST(t testing.TB, name string, noFail bool) nod
return nil
}
require.NoError(t, err)
ast, err := uastyml.Unmarshal(data)
ast, err := uastyaml.Unmarshal(data)
require.NoError(t, err)
return ast
}
Expand Down Expand Up @@ -129,7 +129,7 @@ const (

func marshalNoRoles(o nodes.Node) ([]byte, error) {
buf := bytes.NewBuffer(nil)
enc := uastyml.NewEncoder(buf)
enc := uastyaml.NewEncoder(buf)
enc.ForceRoles(false)
if err := enc.Encode(o); err != nil {
return nil, err
Expand All @@ -139,7 +139,7 @@ func marshalNoRoles(o nodes.Node) ([]byte, error) {

func marshalForceRoles(o nodes.Node) ([]byte, error) {
buf := bytes.NewBuffer(nil)
enc := uastyml.NewEncoder(buf)
enc := uastyaml.NewEncoder(buf)
enc.ForceRoles(true)
if err := enc.Encode(o); err != nil {
return nil, err
Expand Down Expand Up @@ -370,7 +370,7 @@ func (s *Suite) benchmarkTransform(b *testing.B) {
b.Run(name, func(b *testing.B) {
code := s.readFixturesFile(b, fname)
data := s.readFixturesFile(b, fname+nativeExt)
rast, err := uastyml.Unmarshal([]byte(data))
rast, err := uastyaml.Unmarshal([]byte(data))
if err != nil {
b.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions uast/query/xpath/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/bblfsh/sdk/v3/uast/nodes"
"github.com/bblfsh/sdk/v3/uast/query"
"github.com/bblfsh/sdk/v3/uast/role"
uastyml "github.com/bblfsh/sdk/v3/uast/yaml"
"github.com/bblfsh/sdk/v3/uast/uastyaml"
)

func mustNode(o interface{}) nodes.Node {
Expand Down Expand Up @@ -244,7 +244,7 @@ const dataDir = "../testdata"
func readUAST(t testing.TB, path string) nodes.Node {
data, err := ioutil.ReadFile(path)
require.NoError(t, err)
nd, err := uastyml.Unmarshal(data)
nd, err := uastyaml.Unmarshal(data)
require.NoError(t, err)
return nd
}
Expand Down
Loading

0 comments on commit 908126f

Please sign in to comment.