Skip to content

Commit

Permalink
Merge pull request #97 from no23reason/features/fsharp
Browse files Browse the repository at this point in the history
Added support for F#
  • Loading branch information
flosse authored Feb 25, 2018
2 parents 47bddba + 4545469 commit 7603cc6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ var stats = window.sloc(sourceCode,"javascript");
- CSS / SCSS / SASS / LESS / Stylus
- Crystal
- Erlang
- F#
- Go
- Groovy
- HTML
Expand Down
23 changes: 23 additions & 0 deletions spec/languages.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -813,4 +813,27 @@ module.exports =
mixed: 0
empty: 0
}
{
names: ["fs", "fsi", "fsx"]
code:
"""
(* block comment *)
let square x = x * x // line comment
(* a *) square 3
(*
comment
*)
(**
another block comment
*)
"""
comment: 9
source: 2
block: 8
single: 1
total: 10
mixed: 2
empty: 1
}
]
5 changes: 3 additions & 2 deletions src/sloc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ getCommentExpressions = (lang) ->
when "js", "jsx", "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"
"nut", "kt", "kts", "tsx", "fs", "fsi", "fsx"
/\/{2}/
when "lua", "hs", "sql"
/--/
Expand Down Expand Up @@ -116,7 +116,7 @@ getCommentExpressions = (lang) ->
start = /\#\=/
stop = /\=\#/

when "ml", "mli"
when "ml", "mli", "fs", "fsi", "fsx"
start = /\(\*/
stop = /\*\)/

Expand Down Expand Up @@ -262,6 +262,7 @@ extensions = [
"css"
"cxx"
"erl"
"fs", "fsi", "fsx"
"go"
"groovy"
"gs"
Expand Down

0 comments on commit 7603cc6

Please sign in to comment.