From fdec614b5f0711e1a660add4426e553e199e2dff Mon Sep 17 00:00:00 2001 From: George Lesica Date: Tue, 18 Dec 2018 15:20:27 -0700 Subject: [PATCH] Add Dart support (#112) --- README.md | 1 + spec/languages.coffee | 2 +- src/sloc.coffee | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7012e1a..f3f406c 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,7 @@ var stats = window.sloc(sourceCode,"javascript"); - CoffeeScript / IcedCoffeeScript - Crystal - CSS / SCSS / SASS / LESS / Stylus +- Dart - Erlang - F# - Fortran diff --git a/spec/languages.coffee b/spec/languages.coffee index b130fec..38425a9 100644 --- a/spec/languages.coffee +++ b/spec/languages.coffee @@ -22,7 +22,7 @@ module.exports = empty: 1 } { - names: ["js", "jsx", "ts", "gs", "tsx"] + names: ["js", "jsx", "ts", "gs", "tsx", "dart"] code: """ /* a */ diff --git a/src/sloc.coffee b/src/sloc.coffee index c51a190..c086d8a 100644 --- a/src/sloc.coffee +++ b/src/sloc.coffee @@ -34,7 +34,8 @@ getCommentExpressions = (lang) -> when "js", "jsx", "mjs", "c", "cc", "cpp", "cs", "cxx", "h", "m", "mm", \ "hpp", "hx", "hxx", "ino", "java", "php", "php5", "go", "groovy", \ "scss", "less", "rs", "sass", "styl", "scala", "swift", "ts", \ - "jade", "gs", "nut", "kt", "kts", "tsx", "fs", "fsi", "fsx", "bsl" + "jade", "gs", "nut", "kt", "kts", "tsx", "fs", "fsi", "fsx", "bsl", \ + "dart" /\/{2}/ when "latex", "tex", "sty", "cls" @@ -80,7 +81,7 @@ getCommentExpressions = (lang) -> when "js", "jsx", "mjs", "c", "cc", "cpp", "cs", "cxx", "h", "m", "mm", \ "hpp", "hx", "hxx", "ino", "java", "ls", "nix", "php", "php5", \ "go", "css", "sass", "scss", "less", "rs", "styl", "scala", "ts", \ - "gs", "groovy", "nut", "kt", "kts", "tsx", "sql" + "gs", "groovy", "nut", "kt", "kts", "tsx", "sql", "dart" start = /\/\*+/ stop = /\*\/{1}/ @@ -274,6 +275,7 @@ extensions = [ "cs" "css" "cxx" + "dart" "erl" "f90" "f95"