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

Support for the eC language #1

Closed ecere closed 13 years ago

ecere commented 13 years ago

Please add support for the eC language (.ec, .eh files) eC is an object oriented language with C compatibility. It reuses the C parser like the C++ parser. More info about eC at www.ecere.com.

Thanks.

Jerome

robinluckey commented 13 years ago

Hi ecere,

Sorry for the late response... it has been a while since I have looked into ohcount maintenance.

Thanks for providing this patch. It looks good, and I am planning to pull it. It might be another few weeks before there is any activity, but I wanted to let you know now that I have your patch, and things are moving (if slowly).

Thanks, Robin

robinluckey commented 13 years ago

I'm trying to merge this code into the ohcount master, but I'm having a problem -- it doesn't seem to work, and I'm at a bit of a loss to explain why.

I can correctly detect eC files:

$ bin/ohcount -d test/detect_files/foo.ec
ec  test/detect_files/foo.ec

However, when I actually try to count the lines, it always comes up empty:

$ bin/ohcount test/detect_files/foo.ec
Examining 1 file(s)

                          Ohloh Line Count Summary                          

Language          Files       Code    Comment  Comment %      Blank      Total
----------------  -----  ---------  ---------  ---------  ---------  ---------
----------------  -----  ---------  ---------  ---------  ---------  ---------
Total                 0          0          0       0.0%          0          0

This may be a silly question, but have you been able to actually count eC code with this patch? Is there maybe something missing from this patch?

ecere commented 13 years ago

Hi, I must admit I did not. If I recall correctly, I tried hard to set up the environment to be able to do so, but I failed there. I think I was trying to set it up for Windows/MinGW and I was running into a roadblock.

I don't think there was much more to my patch than recognizing the .ec and .eh extension however, so your intuition as to why it's failing is probably better than mine? eC supports both C and C++ style comments, it's an OO superset of C.

Thanks a lot for trying to integrate this patch! Please let me know if you have any idea what's going on or if there is something I can do to help out.

Best regards,

Jerome

robinluckey commented 13 years ago

Hi Jerome,

I was able to get this working. There was a simple omission: that the new parse_ec() method was not registered in Ohcount's list of parsers.

I added a simple unit test to make sure that the parser works properly, and I've merged the result into our production master. It should be live on Ohloh's web site in about a week.

Thanks for the patch, Robin