#!/usr/bin/env python3
import fileinput
import json
current_help_msg = []
current_module_code = []
current_module_name = None
current_module_signature = None
def print_current_cell():
print("cell_help[\"%s\"] = %s;" % (current_module_name, "\n".join([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 = []
ryrefslogtreecommitdiffstats
blob: 9ef7653c5e4424def9a38eff22959f0cc71c06fe (
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
|
/* Copyright 2017 Fred Sundvik
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_
#define QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_
#include "visualizer.h"
// Some predefined keyframe functions that can be used by the user code
// Does nothing, useful for adding delays
bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state);
#endif /* QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_ */
|