diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-04-02 13:08:51 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-04-02 13:08:51 +0200 |
commit | cc46c77036d3208d717a243e7a97e48609dfaebf (patch) | |
tree | 540e9a2cbd79e963332bf690a1c06ae31dd257be /lib | |
parent | 68548a3823e85461c69ffd85d3322335b3d6fad9 (diff) |
add transition_map accessor
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/protocol_benchmarks.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/protocol_benchmarks.py b/lib/protocol_benchmarks.py index 133e4b5..2761699 100755 --- a/lib/protocol_benchmarks.py +++ b/lib/protocol_benchmarks.py @@ -84,6 +84,11 @@ class DummyProtocol: self.transition_map[code_snippet.rstrip()] = args return code_snippet + def get_transition_args(self, code_snippet: str) -> list: + if code_snippet in self.transition_map: + return self.transition_map[code_snippet] + return list() + class ArduinoJSON(DummyProtocol): def __init__(self, data, bufsize = 255, int_type = 'uint16_t', float_type = 'float'): @@ -1328,7 +1333,7 @@ def codegen_for_lib(library, library_options, data): raise ValueError('Unsupported library: {}'.format(library)) -def shorten_call(snippet, lib = ''): +def shorten_call(snippet, lib): """ Remove literal arguments and variable names from ProtoBench function calls. |