Add code source blocks to the chapter Graph.

Fix "函数" and "方法"
This commit is contained in:
krahets
2023-02-10 01:04:26 +08:00
parent d37c71b928
commit 300016393b
47 changed files with 106 additions and 409 deletions

View File

@ -66,7 +66,7 @@ class ExtractCodeBlocksGo(ExtractCodeBlocksJava):
def check_func_blong_to_class(label):
class_label_pattern = re.compile(f".*\*{label}\).*")
func_return_pattern = re.compile(f".*\*{label}.*")
func_return_pattern = re.compile(f".*{label}.*")
constructor_pattern = re.compile(f".*new.*")
class_label_match = class_label_pattern.match(f"{func_cls_label}")
@ -172,7 +172,7 @@ class ExtractCodeBlocksGo(ExtractCodeBlocksJava):
replace_tabs(func)
# for code_path in glob.glob("codes/go/chapter_*/array_hash_map.go"):
# ext = ExtractCodeBlocksGo()
# res = ext.extract(code_path)
# pass
for code_path in glob.glob("codes/*/chapter_*/graph_adjacency_matrix.go"):
ext = ExtractCodeBlocksGo()
res = ext.extract(code_path)
pass