mirror of
https://github.com/kucherenko/jscpd.git
synced 2026-09-19 08:11:03 +08:00
06481d3cb7
- FinderError was never constructed; run() cannot fail, so its error type is Infallible and the documented run(&config).unwrap() keeps compiling. - tokenize_sfc_block_inner and tokenize_to_detection_inner forwarded to tokenize_format_to_detection; call it directly. - extract_line_number was Some(error.line()). - Timer wrapped Instant; use Instant.
cpd-tokenizer
Source code tokenizers for cpd — a fast copy/paste detector for code.
This crate provides language-aware tokenization for 200+ programming languages, producing token streams suitable for duplicate detection. It includes:
- Generic tokenizer (comments, strings, keywords, punctuation)
- JavaScript/TypeScript/JSX/TSX tokenizer (Oxc-based)
- Markdown tokenizer (code fences, front matter, embedded languages)
- SFC tokenizer (Vue, Svelte, Astro)
- Embedded language detection and cross-format tokenization
This crate is not intended to be used directly; see the jscpd crate for the full CLI.
License
MIT