mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
More steps towards tracking of identifier scopes.
- provide scope to parse functions; if non-nil, parser uses the scope to declare and lookup identifiers - resolve forward references where possible R=rsc CC=golang-dev https://golang.org/cl/194098
This commit is contained in:
parent
1c369bd55f
commit
f39dc9fff2
13 changed files with 103 additions and 70 deletions
|
|
@ -37,7 +37,7 @@ func initRewrite() {
|
|||
// but there are problems with preserving formatting and also
|
||||
// with what a wildcard for a statement looks like.
|
||||
func parseExpr(s string, what string) ast.Expr {
|
||||
x, err := parser.ParseExpr("input", s)
|
||||
x, err := parser.ParseExpr("input", s, nil)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "parsing %s %s: %s\n", what, s, err)
|
||||
os.Exit(2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue