doc/tutorial/basics: update w.r.t. spec.
Change-Id: Ic489951d09ca355788944ee6459e132401c5e3c7
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/3260
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/doc/tutorial/basics/comments.md b/doc/tutorial/basics/comments.md
index 5acb4ec..e7404ee 100644
--- a/doc/tutorial/basics/comments.md
+++ b/doc/tutorial/basics/comments.md
@@ -4,18 +4,14 @@
# Comments
-CUE supports C-style block and line comments.
+CUE supports C-style line comments.
<!-- CUE editor -->
_comments.cue:_
```
-// whole numbers
+// a doc comment
one: 1
-two: 2
-
-/* fractions
- */
-"two-and-a-half": 2.5
+two: 2 // a line comment
```
<!-- JSON result -->
@@ -24,6 +20,5 @@
{
"one": 1,
"two": 2,
- "two-and-a-half": 2.5
}
```
\ No newline at end of file
diff --git a/doc/tutorial/basics/emit.md b/doc/tutorial/basics/emit.md
index d5cca51..23b2d61 100644
--- a/doc/tutorial/basics/emit.md
+++ b/doc/tutorial/basics/emit.md
@@ -5,13 +5,7 @@
# Emit Values
By default all top-level fields are emitted when evaluating a configuration.
-CUE files may define a top-level value that is emitted instead.
-<!-- jba:
-It's unclear how they do that. Is it the first form in the file?
-And this is not in the spec AFAICT.
--->
-
-Values within the emit value may refer to fields defined outside of it.
+Embedding a value at top-level will cause that value to be emitted instead.
Emit values allow CUE configurations, like JSON,
to define any type, instead of just structs, while keeping the common case
@@ -20,18 +14,13 @@
<!-- CUE editor -->
_emit.cue:_
```
-{
- a: A
- b: B
-}
+"Hello \(who)!"
-A: 1
-B: 2
+who: "world"
```
<!-- result -->
`$ cue eval emit.cue`
```
-a: 1
-b: 2
+"Hello world!"
```