blackducksoftware / ohcount

The Ohloh source code line counter
https://github.com/blackducksoftware/ohcount
GNU General Public License v2.0
261 stars 69 forks source link

Add support for new language Mathematica #23

Closed eschnett closed 7 years ago

eschnett commented 11 years ago

I implemented support for detecting Mathematica as new language. I added a test case as well.

amujumdar commented 11 years ago

@eschnett You know of any projects on Ohloh that have this language?

eschnett commented 11 years ago

Yes, e.g. Kranc or "Einstein Toolkit" use Mathematica. Currently, this language is misdiagnosed as Objective C.

ianhinder commented 11 years ago

Additionally SimulationTools for Mathematica (https://www.ohloh.net/p/simulationtools/analyses/latest/languages_summary) which is also misdiagnosed as Objective C, presumably because the standard file extension is ".m". It would be good if this could be pulled.

ianhinder commented 9 years ago

Is further work needed for this to be merged? The respective projects still show up incorrectly on OpenHub as being in Objective C rather than in Mathematica.

eschnett commented 9 years ago

I'm not aware of further work being necessary. I didn't receive any feedback on the implementation. It may be necessary to rebase the implementation, now after two years of silence.

notalex commented 7 years ago

@eschnett, sorry for the late response. I can help get this merged. This PR needs a little more work with tests. In addition to the file test/expected_dir/mathematica1.m, one needs to add another file at test/src_dir/mathematica1.m which reflects the expected_dir file minus the mathematica ... prefixes. This will enable the test/unit/parser.h test to compare the mathematica parser results.

notalex commented 7 years ago

I have tried adding the test/src_dir/mathematica1.m file and found that the tests fail on file detection. The mathematica files are being detected as objective_c. This is due to a flaw in existing master code. This new PR fixes the problem. After making this change, I found that the tests fail on mathematica comment lines being incorrectly counted as code.