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>
This commit is contained in:
parent
4831c3328c
commit
6deacb3895
12
util/doc.go
12
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, "(")
|
||||
|
Loading…
Reference in New Issue
Block a user