1
0
mirror of https://github.com/golang/go synced 2024-11-23 05:30:07 -07:00

spec: remove superfluous terms "delimiter" and "special tokens"

The (original) section on "Operators and Delimiters" introduced
superfluous terminology ("delimiter", "special token") which
didn't matter and was used inconsistently.

Removed any mention of "delimiter" or "special token" and now
simply group the special character tokens into "operators"
(clearly defined via links), and "punctuation" (everything else).

Fixes #19450.

Change-Id: Ife31b24b95167ace096f93ed180b7eae41c66808
Reviewed-on: https://go-review.googlesource.com/38073
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Robert Griesemer 2017-03-10 17:17:23 -08:00
parent eb715fbbbd
commit 26e726c309

View File

@ -1,6 +1,6 @@
<!--{ <!--{
"Title": "The Go Programming Language Specification", "Title": "The Go Programming Language Specification",
"Subtitle": "Version of February 9, 2017", "Subtitle": "Version of February 12, 2017",
"Path": "/ref/spec" "Path": "/ref/spec"
}--> }-->
@ -154,7 +154,7 @@ Any other comment acts like a newline.
<p> <p>
Tokens form the vocabulary of the Go language. Tokens form the vocabulary of the Go language.
There are four classes: <i>identifiers</i>, <i>keywords</i>, <i>operators There are four classes: <i>identifiers</i>, <i>keywords</i>, <i>operators
and delimiters</i>, and <i>literals</i>. <i>White space</i>, formed from and punctuation</i>, and <i>literals</i>. <i>White space</i>, formed from
spaces (U+0020), horizontal tabs (U+0009), spaces (U+0020), horizontal tabs (U+0009),
carriage returns (U+000D), and newlines (U+000A), carriage returns (U+000D), and newlines (U+000A),
is ignored except as it separates tokens is ignored except as it separates tokens
@ -197,7 +197,7 @@ into the token stream immediately after a line's final token if that token is
<code>return</code> <code>return</code>
</li> </li>
<li>one of the <a href="#Operators_and_Delimiters">operators and delimiters</a> <li>one of the <a href="#Operators_and_punctuation">operators and punctuation</a>
<code>++</code>, <code>++</code>,
<code>--</code>, <code>--</code>,
<code>)</code>, <code>)</code>,
@ -254,10 +254,11 @@ const fallthrough if range type
continue for import return var continue for import return var
</pre> </pre>
<h3 id="Operators_and_Delimiters">Operators and Delimiters</h3> <h3 id="Operators_and_punctuation">Operators and punctuation</h3>
<p> <p>
The following character sequences represent <a href="#Operators">operators</a>, delimiters, and other special tokens: The following character sequences represent <a href="#Operators">operators</a>
(including <a href="#assign_op">assignment operators</a>) and punctuation:
</p> </p>
<pre class="grammar"> <pre class="grammar">
+ &amp; += &amp;= &amp;&amp; == != ( ) + &amp; += &amp;= &amp;&amp; == != ( )
@ -4494,8 +4495,8 @@ a[i] = 23
<p> <p>
An <i>assignment operation</i> <code>x</code> <i>op</i><code>=</code> An <i>assignment operation</i> <code>x</code> <i>op</i><code>=</code>
<code>y</code> where <i>op</i> is a binary arithmetic operation is equivalent <code>y</code> where <i>op</i> is a binary <a href="#Arithmetic_operators">arithmetic operator</a>
to <code>x</code> <code>=</code> <code>x</code> <i>op</i> is equivalent to <code>x</code> <code>=</code> <code>x</code> <i>op</i>
<code>(y)</code> but evaluates <code>x</code> <code>(y)</code> but evaluates <code>x</code>
only once. The <i>op</i><code>=</code> construct is a single token. only once. The <i>op</i><code>=</code> construct is a single token.
In assignment operations, both the left- and right-hand expression lists In assignment operations, both the left- and right-hand expression lists