blackducksw/ohcount — pull request #30 by chris-morgan (2013-11-15 12:37:04+00:00)
Title: Add support for Rust

This is an update of #26, fixing it up so that the Rust filetype works. (I am uncertain of the state of the tests—they're failing in a completely different place¹, but it's working fine in real life usage.)

There was mention in #26 of other things using the `.rs` file format. I am not aware of any such things, but if they are, I need information to assess whether putting detection in is a good idea or not (my initial assumption is that it is not worthwhile, but I'll see).

There are a couple of notable things not supported by this at present:

- nested block comments (this will actually cause miscounting if nested comments are used, but I haven't come across them being used yet);
- raw string literals (`r(#*)".*"\1`, e.g. `r"..."`, `r#"..."#`, `r##"..."##`, etc.)

Still, having basic Rust support is far better than not having it.
----

¹ The tests are first failing in test/unit/detector_test.h:119, `ASSERT_DETECT(LANG_PHP, "upper_case_php")`: "assertion \`lang' failed". It's also failing to build the Ruby bindings; I have SWIG 2.0.10, if it matters. Where am I *supposed* to file bugs? Why isn't ohcount being maintained properly? :-(