From 71485af5e8cbca7dbe96f351582f1d7158995728 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Thu, 9 Apr 2015 00:06:03 -0400 Subject: [PATCH] Skip #if lines in getNameFromDecl. Otherwise we get all these 'defined' symbols everywhere. Change-Id: I4c21a4df8963146a79af3511a400f06698f1078a Reviewed-on: https://boringssl-review.googlesource.com/4292 Reviewed-by: Adam Langley --- util/doc.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/util/doc.go b/util/doc.go index 70630367..20feae54 100644 --- a/util/doc.go +++ b/util/doc.go @@ -200,7 +200,18 @@ func skipPast(s, skip string) string { return s } +func skipLine(s string) string { + i := strings.Index(s, "\n") + if i > 0 { + return s[i:] + } + return "" +} + func getNameFromDecl(decl string) (string, bool) { + for strings.HasPrefix(decl, "#if") { + decl = skipLine(decl) + } if strings.HasPrefix(decl, "struct ") { return "", false }