flosse / sloc

simple tool to count SLOC (source lines of code)
MIT License
943 stars 84 forks source link

Capitalized R detection #106

Open ThomDietrich opened 5 years ago

ThomDietrich commented 5 years ago

Seems like a simple bug:

$ sloc ./*.R
C:\Users\Birke\AppData\Roaming\npm\node_modules\sloc\lib\sloc.js:195
          throw new TypeError("File extension '" + lang + "' is not supported");
          ^

TypeError: File extension 'R' is not supported
    at getCommentExpressions (C:\Users\Birke\AppData\Roaming\npm\node_modules\sloc\lib\sloc.js:195:17)
    at slocModule (C:\Users\Birke\AppData\Roaming\npm\node_modules\sloc\lib\sloc.js:376:31)
    at C:\Users\Birke\AppData\Roaming\npm\node_modules\sloc\lib\cli.js:84:19
    at tryToString (fs.js:456:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)

$ sloc ./*.R -a R=r

---------- Result ------------
...
flosse commented 5 years ago

Tanks for reporting this error. Feel free to fix it, because #99