From c580cec49406f67de5954e6b25ec178c5b81665f Mon Sep 17 00:00:00 2001 From: MgnMtn Date: Mon, 10 Aug 2026 15:07:32 +0100 Subject: [PATCH 1/2] docs: adding language --- docs/source/adding-language.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/source/adding-language.rst b/docs/source/adding-language.rst index 05f6200..63ea3c2 100644 --- a/docs/source/adding-language.rst +++ b/docs/source/adding-language.rst @@ -1,2 +1,26 @@ Adding a Programming Language ============================= + +To add compatability for a programming language in *multiplex*, you must create a language specification in ``multiplex/languages/__init__.py``. + +The language should be added to the ``_REGISTRY`` as shown below: + +.. code-block:: Python + _REGISTRY = { + "java": LanguageSpec( + name="java", + extension=".java", # the file extension for Java code files + ts_language=Language(ts_java.language()), # the TreeSitter Java library + def_node_types=frozenset({"method_declaration", "constructor_declaration"}), # the structures to mutate + comment_node_types=frozenset({"comment", "line_comment", "block_comment"}), # comments to ignore + fence="java", # the language decription used for code fences + noun="Java method", # noun for inserting in prompts + label="Java", # internal label + ), + } + +This example shows the Java language description using the TreeSitter library nodes to describe specific code structures such as comments and method definitions to enable *multiplex* to mutate the relevant code. + +The user should import the relevant TreeSitter library for the language they are adding. +Currently, *multiplex* can only support languages supported by TreeSitter. + From ef53406137ddab16e1d6bebccf276cb267864efc Mon Sep 17 00:00:00 2001 From: MgnMtn Date: Mon, 10 Aug 2026 15:08:03 +0100 Subject: [PATCH 2/2] docs: adding language --- docs/source/index.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 67acf64..b99c02b 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -54,6 +54,14 @@ If you are specifically interested in Hazard Analysis approaches for guiding LLM getting-started existing-modules - configuration + +.. toctree:: + :hidden: + :maxdepth: 2 + :caption: Extending + + adding-language + adding-mutant-generation + adding-execution-and-evaluation