MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / generate_specs

Function generate_specs

scripts/generate-lang-code.py:66–90  ·  view source on GitHub ↗

Print lang spec entries for lang_specs.c.

(langs)

Source from the content-addressed store, hash-verified

64
65
66def generate_specs(langs):
67 """Print lang spec entries for lang_specs.c."""
68 print("\n=== Extern Declarations (paste at top of lang_specs.c) ===")
69 for lang in langs:
70 print(f"extern const TSLanguage *{lang['ts_func']}(void);")
71
72 print("\n=== Module Type Arrays (paste before spec table) ===")
73 for lang in langs:
74 arr = f"{lang['name']}_module_types"
75 print(
76 f'static const char *{arr}[] = {{"{lang["module_root"]}", NULL}};'
77 )
78
79 print("\n=== Spec Table Entries (paste into lang_specs[]) ===")
80 for lang in langs:
81 mod = f"{lang['name']}_module_types"
82 print(f" // CBM_LANG_{lang['enum']}")
83 print(
84 f" [CBM_LANG_{lang['enum']}] = {{CBM_LANG_{lang['enum']}, "
85 f"empty_types, empty_types, empty_types, {mod}, "
86 f"empty_types, empty_types, empty_types, empty_types, "
87 f"empty_types, empty_types, empty_types, NULL, empty_types, "
88 f"NULL, NULL, {lang['ts_func']}}},"
89 )
90 print()
91
92
93def generate_language_c(langs):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected