diff options
author | David Benjamin <davidben@chromium.org> | 2015-05-16 19:00:51 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-05-21 00:33:26 +0300 |
commit | 6deacb389504d63bc9851d0a9498fabc64faf353 (patch) | |
tree | 4aaf35910134f71927682c22e0ba9ea78059712e /util | |
parent | 4831c3328c6734fd485670c45dbc29716600f2ac (diff) |
Parse macros in getNameFromDecl.
Fleshes out the table of contents more.
Change-Id: I8f8f0e43bdf7419f978b4fc66de80922ed1ae425
Reviewed-on: https://boringssl-review.googlesource.com/4785
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/doc.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/util/doc.go b/util/doc.go index 20feae54..ae89c301 100644 --- a/util/doc.go +++ b/util/doc.go @@ -215,6 +215,18 @@ func getNameFromDecl(decl string) (string, bool) { if strings.HasPrefix(decl, "struct ") { return "", false } + if strings.HasPrefix(decl, "#define ") { + // This is a preprocessor #define. The name is the next symbol. + decl = strings.TrimPrefix(decl, "#define ") + for len(decl) > 0 && decl[0] == ' ' { + decl = decl[1:] + } + i := strings.IndexAny(decl, "( ") + if i < 0 { + return "", false + } + return decl[:i], true + } decl = skipPast(decl, "STACK_OF(") decl = skipPast(decl, "LHASH_OF(") i := strings.Index(decl, "(") |