Skip to content
Snippets Groups Projects

Sort headers/global definitions to enable reproducible code generation

Merged Stephan Seitz requested to merge seitz/pystencils:sort-headers into master
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
@@ -87,7 +87,7 @@ def get_global_declarations(ast):
@@ -87,7 +87,7 @@ def get_global_declarations(ast):
visit_node(ast)
visit_node(ast)
return set(global_declarations)
return sorted(set(global_declarations))
def get_headers(ast_node: Node) -> Set[str]:
def get_headers(ast_node: Node) -> Set[str]:
@@ -103,7 +103,7 @@ def get_headers(ast_node: Node) -> Set[str]:
@@ -103,7 +103,7 @@ def get_headers(ast_node: Node) -> Set[str]:
if isinstance(a, Node):
if isinstance(a, Node):
headers.update(get_headers(a))
headers.update(get_headers(a))
return headers
return sorted(headers)
# --------------------------------------- Backend Specific Nodes -------------------------------------------------------
# --------------------------------------- Backend Specific Nodes -------------------------------------------------------
Loading