← All repos

comby

A code rewrite tool for structural search and replace that supports ~every language.

cgojavajavascriptlintingparser-combinatorsparsingphpprogram-transformationpythonreasonrefactoringregexrewritingrustsearch-and-replaceswiftsyntaxsyntax-transformationtypescript
Browse cluster: OCaml Systems and Utilities
517commits
15contributors
8languages

Tech stack & purpose

Comby is a code rewrite tool for structural search and replace that supports approximately every programming language. It uses OCaml as its implementation language and includes vendored dependencies like CamlZip for compression handling and Patdiff for colored diff output. The tool addresses the limitations of regex-based approaches like sed by enabling pattern matching that understands language syntax, allowing users to match and rewrite nested expressions, comments, and strings across languages including C, Go, Java, JavaScript, PHP, Python, Reason, Rust, Swift, and TypeScript. Comby is distributed under the Apache 2.0 license and can be installed via package managers like Homebrew or built from source using OCaml's opam package manager.

Community & reference links

Languages

OCaml
84.3%
Shell
11.6%
C
1.7%
Standard ML
1.4%
Dockerfile
0.8%
Makefile
0.1%
Go
0.0%
Dune
0.0%

Contributors