-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_go_code_utils.py
More file actions
73 lines (69 loc) · 2.04 KB
/
_go_code_utils.py
File metadata and controls
73 lines (69 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python3
"""
Shared utilities for parsing and processing Go code blocks in markdown files.
This module provides common functions for:
- Detecting and extracting Go code blocks from markdown
- Parsing Go function, method, and type signatures
- Normalizing Go signatures and type names
- Detecting example code (single lines and entire code blocks)
Facade: re-exports from lib.go_markdown for backward compatibility.
Implementation lives in scripts/lib/go_markdown/ (_base, _rest).
"""
from lib.go_markdown import (
EXAMPLE_MARKERS,
EXAMPLE_NAME_PREFIXES,
InterfaceParser,
Signature,
check_kind_word_after,
count_go_definitions,
determine_type_kind,
extract_go_doc_comment_above,
extract_interfaces_from_go_file,
extract_interfaces_from_markdown,
extract_receiver_type,
find_definition_line_index,
find_first_definition,
find_go_code_blocks,
is_continuation_line,
is_definition_start_line,
is_example_code,
is_example_definition,
is_example_signature_name,
is_in_go_code_block,
is_public_name,
is_signature_only_code_block,
normalize_generic_name,
normalize_go_signature,
normalize_go_signature_with_params,
parse_go_def_signature,
remove_go_comments,
)
__all__ = [
"EXAMPLE_MARKERS",
"EXAMPLE_NAME_PREFIXES",
"InterfaceParser",
"Signature",
"check_kind_word_after",
"count_go_definitions",
"determine_type_kind",
"extract_go_doc_comment_above",
"extract_interfaces_from_go_file",
"extract_interfaces_from_markdown",
"extract_receiver_type",
"find_definition_line_index",
"find_first_definition",
"find_go_code_blocks",
"is_continuation_line",
"is_definition_start_line",
"is_example_code",
"is_example_definition",
"is_example_signature_name",
"is_in_go_code_block",
"is_public_name",
"is_signature_only_code_block",
"normalize_generic_name",
"normalize_go_signature",
"normalize_go_signature_with_params",
"parse_go_def_signature",
"remove_go_comments",
]