1 Commits

Author SHA1 Message Date
72afec773e Integrate heuristics into lexer selection 2024-08-24 21:35:06 -03:00
4 changed files with 17 additions and 17 deletions

View File

@ -29,7 +29,7 @@ This only covers the RegexLexers, which are the most common ones,
but it means the supported languages are a subset of Chroma's, which but it means the supported languages are a subset of Chroma's, which
is a subset of Pygments'. is a subset of Pygments'.
Currently Tartrazine supports ... 247 languages. Currently Tartrazine supports ... 248 languages.
It has 331 themes (63 from Chroma, the rest are base16 themes via It has 331 themes (63 from Chroma, the rest are base16 themes via
[Sixteen](https://github.com/ralsina/sixteen) [Sixteen](https://github.com/ralsina/sixteen)

View File

@ -52,6 +52,6 @@ with open("src/constants/lexers.cr", "w") as f:
f.write(" LEXERS_BY_FILENAME = {\n") f.write(" LEXERS_BY_FILENAME = {\n")
for k in sorted(lexer_by_filename.keys()): for k in sorted(lexer_by_filename.keys()):
v = lexer_by_filename[k] v = lexer_by_filename[k]
f.write(f'"{k}" => {str(sorted(list(v))).replace("'", "\"")}, \n') f.write(f'"{k}" => {str(list(v)).replace("'", "\"")}, \n')
f.write("}\n") f.write("}\n")
f.write("end\n") f.write("end\n")

View File

@ -1,5 +1,5 @@
name: tartrazine name: tartrazine
version: 0.6.1 version: 0.6.0
authors: authors:
- Roberto Alsina <roberto.alsina@gmail.com> - Roberto Alsina <roberto.alsina@gmail.com>

View File

@ -731,8 +731,8 @@ module Tartrazine
"*.applescript" => ["applescript"], "*.applescript" => ["applescript"],
"*.aql" => ["arangodb_aql"], "*.aql" => ["arangodb_aql"],
"*.arexx" => ["rexx"], "*.arexx" => ["rexx"],
"*.as" => ["actionscript", "actionscript_3"], "*.as" => ["actionscript_3", "actionscript"],
"*.asm" => ["nasm", "tasm", "z80_assembly"], "*.asm" => ["nasm", "z80_assembly", "tasm"],
"*.au3" => ["autoit"], "*.au3" => ["autoit"],
"*.automount" => ["systemd"], "*.automount" => ["systemd"],
"*.aux" => ["tex"], "*.aux" => ["tex"],
@ -740,7 +740,7 @@ module Tartrazine
"*.awk" => ["awk"], "*.awk" => ["awk"],
"*.b" => ["brainfuck"], "*.b" => ["brainfuck"],
"*.bal" => ["ballerina"], "*.bal" => ["ballerina"],
"*.bas" => ["qbasic", "vb_net"], "*.bas" => ["vb_net", "qbasic"],
"*.bash" => ["bash"], "*.bash" => ["bash"],
"*.bat" => ["batchfile"], "*.bat" => ["batchfile"],
"*.batch" => ["psl"], "*.batch" => ["psl"],
@ -850,7 +850,7 @@ module Tartrazine
"*.graphql" => ["graphql"], "*.graphql" => ["graphql"],
"*.graphqls" => ["graphql"], "*.graphqls" => ["graphql"],
"*.groovy" => ["groovy"], "*.groovy" => ["groovy"],
"*.h" => ["c", "c++", "objective-c"], "*.h" => ["objective-c", "c", "c++"],
"*.h++" => ["c++"], "*.h++" => ["c++"],
"*.ha" => ["hare"], "*.ha" => ["hare"],
"*.handlebars" => ["handlebars"], "*.handlebars" => ["handlebars"],
@ -873,7 +873,7 @@ module Tartrazine
"*.idc" => ["c"], "*.idc" => ["c"],
"*.idr" => ["idris"], "*.idr" => ["idris"],
"*.ijs" => ["j"], "*.ijs" => ["j"],
"*.inc" => ["objectpascal", "php", "povray", "sourcepawn"], "*.inc" => ["php", "objectpascal", "povray", "sourcepawn"],
"*.inf" => ["ini"], "*.inf" => ["ini"],
"*.ini" => ["ini"], "*.ini" => ["ini"],
"*.ino" => ["arduino"], "*.ino" => ["arduino"],
@ -899,7 +899,7 @@ module Tartrazine
"*.lpk" => ["objectpascal"], "*.lpk" => ["objectpascal"],
"*.lpr" => ["objectpascal"], "*.lpr" => ["objectpascal"],
"*.lua" => ["lua"], "*.lua" => ["lua"],
"*.m" => ["mason", "mathematica", "matlab", "objective-c", "octave"], "*.m" => ["mathematica", "mason", "octave", "objective-c", "matlab"],
"*.ma" => ["mathematica"], "*.ma" => ["mathematica"],
"*.mak" => ["makefile"], "*.mak" => ["makefile"],
"*.man" => ["groff"], "*.man" => ["groff"],
@ -954,7 +954,7 @@ module Tartrazine
"*.php" => ["php"], "*.php" => ["php"],
"*.php[345]" => ["php"], "*.php[345]" => ["php"],
"*.pig" => ["pig"], "*.pig" => ["pig"],
"*.pl" => ["perl", "prolog"], "*.pl" => ["prolog", "perl"],
"*.plc" => ["plutus_core"], "*.plc" => ["plutus_core"],
"*.plot" => ["gnuplot"], "*.plot" => ["gnuplot"],
"*.plt" => ["gnuplot"], "*.plt" => ["gnuplot"],
@ -962,7 +962,7 @@ module Tartrazine
"*.pml" => ["promela"], "*.pml" => ["promela"],
"*.pony" => ["pony"], "*.pony" => ["pony"],
"*.pov" => ["povray"], "*.pov" => ["povray"],
"*.pp" => ["objectpascal", "puppet"], "*.pp" => ["puppet", "objectpascal"],
"*.pq" => ["powerquery"], "*.pq" => ["powerquery"],
"*.pr" => ["promela"], "*.pr" => ["promela"],
"*.prm" => ["promela"], "*.prm" => ["promela"],
@ -1011,7 +1011,7 @@ module Tartrazine
"*.rst" => ["rst"], "*.rst" => ["rst"],
"*.rvt" => ["tcl"], "*.rvt" => ["tcl"],
"*.rx" => ["rexx"], "*.rx" => ["rexx"],
"*.s" => ["armasm", "gas", "r"], "*.s" => ["armasm", "r", "gas"],
"*.sage" => ["python"], "*.sage" => ["python"],
"*.sas" => ["sas"], "*.sas" => ["sas"],
"*.sass" => ["sass"], "*.sass" => ["sass"],
@ -1024,7 +1024,7 @@ module Tartrazine
"*.scope" => ["systemd"], "*.scope" => ["systemd"],
"*.scss" => ["scss"], "*.scss" => ["scss"],
"*.sed" => ["sed"], "*.sed" => ["sed"],
"*.service" => ["ini", "systemd"], "*.service" => ["systemd", "ini"],
"*.sh" => ["bash"], "*.sh" => ["bash"],
"*.sh-session" => ["bash_session"], "*.sh-session" => ["bash_session"],
"*.sieve" => ["sieve"], "*.sieve" => ["sieve"],
@ -1034,13 +1034,13 @@ module Tartrazine
"*.smali" => ["smali"], "*.smali" => ["smali"],
"*.sml" => ["standard_ml"], "*.sml" => ["standard_ml"],
"*.snobol" => ["snobol"], "*.snobol" => ["snobol"],
"*.socket" => ["ini", "systemd"], "*.socket" => ["systemd", "ini"],
"*.sol" => ["solidity"], "*.sol" => ["solidity"],
"*.sp" => ["sourcepawn"], "*.sp" => ["sourcepawn"],
"*.sparql" => ["sparql"], "*.sparql" => ["sparql"],
"*.spec" => ["rpm_spec"], "*.spec" => ["rpm_spec"],
"*.spt" => ["cheetah"], "*.spt" => ["cheetah"],
"*.sql" => ["mysql", "sql"], "*.sql" => ["sql", "mysql"],
"*.ss" => ["scheme"], "*.ss" => ["scheme"],
"*.st" => ["smalltalk"], "*.st" => ["smalltalk"],
"*.stas" => ["stas"], "*.stas" => ["stas"],
@ -1069,7 +1069,7 @@ module Tartrazine
"*.tpl" => ["smarty"], "*.tpl" => ["smarty"],
"*.tpp" => ["c++"], "*.tpp" => ["c++"],
"*.trig" => ["psl"], "*.trig" => ["psl"],
"*.ts" => ["typescript", "typoscript"], "*.ts" => ["typoscript", "typescript"],
"*.tst" => ["scilab"], "*.tst" => ["scilab"],
"*.tsx" => ["typescript"], "*.tsx" => ["typescript"],
"*.ttl" => ["turtle"], "*.ttl" => ["turtle"],
@ -1079,7 +1079,7 @@ module Tartrazine
"*.twig" => ["twig"], "*.twig" => ["twig"],
"*.txt" => ["plaintext"], "*.txt" => ["plaintext"],
"*.uc" => ["ucode"], "*.uc" => ["ucode"],
"*.v" => ["coq", "v", "verilog"], "*.v" => ["verilog", "v", "coq"],
"*.vala" => ["vala"], "*.vala" => ["vala"],
"*.vapi" => ["vala"], "*.vapi" => ["vala"],
"*.vb" => ["vb_net"], "*.vb" => ["vb_net"],