diff --git a/spec/languages.coffee b/spec/languages.coffee index 568529e..df7459f 100644 --- a/spec/languages.coffee +++ b/spec/languages.coffee @@ -83,10 +83,10 @@ module.exports = ''' """ comment: 10 - source: 1 + source: 2 block: 6 total: 11 - single: 3 + single: 4 mixed: 2 empty: 1 } diff --git a/src/sloc.coffee b/src/sloc.coffee index b1283c9..e01d5d2 100644 --- a/src/sloc.coffee +++ b/src/sloc.coffee @@ -29,18 +29,19 @@ getCommentExpressions = (lang) -> when "coffee", "iced" /\#[^\{]/ # hashtag not followed by opening curly brace - when "cr", "py", "ls", "mochi", "nix", "r", "rb", "jl", "pl", "yaml", "hr", "rpy" + when "cr", "py", "ls", "mochi", "nix", "r", "rb", "jl", "pl", "yaml", \ + "hr", "rpy" /\#/ 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", \ - "dart", "agda" + "dart" /\/{2}/ when "latex", "tex", "sty", "cls" start = /\%/ - when "lua", "hs", "sql" + when "lua", "hs", "agda", "sql" /--/ when "erl" /\%/ @@ -81,7 +82,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", "dart", "agda" + "gs", "groovy", "nut", "kt", "kts", "tsx", "sql", "dart" start = /\/\*+/ stop = /\*\/{1}/ @@ -92,7 +93,7 @@ getCommentExpressions = (lang) -> start = /\{\{\!/ stop = /\}\}/ - when "hs" + when "hs", "agda" start = /\{-/ stop = /-\}/