better heuristic distinction of .d files (#3145)

* fix benchmark

- require json for Hash.to_json

* better heuristic distinction of .d files

- properly recongnize dtrace probes
- recongnize \ in Makefile paths
- recongnize single line `file.ext : dep.ext` make targets
- recognize D module, import, function, and unittest declarations
- add more representative D samples

D changed from 31.2% to 28.1%
DTrace changed from 33.5% to 32.5%
Makefile changed from 35.3% to 39.4%

See
https://gist.github.com/MartinNowak/fda24fdef64f2dbb05c5a5ceabf22bd3
for the scraper used to get a test corpus.
This commit is contained in:
Martin Nowak
2017-03-30 19:25:53 +02:00
committed by Colin Seymour
parent b7e27a9f58
commit fa6ae1116f
10 changed files with 663 additions and 3 deletions

3
samples/D/unittest2.d Normal file
View File

@@ -0,0 +1,3 @@
unittest("optional name")
{
}