aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emlink.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/emlink.py b/emlink.py
index 38207d6a..229ea907 100644
--- a/emlink.py
+++ b/emlink.py
@@ -145,8 +145,10 @@ class AsmModule():
def update_fts(what):
def fix(m):
table = 'FUNCTION_TABLE_' + m.group(1)
- return '%s[%s& %d]' % (table, m.group(2), f_sizes[table]-1)
- return re.sub('FUNCTION_TABLE_(\w+)\[(.*)& (\d+)\]', fix, what) # XXX handle nested [, ]
+ contents = m.group(2)
+ assert '[' not in contents # TODO handle nesting
+ return '%s[%s&%d]' % (table, contents, f_sizes[table]-1)
+ return re.sub('FUNCTION_TABLE_(\w+)\[(.*)& ?(\d+)\]', fix, what)
main.funcs_js = update_fts(main.funcs_js)
main.extra_funcs_js = update_fts(main.extra_funcs_js)