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
|
|
@ -62,7 +62,7 @@ func (p *Prog) loadDebugInfo() {
|
|||
for _, c := range p.Crefs {
|
||||
// If we've already found this name as a define, it is not a Cref.
|
||||
if val, ok := defines[c.Name]; ok {
|
||||
_, err := parser.ParseExpr("", val)
|
||||
_, err := parser.ParseExpr("", val, nil)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "The value in C.%s does not parse as a Go expression; cannot use.\n", c.Name)
|
||||
os.Exit(2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue