aboutsummaryrefslogtreecommitdiffstats
path: root/util/git-hooks/commit-msg
blob: d43eb4529c6c5d336a2378853ce1989fb933b05b (plain)
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
generated by cgit v1.2.3 (git 2.25.1) at 2025-12-18 13:47:20 +0000
 


an class="n">json.dumps(line) for line in current_help_msg])))
    print("cell_code[\"%s+\"] = %s;" % (current_module_name, "\n".join([json.dumps(line) for line in current_module_code])))

for line in fileinput.input():
    if line.startswith("//-"):
        current_help_msg.append(line[4:] if len(line) > 4 else "\n")
    if line.startswith("module "):
        current_module_name = line.split()[1].strip("\\")
        current_module_signature = " ".join(line.replace("\\", "").replace(";", "").split()[1:])
        current_module_code = []
    elif not line.startswith("endmodule"):
        line = "    " + line
    current_module_code.append(line.replace("\t", "    "))
    if line.startswith("endmodule"):
        if len(current_help_msg) == 0:
            current_help_msg.append("\n")
            current_help_msg.append("    %s\n" % current_module_signature)
            current_help_msg.append("\n")
            current_help_msg.append("No help message for this cell type found.\n")
            current_help_msg.append("\n")
        print_current_cell()
        current_help_msg = []