this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

pkg/list: simply template for Ascending

The parentheses are a holdover of old school CUE which
used <a>: b for pattern constraints, instead of [a]: b.

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Ia39110623c779a56e6dce6928c7d816e75f86855
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/549088
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+8 -9
+1 -1
pkg/list/pkg.go
··· 293 293 T: number | string 294 294 x: T 295 295 y: T 296 - less: true && x < y 296 + less: x < y 297 297 } 298 298 Descending: { 299 299 Comparer
+5 -6
pkg/list/sort.cue
··· 28 28 // list.Sort(a, list.Ascending) 29 29 Ascending: { 30 30 Comparer 31 - T: number | string 32 - x: T 33 - y: T 34 - // TODO: the following will be fixed when removing old-school templating. 35 - less: true && (x < y) 31 + T: number | string 32 + x: T 33 + y: T 34 + less: x < y 36 35 } 37 36 38 37 // Descending defines a Comparer to sort comparable values in decreasing order. ··· 44 43 T: number | string 45 44 x: T 46 45 y: T 47 - less: (x > y) 46 + less: x > y 48 47 }
+2 -2
pkg/list/testdata/gen.txtar
··· 100 100 ./in.cue:38:6 101 101 t40: error in call to list.Sort: 2 errors in empty disjunction:: 102 102 ./in.cue:46:6 103 - list:13:17 103 + list:13:9 104 104 t42: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string: 105 105 ./in.cue:48:6 106 106 ./in.cue:48:24 ··· 110 110 ./in.cue:55:6 111 111 t54: error in call to list.Sort: 2 errors in empty disjunction:: 112 112 ./in.cue:60:6 113 - list:13:17 113 + list:13:9 114 114 115 115 Result: 116 116 t1: 2.5