Permalink
Browse files

Refactored counting code, added Unreal related languages

  • Loading branch information...
Aaronepower committed Oct 15, 2018
1 parent 21f6fc0 commit d4998ecee3ebe2084ddfe81d7573950eac48ddec
Showing with 313 additions and 155 deletions.
  1. +108 −22 languages.json
  2. +0 −14 src/language/language_type.hbs.rs
  3. +53 −114 src/language/language_type.rs
  4. +1 −1 src/language/languages.rs
  5. +1 −0 src/language/mod.rs
  6. +146 −0 src/language/syntax.rs
  7. +2 −2 src/main.rs
  8. +2 −2 src/utils/fs.rs
@@ -98,6 +98,12 @@
"ahk"
]
},
"Automake":{
"base":"hash",
"extensions":[
"am"
]
},
"Sh":{
"name":"Shell",
"base":"hash",
@@ -301,7 +307,7 @@
},
"ColdFusion":{
"multi_line":[
["<!---", "--->"]
["<!---", "--->"]
],
"quotes":[
["\\\"", "\\\""],
@@ -358,18 +364,6 @@
"cr"
]
},
"VisualBasic":{
"name":"Visual Basic",
"quotes":[
["\\\"", "\\\""]
],
"line_comment":[
"'"
],
"extensions":[
"vb"
]
},
"CSharp":{
"name":"C#",
"base":"c",
@@ -460,6 +454,13 @@
["'", "'"]
]
},
"DotNetResource":{
"name": ".NET Resource",
"base": "html",
"extensions":[
"resx"
]
},
"Edn":{
"line_comment":[
";"
@@ -687,6 +688,13 @@
"tfvars"
]
},
"Hlsl":{
"name":"HLSL",
"base": "c",
"extensions":[
"hlsl"
]
},
"Html":{
"name":"HTML",
"base":"html",
@@ -738,6 +746,16 @@
],
"nested":true
},
"Ini":{
"name":"INI",
"line_comment": [
";",
"#"
],
"extensions":[
"ini"
]
},
"IntelHex":{
"name":"Intel HEX",
"blank": true,
@@ -844,7 +862,7 @@
],
"extensions":[
"kak"
]
]
},
"Kotlin":{
"base":"c",
@@ -1003,7 +1021,7 @@
},
"Mustache":{
"multi_line":[
["{{!", "}}"]
["{{!", "}}"]
],
"quotes":[
["\\\"", "\\\""],
@@ -1302,9 +1320,9 @@
"rs"
],
"quotes": [
["\\\"", "\\\""],
["r#\\\"", "\\\"#"],
["#\\\"", "\\\"#"]
["\\\"", "\\\""],
["r#\\\"", "\\\"#"],
["#\\\"", "\\\"#"]
]
},
"ReStructuredText":{
@@ -1371,7 +1389,7 @@
"//"
],
"multi_line":[
["'>", "<'"]
["'>", "<'"]
],
"extensions":[
"e"
@@ -1392,10 +1410,10 @@
"--"
],
"multi_line":[
["/*", "*/"]
["/*", "*/"]
],
"quotes":[
["'", "'"]
["'", "'"]
],
"extensions":[
"sql"
@@ -1499,6 +1517,20 @@
"tsx"
]
},
"UnrealPlugin":{
"name":"Unreal Plugin",
"base":"blank",
"extensions":[
"uplugin"
]
},
"UnrealProject":{
"name":"Unreal Project",
"base":"blank",
"extensions":[
"uproject"
]
},
"UnrealScript":{
"name":"Unreal Script",
"base":"c",
@@ -1508,6 +1540,20 @@
"upkg"
]
},
"UnrealShader":{
"name":"Unreal Shader",
"base":"c",
"extensions":[
"usf"
]
},
"UnrealShaderHeader":{
"name":"Unreal Shader Header",
"base":"c",
"extensions":[
"ush"
]
},
"UnrealDeveloperMarkdown":{
"name": "Unreal Markdown",
"blank": true,
@@ -1582,6 +1628,33 @@
"vhd"
]
},
"VisualBasic":{
"name":"Visual Basic",
"quotes":[
["\\\"", "\\\""]
],
"line_comment":[
"'"
],
"extensions":[
"vb"
]
},
"VisualStudioSolution":{
"name":"Visual Studio Solution",
"base":"blank",
"extensions":[
"sln"
]
},
"VisualStudioProject":{
"name":"Visual Studio Project",
"base":"html",
"extensions":[
"vcproj",
"vcxproj"
]
},
"VimScript":{
"name":"Vim Script",
"line_comment":[
@@ -1621,14 +1694,27 @@
"xaml"
]
},
"XcodeConfig":{
"name":"XCode Config",
"line_comment": [
"//"
],
"quotes":[
["\\\"", "\\\""],
["'", "'"]
],
"extensions":[
"xcconfig"
]
},
"Xml":{
"name":"XML",
"base":"html",
"extensions":[
"xml"
]
},
"XSL":{
"XSL":{
"name":"XSL",
"base":"html",
"extensions":[
@@ -2,20 +2,6 @@
// Use of this source code is governed by the APACHE2.0/MIT licence that can be
// found in the LICENCE-{APACHE/MIT} file.
use std::borrow::Cow;
use std::fmt;
use std::path::{Path, PathBuf};
use std::fs::File;
use std::io::{self, Read, BufRead, BufReader};
use std::str::FromStr;
use encoding_rs_io::DecodeReaderBytes;
use log::Level::Trace;
use utils::fs as fsutils;
use self::LanguageType::*;
use stats::Stats;
#[cfg_attr(feature = "io", derive(Deserialize, Serialize))]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum LanguageType {
Oops, something went wrong.

0 comments on commit d4998ec

Please sign in to comment.