fix(yaml): flex switch warnings (#4949)
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com> Co-authored-by: 3djc <3djc@gh.com> Co-authored-by: elecpower <neilh713@tpg.com.au>
This commit is contained in:
co-authored by
raphaelcoeffic
3djc
elecpower
parent
dd87ecb89a
commit
0d6ce7d22d
@@ -560,11 +560,16 @@ def max_bits(struct):
|
||||
bits = s.bits
|
||||
return bits
|
||||
|
||||
def padding_bits(array):
|
||||
array_bits = (array.bits // array.length) * array.length
|
||||
return array.bits - array_bits
|
||||
|
||||
template = jinja2.Template(open(sys.argv[2]).read(), lstrip_blocks=True, trim_blocks=True)
|
||||
|
||||
template.globals['max_len'] = max_len
|
||||
template.globals['get_max_len'] = get_max_len
|
||||
template.globals['max_bits'] = max_bits
|
||||
template.globals['padding_bits'] = padding_bits
|
||||
|
||||
## fixme: root_node_name needs to be mangled (contains ',')
|
||||
print(template.render(root=RootAST,root_nodes=top_node_names,root_node_name=root_nodes_name))
|
||||
|
||||
Reference in New Issue
Block a user