go/doc: add nil to list of predeclared constants

R=gri
CC=gobot, golang-dev
https://golang.org/cl/6601054
This commit is contained in:
Andrew Gerrand 2012-10-04 08:37:48 +10:00
parent 81ae666f16
commit ce6acefc5d
2 changed files with 5 additions and 4 deletions

View File

@ -138,7 +138,7 @@ func playExample(file *ast.File, body *ast.BlockStmt) *ast.File {
// Remove predeclared identifiers from unresolved list.
for n := range unresolved {
if n == "nil" || predeclaredTypes[n] || predeclaredConstants[n] || predeclaredFuncs[n] {
if predeclaredTypes[n] || predeclaredConstants[n] || predeclaredFuncs[n] {
delete(unresolved, n)
}
}

View File

@ -751,7 +751,7 @@ func sortedFuncs(m methodSet, allMethods bool) []*Func {
}
// ----------------------------------------------------------------------------
// Predeclared identifiers (minus "nil")
// Predeclared identifiers
var predeclaredTypes = map[string]bool{
"bool": true,
@ -795,7 +795,8 @@ var predeclaredFuncs = map[string]bool{
}
var predeclaredConstants = map[string]bool{
"iota": true,
"true": true,
"false": true,
"iota": true,
"nil": true,
"true": true,
}