Commit d2e1dae3 authored by Robert Griesemer's avatar Robert Griesemer

cmd/compile: adjust starting token value

The actual values assigned to tokens was inherited from the yacc-based
grammar. With the most recent cleanups, all single-char tokens such as
commas, semis, parens, etc., that get returned from lexer.next simply
as their Unicode values are below utf8.RuneSelf (i.e., 7bit ASCII).
Lower the initial starting value for named token constants accordingly.

Change-Id: I7eb8e584dbb3bc7f9dab849d1b68a91320cffebd
Reviewed-on: https://go-review.googlesource.com/19913Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent 772cea81
......@@ -873,7 +873,9 @@ type lexer struct {
}
const (
LLITERAL = 57346 + iota
// The value of single-char tokens is just their character's Unicode value.
// They are all below utf8.RuneSelf. Shift other tokens up to avoid conflicts.
LLITERAL = utf8.RuneSelf + iota
LASOP
LCOLAS
LBREAK
......@@ -955,6 +957,7 @@ l0:
}
return
}
// c < utf8.RuneSelf
var c1 rune
var op Op
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment