"""Verify the committed generated dialect matches the dialect submodule XML. Intended for pre-commit hooks and CI. Exits nonzero when regeneration is needed. """ import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) from tools import gen_dialect def main() -> int: try: gen_dialect.generate(check=True, no_validate=True) except SystemExit as exc: print(exc, file=sys.stderr) return 1 return 0 if __name__ == "__main__": raise SystemExit(main())