package comby

  1. Overview
  2. Docs
On This Page
  1. Syntax
Legend:
Library
Module
Module type
Parameter
Class
Class type
Syntax

Defines the syntax structures for the target language (C, Go, etc.) that are significant for matching.

type escapable_string_literals = {
  1. delimiters : string list;
  2. escape_character : char;
}

Defines a set of quoted syntax for strings based on one or more delimiters and associated escape chracter.

E.g., this supports single and double quotes with escape character '\' as: delimiters = [ {|"|, |'| ]; escape_character = '\\'

}

type comment_kind =
  1. | Multiline of string * string
  2. | Nested_multiline of string * string
  3. | Until_newline of string

Defines comment syntax as one of Multiline, Nested_multiline with associated left and right delimiters, or Until_newline that defines a comment prefix. associated prefix.

type t = {
  1. user_defined_delimiters : (string * string) list;
  2. escapable_string_literals : escapable_string_literals option;
  3. raw_string_literals : (string * string) list;
  4. comments : comment_kind list;
}

Defines syntax as:

  • user_defined_delimiters are delimiters treated as code structures (parentheses, brackets, braces, alphabetic words) - escapable_string_literals are escapable quoted strings
  • raw_string literals are raw quoted strings that have no escape character
  • comments are comment structures
val to_yojson : t -> Yojson.Safe.json
val of_yojson : Yojson.Safe.json -> (t, string) Core_kernel.Result.t
module type S = sig ... end

The module signature that defines language syntax for a matcher