Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions compiler_gym/third_party/inst2vec/inst2vec_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,16 @@ def preprocess(data):
# XFG-transforming (inline and abstract statements)
########################################################################################################################
# Helper regexs for structure type inlining
vector_type = "<\d+ x " + rgx.first_class_type + ">"
array_type = "\[\d+ x " + rgx.first_class_type + "\]"
array_of_array_type = "\[\d+ x " + "\[\d+ x " + rgx.first_class_type + "\]" + "\]"
vector_type = r"<\d+ x " + rgx.first_class_type + r">"
array_type = r"\[\d+ x " + rgx.first_class_type + r"\]"
array_of_array_type = r"\[\d+ x " + r"\[\d+ x " + rgx.first_class_type + r"\]" + r"\]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider rf-strings?

array_of_array_type = rf"\[\d+ x \[\d+ x {rgx.first_class_type}\]\]"

function_type = (
rgx.first_class_type
+ " \("
+ r" \("
+ rgx.any_of([rgx.first_class_type, vector_type, array_type, "..."], ",")
+ "*"
+ rgx.any_of([rgx.first_class_type, vector_type, array_type, "..."])
+ "\)\**"
+ r"\)\**"
)
structure_entry = rgx.any_of(
[
Expand Down Expand Up @@ -460,7 +460,7 @@ def construct_struct_types_dictionary_for_file(data):
struct_prev.append(comp_structure)
struct_prev_with_comma.append(comp_structure + ", ")
else:
comp_structure = "<?{ [ <>{}\dx\[\]\(\)\.,\*%IDvfloatdubeipqcy]+}>?$"
comp_structure = r"<?{ [ <>{}\dx\[\]\(\)\.,\*%IDvfloatdubeipqcy]+}>?$"

# Loop over contents of to_process
for i in list(to_process.items()):
Expand Down
Loading