@@ -323,7 +323,8 @@ def esc_char(m):
323323static_qstr_list_ident = list (map (qstr_escape , static_qstr_list ))
324324
325325
326- def parse_input_headers (infiles ):
326+ # CIRCUITPY-CHANGE: add translations handling
327+ def parse_input_headers_with_translations (infiles ):
327328 qcfgs = {}
328329 qstrs = {}
329330 # CIRCUITPY-CHANGE: add translations
@@ -428,13 +429,19 @@ def print_qstr_data(qcfgs, qstrs, translations):
428429 qbytes = make_bytes (cfg_bytes_len , cfg_bytes_hash , qstr )
429430 print ("QDEF0(MP_QSTR_%s, %s)" % (qstr_escape (qstr ), qbytes ))
430431
432+ # CIRCUITPY-CHANGE: track total qstr size
433+ total_qstr_size = 0
434+
431435 # add remaining qstrs to the sorted (by value) pool (unless they're in
432436 # operator_qstr_list, in which case add them to the unsorted pool)
433437 for ident , qstr in sorted (qstrs .values (), key = lambda x : x [1 ]):
434438 qbytes = make_bytes (cfg_bytes_len , cfg_bytes_hash , qstr )
435439 pool = 0 if qstr in operator_qstr_list else 1
436440 print ("QDEF%d(MP_QSTR_%s, %s)" % (pool , ident , qbytes ))
437441
442+ # CIRCUITPY-CHANGE: track total qstr size
443+ total_qstr_size += len (qstr )
444+
438445 # CIRCUITPY-CHANGE: translations
439446 print (
440447 "// Enumerate translated texts but don't actually include translations. Instead, the linker will link them in."
0 commit comments