When I used sloccount 2.26 on a Haskell project I got the following errors:
[...]
Computing results.
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^\begin{ <-- HERE code}/ at /usr/bin/haskell_count line 73.
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^\begin{ <-- HERE code}/ at /usr/bin/haskell_count line 73.
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^\begin{ <-- HERE code}/ at /usr/bin/haskell_count line 73.
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^\begin{ <-- HERE code}/ at /usr/bin/haskell_count line 73.
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^\begin{ <-- HERE code}/ at /usr/bin/haskell_count line 73.
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^\begin{ <-- HERE code}/ at /usr/bin/haskell_count line 73.
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^\begin{ <-- HERE code}/ at /usr/bin/haskell_count line 73.
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^\begin{ <-- HERE code}/ at /usr/bin/haskell_count line 73.
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^\begin{ <-- HERE code}/ at /usr/bin/haskell_count line 73.
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^\begin{ <-- HERE code}/ at /usr/bin/haskell_count line 73.
SLOC Directory SLOC-by-Language (Sorted)
Argument "" isn't numeric in addition (+) at /usr/bin/get_sloc line 298, <datafile> line 1.
Argument "" isn't numeric in addition (+) at /usr/bin/get_sloc line 298, <datafile> line 1.
Argument "" isn't numeric in addition (+) at /usr/bin/get_sloc line 298, <datafile> line 1.
Argument "" isn't numeric in addition (+) at /usr/bin/get_sloc line 298, <datafile> line 1.
Argument "" isn't numeric in addition (+) at /usr/bin/get_sloc line 298, <datafile> line 1.
Argument "" isn't numeric in addition (+) at /usr/bin/get_sloc line 298, <datafile> line 1.
Argument "" isn't numeric in addition (+) at /usr/bin/get_sloc line 298, <datafile> line 1.
Argument "" isn't numeric in addition (+) at /usr/bin/get_sloc line 298, <datafile> line 1.
Argument "" isn't numeric in addition (+) at /usr/bin/get_sloc line 298, <datafile> line 1.
Argument "" isn't numeric in addition (+) at /usr/bin/get_sloc line 298, <datafile> line 1.
0 demo (none)
0 demo-files (none)
0 dfd-demo (none)
0 dist (none)
0 gsn (none)
0 PathFind (none)
0 src_Data (none)
0 src_Hades (none)
0 src_Model (none)
0 test (none)
0 top_dir (none)
SLOC total is zero, no further analysis performed.</datafile></datafile></datafile></datafile></datafile></datafile></datafile></datafile></datafile></datafile>
The fix seems to be to replace "{code}" with "\{code\}" throughout. However I'm not using Literate Haskell so I can't say that this works properly.
Edit: that is, put a backslash before each open and close curly bracket.
Last edit: Paul Johnson 2018-01-27