Changed the logic of the Windows constants generator so that it only generates unknown constants and complains on known constants (though that's disabled during the transitional period) as that's the situation that will happen now.
This commit is contained in:
parent
339a77b5d6
commit
9893387848
|
@ -87,27 +87,23 @@ func main() {
|
||||||
pkg := getPackage(pkgpath)
|
pkg := getPackage(pkgpath)
|
||||||
gatherNames(pkg)
|
gatherNames(pkg)
|
||||||
|
|
||||||
if len(unknown) > 0 {
|
// if we still have some known, I didn't clean things up completely
|
||||||
s := "error: the following are still unknown!"
|
knowns := ""
|
||||||
for k, _ := range unknown {
|
for ident, kind := range known {
|
||||||
s += "\n" + k
|
if kind != "var" && kind != "const" {
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
panic(s)
|
knowns += "\n" + ident + " (" + kind + ")"
|
||||||
|
}
|
||||||
|
if knowns != "" {
|
||||||
|
//ignore for now while I still migrate everything
|
||||||
|
// panic("error: the following are still known!" + knowns) // has a newline already
|
||||||
}
|
}
|
||||||
|
|
||||||
// keep sorted for git
|
// keep sorted for git
|
||||||
consts := make([]string, 0, len(known))
|
consts := make([]string, 0, len(unknown))
|
||||||
vars := ""
|
for ident, _ := range unknown {
|
||||||
for ident, kind := range known {
|
consts = append(consts, ident)
|
||||||
if kind == "var" {
|
|
||||||
vars += "\n" + ident
|
|
||||||
}
|
|
||||||
if kind == "const" {
|
|
||||||
consts = append(consts, ident)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if vars != "" {
|
|
||||||
panic("error: the following are still unknown!" + vars) // has a newline already
|
|
||||||
}
|
}
|
||||||
sort.Strings(consts)
|
sort.Strings(consts)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue