doc/ref: fix spec of regular expressions
some part of the doc weren’t updated yet.
Includes some other fixes.
Change-Id: I9e229432dad8bddb057d035b98ca1d9bb0c624f8
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/1680
Reviewed-by: Marcel van Lohuizen <mpvl@google.com>
diff --git a/doc/ref/spec.md b/doc/ref/spec.md
index b204d45..f68abd5 100644
--- a/doc/ref/spec.md
+++ b/doc/ref/spec.md
@@ -1115,9 +1115,8 @@
and an unlimited number of elements as its upper bound.
```
-ListLit = "[" [ ElementList [ "," [ "..." [ Element ] ] ] "]" .
-ElementList = Element { "," Element } .
-Element = Expression | LiteralValue .
+ListLit = "[" [ ElementList [ "," [ "..." [ Expression ] ] ] "]" .
+ElementList = Expression { "," Expression } .
```
<!---
KeyedElement = Element .
@@ -1500,12 +1499,11 @@
UnaryExpr = PrimaryExpr | unary_op UnaryExpr .
binary_op = "|" | "&" | "||" | "&&" | "==" | rel_op | add_op | mul_op .
-rel_op = "!=" | "<" | "<=" | ">" | ">=" .
+rel_op = "!=" | "<" | "<=" | ">" | ">=" | "=~" | "!~" .
add_op = "+" | "-" .
mul_op = "*" | "/" | "%" | "div" | "mod" | "quo" | "rem" .
unary_op = "+" | "-" | "!" | "*" | rel_op .
```
-<!-- TODO: consider adding unary_op: "<" | "<=" | ">" | ">=" -->
Comparisons are discussed [elsewhere](#Comparison-operators).
For any binary operators, the operand types must unify.
@@ -1532,7 +1530,7 @@
Precedence Operator
7 * / % div mod quo rem
6 + -
- 5 == != < <= > >=
+ 5 == != < <= > >= =~ !~
4 &&
3 ||
2 &