sebastianbergmann / phpcpd

Copy/Paste Detector (CPD) for PHP code.
BSD 3-Clause "New" or "Revised" License
2.21k stars 190 forks source link

Hacklang CPD? #118

Closed skyzyx closed 8 years ago

skyzyx commented 9 years ago

Is there an interest in, or work underway to, implement support for Hack in addition to PHP?

sebastianbergmann commented 9 years ago

No.

aboks commented 9 years ago

Actually, Hacklang is already supported out-of-the-box when running PHPCPD on HHVM. PHPCPD uses token_get_all for tokenizing the source files, which can also tokenize Hacklang in its implementation on HHVM. Maybe it misses just a bit of intelligence (fuzzing) for Hacklang-specific tokens, but the basics should work just fine.

For doing Hacklang-CPD on PHP, #83 may be a (small) step in that direction. However, it would still require finding or implementing a Hacklang-tokenizer in plain PHP.