Skip to content
Prev Previous commit
Clean up generate_sre_constants.py by removing comments
Removed commented-out code related to generating SRE constants.
  • Loading branch information
terryluan12 authored Jan 5, 2026
commit 583e58b9ce1ba2201af50b89f3bb498488d239fe
46 changes: 0 additions & 46 deletions scripts/generate_sre_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,49 +137,3 @@ def main(
import sys

main(*sys.argv[1:])


# dump(f, OPCODES, "SreOpcode", "u32", "")
# dump(f, ATCODES, "SreAtCode", "u32", "AT_")
# dump(f, CHCODES, "SreCatCode", "u32", "CATEGORY_")

# def bitflags(typ, int_t, prefix, flags):
# f.write(f"""\
# bitflags! {{
# pub struct {typ}: {int_t} {{
# """)
# for name in flags:
# val = globals()[prefix + name]
# f.write(f" const {name} = {val};\n")
# f.write("""\
# }
# }
# """)

# bitflags("SreFlag", "u16", "SRE_FLAG_", [
# "TEMPLATE",
# "IGNORECASE",
# "LOCALE",
# "MULTILINE",
# "DOTALL",
# "UNICODE",
# "VERBOSE",
# "DEBUG",
# "ASCII",
# ])

# bitflags("SreInfo", "u32", "SRE_INFO_", [
# "PREFIX", "LITERAL", "CHARSET",
# ])

# print("done")


# if __name__ == "__main__":
# import sys
# if len(sys.argv) > 1:
# constants_file = sys.argv[1]
# else:
# import os
# constants_file = os.path.join(os.path.dirname(__file__), "../../sre-engine/src/constants.rs")
# with open(constants_file, "w") as f:
Loading