fix: Fix metadata to show crystal

This commit is contained in:
Roberto Alsina 2024-09-23 17:53:13 -03:00
parent 2fab6eaff0
commit 15b9a781a9

View File

@ -38,6 +38,12 @@ for fname in glob.glob("lexers/*.xml"):
lexer_by_filename[filename].add(lexer_name) lexer_by_filename[filename].add(lexer_name)
with open("src/constants/lexers.cr", "w") as f: with open("src/constants/lexers.cr", "w") as f:
# Crystal doesn't come from a xml file
lexer_by_name["crystal"] = "crystal"
lexer_by_name["cr"] = "crystal"
lexer_by_filename["*.cr"] = ["crystal"]
lexer_by_mimetype["text/x-crystal"] = "crystal"
f.write("module Tartrazine\n") f.write("module Tartrazine\n")
f.write(" LEXERS_BY_NAME = {\n") f.write(" LEXERS_BY_NAME = {\n")
for k in sorted(lexer_by_name.keys()): for k in sorted(lexer_by_name.keys()):