Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Specification error #457

Closed
gopherbot opened this issue Dec 23, 2009 · 5 comments
Closed

Language Specification error #457

gopherbot opened this issue Dec 23, 2009 · 5 comments

Comments

@gopherbot
Copy link

by kq1quick:

The language specification currently states:

Tokens 

      Tokens form the vocabulary of the Go language. There are four 
classes: identifiers, keywords, operators and  delimiters, and 
literals. White space, formed from spaces (U+0020), horizontal tabs (U 
+0009), carriage returns (U+000D), and newlines (U+000A), is ignored 
except as it separates tokens that would otherwise combine into a 
single token. While breaking the input into tokens, the next token is 
the longest sequence of characters that form a valid token.


The second sentence is wrong: it states that there are "four" classes and 
then proceeds to enumerate 5.

The third sentence is no longer true with the Dec 22 release.  At a 
minimum, the assertion above that carriage returns are whitespace must be 
removed because they now no longer server to separate tokens and are 
ignored otherwise: they significantly affect the parse.  See issues 453 
and 454 and http://groups.google.com/group/golang-nuts/t/9eb0c7c1f20db921 
(particularly my post).  More explicitly, it should discuss the fact that 
newlines are sometimes just whitespace and sometimes parse elements and 
that there are special rules throughout the latter portions of the 
language specification detailing when they are not just whitespace.

To this end, newlines may form the 6th class of tokens.
@gopherbot
Copy link
Author

Comment 1 by kq1quick:

Begging your pardon: I missed the lack of a comma in "operators and delimiters" and 
read those as two separate classes.  The second sentence is therefore correct after 
all, but it may help to prevent others from making this somewhat subtle error by 
using an itemized list instead.
... There are four classes:
   1) identifiers
   2) keywords
   3) operators and delimiters
   4) literals
....

@peterGo
Copy link
Contributor

peterGo commented Dec 24, 2009

Comment 2:

Duplicate of issue #361.

@robpike
Copy link
Contributor

robpike commented Dec 28, 2009

Comment 3:

Owner changed to g...@golang.org.

Status changed to Accepted.

@griesemer
Copy link
Contributor

Comment 4:

Status changed to Started.

@griesemer
Copy link
Contributor

Comment 5:

This issue was closed by revision eb109a7.

Status changed to Fixed.

Merged into issue #-.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants