cue: use inline comments for errors
This allows for multiple errors on one line in lists.
Issue #52
Change-Id: I57258ad43aa419accb9e3a2847183e0fc76dd483
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2169
Reviewed-by: Marcel van Lohuizen <mpvl@google.com>
diff --git a/cue/export.go b/cue/export.go
index 40c58d0..7624fa9 100644
--- a/cue/export.go
+++ b/cue/export.go
@@ -554,7 +554,7 @@
case *bottom:
err := &ast.BottomLit{}
- comment := &ast.Comment{Text: "// " + x.msg}
+ comment := &ast.Comment{Text: "/* " + x.msg + " */"}
err.AddComment(&ast.CommentGroup{
Line: true,
Position: 1,
diff --git a/cue/export_test.go b/cue/export_test.go
index 68d59bd..e6a1f7c 100644
--- a/cue/export_test.go
+++ b/cue/export_test.go
@@ -67,9 +67,9 @@
s: "abc"
}
b: 2.0
- c: _|_ // undefined field "c"
- d: _|_ // undefined field "d"
- e: _|_ // undefined field "t"
+ c: _|_ /* undefined field "c" */
+ d: _|_ /* undefined field "d" */
+ e: _|_ /* undefined field "t" */
}`),
}, {
in: `{