internal/core/runtime: assign first label to `_`.
Change-Id: I55a3291e8aecf93bb9465f2cccc52ed7121520a9
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/7841
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/internal/core/debug/debug.go b/internal/core/debug/debug.go
index 4e2f8a9..6bcd680 100644
--- a/internal/core/debug/debug.go
+++ b/internal/core/debug/debug.go
@@ -84,6 +84,10 @@
w.string(w.labelString(f))
}
+func (w *printer) ident(f adt.Feature) {
+ w.string(f.IdentString(w.index))
+}
+
// TODO: fold into label once :: is no longer supported.
func (w *printer) labelString(f adt.Feature) string {
if f.IsHidden() {
@@ -378,7 +382,7 @@
w.string(openTuple)
w.string(strconv.Itoa(int(x.UpCount)))
w.string(";let ")
- w.label(x.Label)
+ w.ident(x.Label)
w.string(closeTuple)
case *adt.SelectorExpr:
@@ -490,9 +494,9 @@
case *adt.ForClause:
w.string("for ")
- w.label(x.Key)
+ w.ident(x.Key)
w.string(", ")
- w.label(x.Value)
+ w.ident(x.Value)
w.string(" in ")
w.node(x.Src)
w.string(" ")
@@ -506,7 +510,7 @@
case *adt.LetClause:
w.string("let ")
- w.label(x.Label)
+ w.ident(x.Label)
w.string(" = ")
w.node(x.Expr)
w.string(" ")