]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: simplify parsing of possibly absent type
authorRobert Griesemer <gri@golang.org>
Sat, 21 Nov 2015 01:31:33 +0000 (17:31 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 23 Nov 2015 21:29:27 +0000 (21:29 +0000)
commit656a732a217ee3ac4e6a6442072994e4dccb4094
tree8a5b557da4fcdfdf2eeaa6fa5ebcaecce47eee7f
parent8ab6e16cc94f7d8e57246425b7b298e0228b1081
cmd/compile: simplify parsing of possibly absent type

Introduce a try_ntype function which doesn't return an error upon
not finding a type. Use it instead of having separate repeated
token checks. Simpler, less code, and more efficient.

Change-Id: I81e482158b71901eb179470269349688636aa0ba
Reviewed-on: https://go-review.googlesource.com/17157
Reviewed-by: Chris Manghane <cmang@golang.org>
src/cmd/compile/internal/gc/parser.go