Skip to content

Commit

Permalink
all: switch to using cue port
Browse files Browse the repository at this point in the history
NOTE: this will break the build. The next CL will fix it. Merging
the two CLs introduces too much noice though.

Change-Id: Ica115283924926ede8ee7c4b3265d5d98838bdae
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6657
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
  • Loading branch information
mpvl committed Jul 25, 2020
1 parent 5378b08 commit 7f52c10
Show file tree
Hide file tree
Showing 68 changed files with 78 additions and 78 deletions.
2 changes: 1 addition & 1 deletion cmd/cue/cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import (

"github.com/spf13/cobra"

"cuelang.org/go/cue"
"cuelang.org/go/cue/build"
"cuelang.org/go/cue/format"
"cuelang.org/go/cue/load"
"cuelang.org/go/cue/parser"
"cuelang.org/go/internal"
"cuelang.org/go/internal/legacy/cue"
)

func newAddCmd(c *Command) *cobra.Command {
Expand Down
4 changes: 2 additions & 2 deletions cmd/cue/cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"golang.org/x/text/language"
"golang.org/x/text/message"

"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/build"
"cuelang.org/go/cue/errors"
Expand All @@ -35,6 +34,7 @@ import (
"cuelang.org/go/internal"
"cuelang.org/go/internal/encoding"
"cuelang.org/go/internal/filetypes"
"cuelang.org/go/internal/legacy/cue"
)

// Disallow
Expand Down Expand Up @@ -223,7 +223,7 @@ func newStreamingIterator(b *buildPlan) *streamingIterator {
if inst.Err != nil {
return &streamingIterator{e: inst.Err}
}
i.r = internal.GetRuntime(inst).(*cue.Runtime)
i.r = internal.GetRuntimeNew(inst).(*cue.Runtime)
if b.schema == nil {
i.base = inst.Value()
} else {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cue/cmd/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"

"cuelang.org/go/cue"
"cuelang.org/go/cue/errors"
"cuelang.org/go/internal"
"cuelang.org/go/internal/legacy/cue"
itask "cuelang.org/go/internal/task"
"cuelang.org/go/internal/walk"
_ "cuelang.org/go/pkg/tool/cli" // Register tasks
Expand Down
2 changes: 1 addition & 1 deletion cmd/cue/cmd/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import (

"github.com/spf13/cobra"

"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/format"
"cuelang.org/go/internal"
"cuelang.org/go/internal/encoding"
"cuelang.org/go/internal/filetypes"
"cuelang.org/go/internal/legacy/cue"
)

// newEvalCmd creates a new eval command
Expand Down
2 changes: 1 addition & 1 deletion cmd/cue/cmd/orphans.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"regexp"
"strconv"

"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/ast/astutil"
"cuelang.org/go/cue/build"
Expand All @@ -29,6 +28,7 @@ import (
"cuelang.org/go/cue/token"
"cuelang.org/go/internal"
"cuelang.org/go/internal/encoding"
"cuelang.org/go/internal/legacy/cue"
)

// This file contains logic for placing orphan files within a CUE namespace.
Expand Down
2 changes: 1 addition & 1 deletion cmd/cue/cmd/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ package cmd
import (
"strings"

"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/build"
"cuelang.org/go/cue/errors"
"cuelang.org/go/cue/token"
"cuelang.org/go/internal"
"cuelang.org/go/internal/cli"
"cuelang.org/go/internal/legacy/cue"
)

func decorateInstances(cmd *Command, tags []string, a []*build.Instance) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cue/cmd/vet.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"github.com/spf13/cobra"
"golang.org/x/text/message"

"cuelang.org/go/cue"
"cuelang.org/go/cue/errors"
"cuelang.org/go/internal/legacy/cue"
)

const vetDoc = `vet validates CUE and other data files
Expand Down
2 changes: 1 addition & 1 deletion cue/ast/astutil/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"strings"
"testing"

"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/ast/astutil"
"cuelang.org/go/cue/format"
"cuelang.org/go/cue/token"
"cuelang.org/go/internal/legacy/cue"
"github.com/google/go-cmp/cmp"
)

Expand Down
4 changes: 2 additions & 2 deletions cue/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Runtime struct {
}

func init() {
internal.GetRuntime = func(instance interface{}) interface{} {
internal.GetRuntimeOld = func(instance interface{}) interface{} {
switch x := instance.(type) {
case Value:
return &Runtime{idx: x.idx}
Expand All @@ -51,7 +51,7 @@ func init() {
}
}

internal.CheckAndForkRuntime = func(runtime, value interface{}) interface{} {
internal.CheckAndForkRuntimeOld = func(runtime, value interface{}) interface{} {
r := runtime.(*Runtime)
idx := value.(Value).ctx().index
if idx != r.idx {
Expand Down
6 changes: 3 additions & 3 deletions cue/builtins.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cue/load/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (

"github.com/kylelemons/godebug/diff"

"cuelang.org/go/cue"
"cuelang.org/go/cue/format"
"cuelang.org/go/internal/legacy/cue"
"cuelang.org/go/internal/str"
)

Expand Down
2 changes: 1 addition & 1 deletion cuego/cuego.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"reflect"
"sync"

"cuelang.org/go/cue"
"cuelang.org/go/cue/parser"
"cuelang.org/go/internal"
"cuelang.org/go/internal/legacy/cue"
)

// DefaultContext is the shared context used with top-level functions.
Expand Down
4 changes: 2 additions & 2 deletions encoding/gocode/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (

"golang.org/x/tools/go/packages"

"cuelang.org/go/cue"
"cuelang.org/go/cue/errors"
"cuelang.org/go/internal"
"cuelang.org/go/internal/legacy/cue"
)

// Config defines options for generation Go code.
Expand Down Expand Up @@ -159,7 +159,7 @@ func Generate(pkgPath string, inst *cue.Instance, c *Config) (b []byte, err erro
g.decl(iter.Label(), iter.Value())
}

r := internal.GetRuntime(inst).(*cue.Runtime)
r := internal.GetRuntimeNew(inst).(*cue.Runtime)
b, err = r.Marshal(inst)
g.addErr(err)

Expand Down
2 changes: 1 addition & 1 deletion encoding/gocode/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (

"github.com/kylelemons/godebug/diff"

"cuelang.org/go/cue"
"cuelang.org/go/cue/errors"
"cuelang.org/go/cue/load"
"cuelang.org/go/internal/legacy/cue"
)

var update = flag.Bool("update", false, "update test files")
Expand Down
4 changes: 2 additions & 2 deletions encoding/gocode/gocodec/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ package gocodec
import (
"sync"

"cuelang.org/go/cue"
"cuelang.org/go/internal"
"cuelang.org/go/internal/legacy/cue"
)

// Config has no options yet, but is defined for future extensibility.
Expand Down Expand Up @@ -177,5 +177,5 @@ func fromGoType(r *cue.Runtime, x interface{}) (cue.Value, error) {
}

func checkAndForkRuntime(r *cue.Runtime, v cue.Value) *cue.Runtime {
return internal.CheckAndForkRuntime(r, v).(*cue.Runtime)
return internal.CheckAndForkRuntimeNew(r, v).(*cue.Runtime)
}
2 changes: 1 addition & 1 deletion encoding/gocode/gocodec/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/kr/pretty"

"cuelang.org/go/cue"
"cuelang.org/go/internal/legacy/cue"
)

type Sum struct {
Expand Down
2 changes: 1 addition & 1 deletion encoding/gocode/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ package {{.pkgName}}
import (
"fmt"
"cuelang.org/go/cue"
"cuelang.org/go/internal/legacy/cue"
"cuelang.org/go/encoding/gocode/gocodec"
)
Expand Down
2 changes: 1 addition & 1 deletion encoding/gocode/testdata/pkg1/cue_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion encoding/gocode/testdata/pkg2/cue_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion encoding/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import (
"strconv"
"strings"

"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/ast/astutil"
"cuelang.org/go/cue/errors"
"cuelang.org/go/cue/literal"
"cuelang.org/go/cue/parser"
"cuelang.org/go/cue/token"
"cuelang.org/go/internal/legacy/cue"
"cuelang.org/go/pkg/encoding/json"
)

Expand Down
2 changes: 1 addition & 1 deletion encoding/jsonschema/constraints.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import (
"path"
"regexp"

"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/errors"
"cuelang.org/go/cue/token"
"cuelang.org/go/internal"
"cuelang.org/go/internal/legacy/cue"
)

// TODO: skip invalid regexps containing ?! and foes.
Expand Down
2 changes: 1 addition & 1 deletion encoding/jsonschema/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import (
"sort"
"strings"

"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/ast/astutil"
"cuelang.org/go/cue/errors"
"cuelang.org/go/cue/token"
"cuelang.org/go/internal"
"cuelang.org/go/internal/legacy/cue"
)

// rootDefs defines the top-level name of the map of definitions that do not
Expand Down
2 changes: 1 addition & 1 deletion encoding/jsonschema/decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ import (
"strings"
"testing"

"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/errors"
"cuelang.org/go/cue/format"
"cuelang.org/go/cue/token"
"cuelang.org/go/encoding/json"
"cuelang.org/go/encoding/yaml"
"cuelang.org/go/internal/legacy/cue"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert"
"golang.org/x/tools/txtar"
Expand Down
2 changes: 1 addition & 1 deletion encoding/jsonschema/jsonschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
package jsonschema

import (
"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/token"
"cuelang.org/go/internal/legacy/cue"
)

// Extract converts JSON Schema data into an equivalent CUE representation.
Expand Down
2 changes: 1 addition & 1 deletion encoding/jsonschema/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import (
"strconv"
"strings"

"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/errors"
"cuelang.org/go/cue/token"
"cuelang.org/go/internal"
"cuelang.org/go/internal/legacy/cue"
)

func (d *decoder) parseRef(p token.Pos, str string) []string {
Expand Down
2 changes: 1 addition & 1 deletion encoding/openapi/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import (
"strconv"
"strings"

"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/errors"
"cuelang.org/go/cue/token"
"cuelang.org/go/internal"
"cuelang.org/go/internal/legacy/cue"
"golang.org/x/xerrors"
)

Expand Down
2 changes: 1 addition & 1 deletion encoding/openapi/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ package openapi
//

import (
"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/internal/legacy/cue"
)

// newCoreBuilder returns a builder that represents a structural schema.
Expand Down
2 changes: 1 addition & 1 deletion encoding/openapi/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ package openapi
import (
"strings"

"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/errors"
"cuelang.org/go/cue/token"
"cuelang.org/go/encoding/jsonschema"
"cuelang.org/go/internal"
"cuelang.org/go/internal/legacy/cue"
)

// Extract converts OpenAPI definitions to an equivalent CUE representation.
Expand Down

0 comments on commit 7f52c10

Please sign in to comment.