Start work on porting hints kitten to Go

This commit is contained in:
Kovid Goyal
2023-03-08 20:06:26 +05:30
parent bcd3802d3e
commit 09ceb3c0be
12 changed files with 523 additions and 12 deletions

View File

@@ -438,9 +438,14 @@ def gen_ucd() -> None:
f.truncate()
f.write(raw)
chars = ''.join(classes_to_regex(cz, exclude='\n\r'))
with open('kittens/hints/url_regex.py', 'w') as f:
f.write('# generated by gen-wcwidth.py, do not edit\n\n')
f.write("url_delimiters = '{}' # noqa".format(''.join(classes_to_regex(cz, exclude='\n\r'))))
f.write(f"url_delimiters = '{chars}' # noqa")
with open('tools/cmd/hints/url_regex.go', 'w') as f:
f.write('// generated by gen-wcwidth.py, do not edit\n\n')
f.write('package hints\n\n')
f.write(f"const URL_DELIMITERS = `{chars}`")
def gen_names() -> None: