-
Notifications
You must be signed in to change notification settings - Fork 1
/
languages.rs
81 lines (78 loc) · 2.34 KB
/
languages.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use crate::Language;
macro_rules! l {
($ext:literal, $name:literal, $id:literal) => {
($ext, Language($name, $id))
};
}
// The array is sorted by the extension name
pub(crate) const LANGUAGES: [(&str, Language); 58] = [
l!("bat", "Batch", "batch"),
l!("c", "C", "c"),
l!("cc", "C++", "cpp"),
l!("cl", "Common Lisp", "common-lisp"),
l!("clj", "Clojure", "clojure"),
l!("comp", "GLSL", "glsl"),
l!("cpp", "C++", "cpp"),
l!("cs", "C#", "csharp"),
l!("css", "CSS", "css"),
l!("cxx", "C++", "cpp"),
l!("dart", "Dart", "dart"),
l!("frag", "GLSL", "glsl"),
l!("geom", "GLSL", "glsl"),
l!("glsl", "GLSL", "glsl"),
l!("go", "Go", "go"),
l!("h", "C", "c"),
l!("haml", "Haml", "haml"),
l!("handlebars", "Handlebars", "handlebars"),
l!("hbs", "Handlebars", "handlebars"),
l!("hlsl", "HLSL", "HLSL"),
l!("hpp", "C++", "cpp"),
l!("html", "HTML", "html"),
l!("hxx", "C++", "cpp"),
l!("ini", "INI", "ini"),
l!("java", "Java", "java"),
l!("jinja", "Jinja", "jinja"),
l!("jinja2", "Jinja", "jinja"),
l!("js", "JavaScript", "javascript"),
l!("json", "JSON", "json"),
l!("jsonc", "JSON with Comments", "jsonc"),
l!("kt", "Kotlin", "kotlin"),
l!("less", "Less", "less"),
l!("lua", "Lua", "lua"),
l!("md", "Markdown", "markdown"),
l!("pl", "Perl", "perl"),
l!("py", "Python", "python"),
l!("pyc", "Python", "python"),
l!("pyo", "Python", "python"),
l!("rb", "Ruby", "ruby"),
l!("rkt", "Racket", "racket"),
l!("rs", "Rust", "rust"),
l!("sass", "SASS", "sass"),
l!("sc", "Scala", "scala"),
l!("scala", "Scala", "scala"),
l!("scss", "SCSS", "scss"),
l!("sh", "Shell", "shell"),
l!("sql", "SQL", "sql"),
l!("swift", "Swift", "swift"),
l!("tesc", "GLSL", "glsl"),
l!("tese", "GLSL", "glsl"),
l!("tex", "TeX", "tex"),
l!("toml", "TOML", "toml"),
l!("ts", "TypeScript", "typescript"),
l!("vert", "GLSL", "glsl"),
l!("xhtml", "XHTML", "xhtml"),
l!("xml", "XML", "xml"),
l!("yaml", "YAML", "yaml"),
l!("yml", "YAML", "yaml"),
];
#[test]
fn check_order() {
for (a, b) in LANGUAGES.iter().zip(LANGUAGES.iter().skip(1)) {
assert!(
a.0 < b.0,
"Languages out of order - {:?} should come after {:?}",
a,
b,
);
}
}