]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/syntax: factor out list parsing
authorgriesemer <gri@golang.org>
Wed, 11 Oct 2017 23:57:39 +0000 (16:57 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 16 Oct 2017 17:20:25 +0000 (17:20 +0000)
commit645c661a54e35cf0e4ee7fb480b00a4b4d2b1ba0
treeecb666da1f344e2e9bdaabe85b18dd4fe591aa5e
parentf8f0d6c4deab0837b03ddccfe0edf775c3bbd49f
cmd/compile/internal/syntax: factor out list parsing

Instead of repeating the same list parsing pattern for parenthesized
of braced comma or semicolon-separated lists, introduce a single list
parsing function that can be parametrized and which takes a closure
to parse list elements.

This ensures the same error handling and recovery logic is used across
all lists and simplifies the code.

No semantic change.

Change-Id: Ia738d354d6c2e0c3d84a5f1c7269a6eb95685edc
Reviewed-on: https://go-review.googlesource.com/70492
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/syntax/parser.go