cue/scanner: allow $ as a letter in identifies

This brings CUE identifiers in line with JavaScript,
and more importantly, JSON style.

It is common in JSON to have identifiers with a $.
With the restriction that string labels can no longer
be referenced, and with the elimination of quoted
identifiers, this has become a bit awkward.

Also, unlike Go, CUE cannot enforce a certain
capitalization style as this is often enforced by the
given APIs. Allowing `$` in addition to `_` gives users
a bit more flexibility in using identifiers that stand out
from other conventions used within an API.

Change-Id: If6253d1e353729aad07ccd665ccd04018ab2ccce
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/3982
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/doc/ref/spec.md b/doc/ref/spec.md
index 22fc29c..2fe4864 100644
--- a/doc/ref/spec.md
+++ b/doc/ref/spec.md
@@ -177,8 +177,9 @@
 ### Identifiers
 
 Identifiers name entities such as fields and aliases.
-An identifier is a sequence of one or more letters (which includes `_`) and digits.
-It may not be `_`.
+An identifier is a sequence of one or more letters (which includes `_` and `$`)
+and digits.
+It may not be `_` or `$`.
 The first character in an identifier must be a letter.
 
 <!--