summaryrefslogtreecommitdiff
path: root/src/gperf_unfold_key_conv.py
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2019-11-29 11:26:57 +0100
committerJörg Frings-Fürst <debian@jff.email>2019-11-29 11:26:57 +0100
commit7f4e90f2759d6a15812172ee19f3ad5b58940beb (patch)
tree5f90c63b8ba73f4ecd23d6e642c1ab34dccea033 /src/gperf_unfold_key_conv.py
parent68d1ec60c90d27c511d51ce0bef44b132a7ddf11 (diff)
parent7e149a97d276ce3b4c5e34f965766c8e40e03fef (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/gperf_unfold_key_conv.py')
-rwxr-xr-xsrc/gperf_unfold_key_conv.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gperf_unfold_key_conv.py b/src/gperf_unfold_key_conv.py
index 3cf4836..d999d4e 100755
--- a/src/gperf_unfold_key_conv.py
+++ b/src/gperf_unfold_key_conv.py
@@ -12,7 +12,7 @@ REG_STR_AT = re.compile('str\[(\d+)\]')
REG_UNFOLD_KEY = re.compile('onigenc_unicode_unfold_key\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+size_t\s+len\)')
REG_ENTRY = re.compile('\{".+?",\s*/\*(.+?)\*/\s*(-?\d+),\s*(\d)\}')
REG_EMPTY_ENTRY = re.compile('\{"",\s*(-?\d+),\s*(\d)\}')
-REG_IF_LEN = re.compile('if\s*\(\s*len\s*<=\s*MAX_WORD_LENGTH.+')
+REG_IF_LEN = re.compile('\s*if\s*\(\s*len\s*<=\s*MAX_WORD_LENGTH.+')
REG_GET_HASH = re.compile('(?:register\s+)?(?:unsigned\s+)?int\s+key\s*=\s*hash\s*\(str,\s*len\);')
REG_GET_CODE = re.compile('(?:register\s+)?const\s+char\s*\*\s*s\s*=\s*wordlist\[key\]\.name;')
REG_CODE_CHECK = re.compile('if\s*\(\*str\s*==\s*\*s\s*&&\s*!strncmp.+\)')
@@ -32,7 +32,7 @@ def parse_line(s):
if r != s: return r
r = re.sub(REG_EMPTY_ENTRY, '{0xffffffff, \\1, \\2}', s)
if r != s: return r
- r = re.sub(REG_IF_LEN, 'if (0 == 0)', s)
+ r = re.sub(REG_IF_LEN, '', s)
if r != s: return r
r = re.sub(REG_GET_HASH, 'int key = hash(&code);', s)
if r != s: return r