pkg/list: remove use of `::` (Incompatible!!!)
WARNING: this change causes a breaking change.
Change-Id: I379b5db972e30d0de81096c7ddac115064658d6d
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6201
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/cue/builtins.go b/cue/builtins.go
index 0957474..946d9d9 100644
--- a/cue/builtins.go
+++ b/cue/builtins.go
@@ -1184,21 +1184,21 @@
},
}},
cue: `{
- Comparer :: {
- T :: _
+ Comparer: {
+ T: _
less: bool
x: T
y: T
}
- Ascending :: {
- T :: number | string
+ Ascending: {
+ T: number | string
less: true && x < y
x: T
y: T
Comparer
}
- Descending :: {
- T :: number | string
+ Descending: {
+ T: number | string
less: x > y
x: T
y: T
diff --git a/pkg/list/sort.cue b/pkg/list/sort.cue
index 4ea3e78..edd5552 100644
--- a/pkg/list/sort.cue
+++ b/pkg/list/sort.cue
@@ -15,8 +15,8 @@
package list
// A Comparer specifies whether one value is strictly less than another value.
-Comparer :: {
- T :: _
+Comparer: {
+ T: _
x: T
y: T
less: bool // true if x < y
@@ -26,11 +26,11 @@
//
// Example:
// list.Sort(a, list.Ascending)
-Ascending :: {
+Ascending: {
Comparer
- T :: number | string
- x: T
- y: T
+ T: number | string
+ x: T
+ y: T
// TODO: the following will be fixed when removing old-school templating.
less: true && (x < y)
}
@@ -39,9 +39,9 @@
//
// Example:
// list.Sort(a, list.Descending)
-Descending :: {
+Descending: {
Comparer
- T :: number | string
+ T: number | string
x: T
y: T
less: (x > y)
diff --git a/pkg/list/sort.go b/pkg/list/sort.go
index 6947aab..ac33f4f 100644
--- a/pkg/list/sort.go
+++ b/pkg/list/sort.go
@@ -42,7 +42,7 @@
// Sort sorts data. It does O(n*log(n)) comparisons.
// The sort is not guaranteed to be stable.
//
-// cmp is a struct of the form {T :: _, x: T, y: T, less: bool}, where
+// cmp is a struct of the form {T: _, x: T, y: T, less: bool}, where
// less should reflect x < y.
//
// Example: