if macro_filename:
(consts, macros) = ReadMacros(ReadFile(macro_filename))
filter_chain.append(lambda l: ExpandConstants(l, consts))
- filter_chain.append(lambda l: ExpandInlineMacros(l))
filter_chain.append(lambda l: ExpandMacros(l, macros))
filter_chain.extend([
RemoveCommentsAndTrailingWhitespace,
+ ExpandInlineMacros,
ExpandInlineConstants,
Validate,
jsmin.JavaScriptMinifier().JSMinify
def PutInt(blob_file, value):
- assert(value >= 0 and value < (1 << 20))
- size = 1 if (value < 1 << 6) else (2 if (value < 1 << 14) else 3)
- value_with_length = (value << 2) | size
+ assert(value >= 0 and value < (1 << 28))
+ if (value < 1 << 6):
+ size = 1
+ elif (value < 1 << 14):
+ size = 2
+ elif (value < 1 << 22):
+ size = 3
+ else:
+ size = 4
+ value_with_length = (value << 2) | (size - 1)
byte_sequence = bytearray()
for i in xrange(size):