Skip to content

Commit aa4e2be

Browse files
xiangfu-codeniupilot[bot]
authored andcommitted
chore: supplement signature comments
Co-authored-by: niupilot[bot] <230321281+niupilot[bot]@users.noreply.github.com> Signed-off-by: Micro Liu <858039956@qq.com>
1 parent 9055747 commit aa4e2be

1 file changed

Lines changed: 18 additions & 13 deletions

File tree

symbol/symbol.go

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
package symbol
22

3+
// represents the origin of a function signature
4+
type SigSource int
5+
6+
const (
7+
// signature extracted from docstring
8+
SigSourceDoc SigSource = iota
9+
// signature from Python inspect module
10+
SigSourceInspect
11+
// generic fallback signature
12+
SigSourceParadigm
13+
)
14+
15+
// represents a function signature with its source information
16+
type Signature struct {
17+
Str string `json:"str"` // The signature string
18+
Source SigSource `json:"source"` // Where the signature was obtained
19+
}
20+
321
type Symbol struct {
422
Name string `json:"name"`
523
Type string `json:"type"`
@@ -12,16 +30,3 @@ type Module struct {
1230
Functions []*Symbol `json:"functions"` // package functions
1331
// TODO: variables, classes, etc.
1432
}
15-
16-
type SigSource int
17-
18-
const (
19-
SigSourceDoc SigSource = iota
20-
SigSourceInspect
21-
SigSourceParadigm
22-
)
23-
24-
type Signature struct {
25-
Str string `json:"str"`
26-
Source SigSource `json:"source"`
27-
}

0 commit comments

Comments
 (0)