docs: ignore deprecated built-ins in reference (#5697)

Fixes #5607

Signed-off-by: Anders Eknert <anders@styra.com>
This commit is contained in:
Anders Eknert
2023-02-24 17:27:45 +01:00
committed by GitHub
parent 83b1614c94
commit 3c6a237ab6
2 changed files with 10 additions and 8 deletions
-1
View File
@@ -97,7 +97,6 @@
"net.cidr_intersects",
"net.cidr_is_valid",
"net.cidr_merge",
"net.cidr_overlap",
"net.lookup_ip_addr"
],
"numbers": [
+10 -7
View File
@@ -151,19 +151,22 @@ func sortedCaps() []versionedCaps {
}
func builtinCategories(b *ast.Builtin) []string {
if b.IsDeprecated() {
return nil
}
if len(b.Categories) > 0 {
return b.Categories
}
if s := strings.Split(b.Name, "."); len(s) > 1 {
return []string{s[0]}
}
if !b.IsDeprecated() {
switch b.Name {
case "assign", "eq", "print":
// Do nothing.
default:
log.Printf("WARN: not categorized: %s", b.Name)
}
switch b.Name {
case "assign", "eq", "print":
// Do nothing.
default:
log.Printf("WARN: not categorized: %s", b.Name)
}
return nil
}