Not sure if you were addressing me or the OP.

If me: Of course; that is the realization that comes once you understand how 
leftmost longest matching works :) My email was written from the standpoint 
that the source of the confusion was the expectation that tokens were *only* 
delimited by whitespace, which seemed to be the case for the OP — they were 
expecting &&& to be treated as one token, not two.

If the OP: go back and read through my step by step example and you will see 
that I, like the Go parser, did not need to unread anything. You can construct 
your own lines to scan and prove this for yourself if necessary.
> On Oct 31, 2016, at 4:57 PM, Jan Mercl <0xj...@gmail.com> wrote:
> 
> On Mon, Oct 31, 2016 at 9:48 PM Pietro Gagliardi <andl...@lostsig.net 
> <mailto:andl...@lostsig.net>> wrote:
> 
> > In Go, as in most languages, spaces do not *have to* delimit tokens. A 
> > token ends when the leftmost longest matching token is found, and the rest 
> > is placed back in the input buffer for the next token.
> 
> FTR: The lexical grammar of Go is a regular language. A single lookahead 
> element is sufficient, it's not necessary to "unread" anything.
> 
> -- 
> -j
> 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to