Create regex-to-grammar.py

This commit is contained in:
ochafik 2024-03-10 13:23:00 +00:00
parent 660e8321f5
commit add8fee04a

View file

@ -0,0 +1,18 @@
import json, subprocess, sys, os
assert len(sys.argv) == 2
[_, pattern] = sys.argv
print(subprocess.check_output(
[
"python",
os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"json-schema-to-grammar.py"),
"-",
],
text=True,
input=json.dumps({
"type": "string",
"pattern": pattern,
}, indent=2)))