add hex ihex rst

This commit is contained in:
Aaron Power 2016-08-30 17:54:45 +01:00
parent 88bc1935c8
commit e2b7328275
4 changed files with 79 additions and 75 deletions

88
Cargo.lock generated
View file

@ -2,14 +2,14 @@
name = "tokei" name = "tokei"
version = "4.2.0" version = "4.2.0"
dependencies = [ dependencies = [
"clap 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"maplit 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "maplit 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_cbor 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde_cbor 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_codegen 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde_codegen 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_yaml 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -23,10 +23,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "aster" name = "aster"
version = "0.24.0" version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"syntex_syntax 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_syntax 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -46,14 +46,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "clap" name = "clap"
version = "2.10.1" version = "2.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"ansi_term 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ansi_term 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
"strsim 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"term_size 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "term_size 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-segmentation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"yaml-rust 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -121,22 +122,22 @@ dependencies = [
[[package]] [[package]]
name = "quasi" name = "quasi"
version = "0.17.0" version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"syntex_errors 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_errors 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_syntax 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_syntax 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "quasi_codegen" name = "quasi_codegen"
version = "0.17.0" version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"aster 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)", "aster 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex 0.42.2 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_errors 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_errors 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_syntax 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_syntax 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -169,7 +170,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "serde" name = "serde"
version = "0.8.3" version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
@ -183,24 +184,24 @@ dependencies = [
[[package]] [[package]]
name = "serde_codegen" name = "serde_codegen"
version = "0.8.3" version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"aster 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)", "aster 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
"quasi 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "quasi 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
"quasi_codegen 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "quasi_codegen 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_codegen_internals 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_codegen_internals 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex 0.42.2 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_syntax 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_syntax 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "serde_codegen_internals" name = "serde_codegen_internals"
version = "0.6.1" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"syntex_errors 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_errors 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_syntax 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_syntax 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -211,7 +212,7 @@ dependencies = [
"dtoa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "dtoa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -219,40 +220,40 @@ name = "serde_yaml"
version = "0.4.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"serde 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
"yaml-rust 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "strsim" name = "strsim"
version = "0.4.1" version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "syntex" name = "syntex"
version = "0.41.0" version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"syntex_errors 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_errors 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_syntax 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_syntax 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "syntex_errors" name = "syntex_errors"
version = "0.41.0" version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_pos 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_pos 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "syntex_pos" name = "syntex_pos"
version = "0.41.0" version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -260,15 +261,15 @@ dependencies = [
[[package]] [[package]]
name = "syntex_syntax" name = "syntex_syntax"
version = "0.41.0" version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_errors 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_errors 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_pos 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_pos 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -284,7 +285,7 @@ dependencies = [
[[package]] [[package]]
name = "term_size" name = "term_size"
version = "0.1.0" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
@ -295,9 +296,14 @@ name = "toml"
version = "0.2.0" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"serde 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "unicode-segmentation"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "unicode-width" name = "unicode-width"
version = "0.1.3" version = "0.1.3"

View file

@ -75,8 +75,12 @@ pub enum LanguageType {
Haskell, Haskell,
/// Html /// Html
Html, Html,
/// HEX
Hex,
/// Idris /// Idris
Idris, Idris,
/// Intel HEX
IntelHex,
/// Isabelle /// Isabelle
Isabelle, Isabelle,
/// Jai /// Jai
@ -143,6 +147,8 @@ pub enum LanguageType {
RubyHtml, RubyHtml,
/// Rust /// Rust
Rust, Rust,
/// ReStructuredText
ReStructuredText,
/// Sass /// Sass
Sass, Sass,
/// Scala /// Scala
@ -217,7 +223,9 @@ impl LanguageType {
Handlebars => "Handlebars", Handlebars => "Handlebars",
Haskell => "Haskell", Haskell => "Haskell",
Html => "HTML", Html => "HTML",
Hex => "HEX",
Idris => "Idris", Idris => "Idris",
IntelHex => "Intel HEX",
Isabelle => "Isabelle", Isabelle => "Isabelle",
Jai => "JAI", Jai => "JAI",
Java => "Java", Java => "Java",
@ -251,6 +259,7 @@ impl LanguageType {
Ruby => "Ruby", Ruby => "Ruby",
RubyHtml => "Ruby HTML", RubyHtml => "Ruby HTML",
Rust => "Rust", Rust => "Rust",
ReStructuredText => "ReStructuredText",
Sass => "Sass", Sass => "Sass",
Scala => "Scala", Scala => "Scala",
Sml => "Standard ML", Sml => "Standard ML",
@ -311,7 +320,9 @@ impl LanguageType {
"hh" | "hpp" | "hxx" => Some(CppHeader), "hh" | "hpp" | "hxx" => Some(CppHeader),
"hs" => Some(Haskell), "hs" => Some(Haskell),
"html" => Some(Html), "html" => Some(Html),
"hex" => Some(Hex),
"idr" | "lidr" => Some(Idris), "idr" | "lidr" => Some(Idris),
"ihex" => Some(IntelHex),
"in" => Some(Autoconf), "in" => Some(Autoconf),
"jai" => Some(Jai), "jai" => Some(Jai),
"java" => Some(Java), "java" => Some(Java),
@ -345,6 +356,7 @@ impl LanguageType {
"rake" | "rb" => Some(Ruby), "rake" | "rb" => Some(Ruby),
"rhtml" => Some(RubyHtml), "rhtml" => Some(RubyHtml),
"rs" => Some(Rust), "rs" => Some(Rust),
"rst" => Some(ReStructuredText),
"s" | "asm" => Some(Assembly), "s" | "asm" => Some(Assembly),
"sass" | "scss" => Some(Sass), "sass" | "scss" => Some(Sass),
"sc" | "scala" => Some(Scala), "sc" | "scala" => Some(Scala),
@ -409,6 +421,8 @@ impl<'a> From<&'a str> for LanguageType {
"Handlebars" => Handlebars, "Handlebars" => Handlebars,
"Haskell" => Haskell, "Haskell" => Haskell,
"Html" => Html, "Html" => Html,
"HEX" => Hex,
"Intel HEX" => IntelHex,
"Idris" => Idris, "Idris" => Idris,
"Jai" => Jai, "Jai" => Jai,
"Java" => Java, "Java" => Java,
@ -442,6 +456,7 @@ impl<'a> From<&'a str> for LanguageType {
"Ruby" => Ruby, "Ruby" => Ruby,
"RubyHtml" => RubyHtml, "RubyHtml" => RubyHtml,
"Rust" => Rust, "Rust" => Rust,
"ReStructuredText" => ReStructuredText,
"Sass" => Sass, "Sass" => Sass,
"Scala" => Scala, "Scala" => Scala,
"Sml" => Sml, "Sml" => Sml,

View file

@ -44,12 +44,13 @@ fn count_files(language_tuple: &mut (&LanguageType, &mut Language)) {
let files: Vec<_> = language.files.drain(..).collect(); let files: Vec<_> = language.files.drain(..).collect();
let mut contents = String::new(); let mut contents = String::new();
let mut stack = vec![]; let mut stack = vec![];
let mut quote = None; let mut quote;
for file in files { for file in files {
let mut stats = Stats::new(opt_or_cont!(file.to_str())); let mut stats = Stats::new(opt_or_cont!(file.to_str()));
stack.clear(); stack.clear();
contents.clear(); contents.clear();
quote = None;
rs_or_cont!(rs_or_cont!(File::open(file)).read_to_string(&mut contents)); rs_or_cont!(rs_or_cont!(File::open(file)).read_to_string(&mut contents));
@ -57,19 +58,21 @@ fn count_files(language_tuple: &mut (&LanguageType, &mut Language)) {
if language.is_blank() { if language.is_blank() {
stats.code += lines.count(); stats.code += lines.count();
**language += stats;
continue; continue;
} }
'line: for line in lines { 'line: for line in lines {
stats.lines += 1; stats.lines += 1;
let no_stack = stack.is_empty();
// FORTRAN has a rule where it only counts as a comment if it's the first // FORTRAN has a rule where it only counts as a comment if it's the first
// character in the column, so removing starting whitespace could cause a // character in the column, so removing starting whitespace could cause a
// miscount. // miscount.
let line = if is_fortran { let line = if is_fortran {
line line
} else { } else {
line.trim() line.trim_left()
}; };
if line.trim().is_empty() { if line.trim().is_empty() {
@ -84,30 +87,14 @@ fn count_files(language_tuple: &mut (&LanguageType, &mut Language)) {
} }
} }
let mut started_with = false;
if quote.is_none() {
let chain = language.multi_line.iter().chain(language.nested_comments.iter());
for &(start, _) in chain {
if line.starts_with(start) {
started_with = true;
}
}
}
multi_line::handle_multi_line(line, &language, &mut stack, &mut quote); multi_line::handle_multi_line(line, &language, &mut stack, &mut quote);
if !stack.is_empty() { if no_stack {
if started_with { stats.comments += 1;
stats.code += 1;
} else {
stats.comments += 1;
}
} else { } else {
stats.code += 1; stats.code += 1;
} }
} }
**language += stats; **language += stats;
} }
} }
@ -300,7 +287,9 @@ impl Languages {
Haskell => Language::new_single(vec!["--"]), Haskell => Language::new_single(vec!["--"]),
Html => Language::new_html() Html => Language::new_html()
.set_quotes(vec![("\"", "\""), ("'", "'")]), .set_quotes(vec![("\"", "\""), ("'", "'")]),
Hex => Language::new_blank(),
Idris => Language::new(vec!["--"], vec![("{-", "-}")]), Idris => Language::new(vec!["--"], vec![("{-", "-}")]),
IntelHex => Language::new_blank(),
Isabelle => Language::new( Isabelle => Language::new(
vec!["--"], vec!["--"],
vec![ ("{*","*}"), vec![ ("{*","*}"),
@ -343,6 +332,7 @@ impl Languages {
Ruby => Language::new(vec!["#"], vec![("=begin", "=end")]), Ruby => Language::new(vec!["#"], vec![("=begin", "=end")]),
RubyHtml => Language::new_html(), RubyHtml => Language::new_html(),
Rust => Language::new_c().nested(), Rust => Language::new_c().nested(),
ReStructuredText => Language::new_blank(),
Sass => Language::new_c(), Sass => Language::new_c(),
Scala => Language::new_c(), Scala => Language::new_c(),
Sml => Language::new_func(), Sml => Language::new_func(),

View file

@ -6,7 +6,6 @@ pub fn handle_multi_line(line: &str,
stack: &mut Vec<&'static str>, stack: &mut Vec<&'static str>,
quote: &mut Option<&'static str>) { quote: &mut Option<&'static str>) {
let mut chars = line.chars(); let mut chars = line.chars();
let mut cont = false;
let nested_is_empty = language.nested_comments.is_empty(); let nested_is_empty = language.nested_comments.is_empty();
'window: loop { 'window: loop {
@ -16,17 +15,11 @@ pub fn handle_multi_line(line: &str,
} }
chars.next(); chars.next();
// Prevents counting overlaps like /*/*
if cont {
cont = false;
continue;
}
let mut end = false; let mut end = false;
if let &mut Some(quote_str) = quote { if let &mut Some(quote_str) = quote {
if window.starts_with("\\") { if window.starts_with("\\") {
cont = true; chars.next();
continue; continue;
} else if window.starts_with(quote_str) { } else if window.starts_with(quote_str) {
end = true; end = true;
@ -38,7 +31,7 @@ pub fn handle_multi_line(line: &str,
*quote = None; *quote = None;
if quote_str.chars().count() == 1 { if quote_str.chars().count() == 1 {
cont = true chars.next();
} }
continue; continue;
} }
@ -57,7 +50,7 @@ pub fn handle_multi_line(line: &str,
if pop { if pop {
stack.pop(); stack.pop();
cont = true; chars.next();
continue; continue;
} }
@ -66,7 +59,7 @@ pub fn handle_multi_line(line: &str,
for &(start, end) in &language.quotes { for &(start, end) in &language.quotes {
if window.starts_with(start) { if window.starts_with(start) {
*quote = Some(end); *quote = Some(end);
cont = true; chars.next();
continue 'window; continue 'window;
} }
} }
@ -82,7 +75,7 @@ pub fn handle_multi_line(line: &str,
for &(start, end) in &language.nested_comments { for &(start, end) in &language.nested_comments {
if window.starts_with(start) { if window.starts_with(start) {
stack.push(end); stack.push(end);
cont = true; chars.next();
continue 'window; continue 'window;
} }
} }
@ -94,7 +87,7 @@ pub fn handle_multi_line(line: &str,
} else if stack.len() == 0 { } else if stack.len() == 0 {
stack.push(end); stack.push(end);
} }
cont = true; chars.next();
continue 'window; continue 'window;
} }
} }