diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-11-18 03:13:31 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-11-18 03:13:31 -0500 |
commit | 9db0bec7922d9935d926192d0b6ac4590d024d76 (patch) | |
tree | 532f200d664d5906106c9154903e252a99549615 /scripts | |
parent | b3e8429b54d27e57e6e238a487de06400d3a73fd (diff) | |
download | kutter-9db0bec7922d9935d926192d0b6ac4590d024d76.tar.gz kutter-9db0bec7922d9935d926192d0b6ac4590d024d76.tar.xz kutter-9db0bec7922d9935d926192d0b6ac4590d024d76.zip |
buildcommands: Detect duplicate strings when generating static string ids
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/buildcommands.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/buildcommands.py b/scripts/buildcommands.py index 57fad1da..840637a2 100644 --- a/scripts/buildcommands.py +++ b/scripts/buildcommands.py @@ -69,10 +69,13 @@ STATIC_STRING_MIN = 2 class HandleStaticStrings: def __init__(self): self.static_strings = [] + self.found_strings = {} self.ctr_dispatch = { '_DECL_STATIC_STR': self.decl_static_str } def decl_static_str(self, req): msg = req.split(None, 1)[1] - self.static_strings.append(msg) + if msg not in self.found_strings: + self.found_strings[msg] = 1 + self.static_strings.append(msg) def update_data_dictionary(self, data): data['static_strings'] = { i + STATIC_STRING_MIN: s for i, s in enumerate(self.static_strings) } |