package comby-kernel

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

Module Language.SyntaxSource

Syntax

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

Sourcetype 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 = '\\'

}

Sourcetype 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.

Sourcetype 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
Sourceval to_yojson : t -> Yojson.Safe.json
Sourceval of_yojson : Yojson.Safe.json -> (t, string) Core_kernel.Result.t
Sourcemodule type S = sig ... end

The module signature that defines language syntax for a matcher

OCaml

Innovation. Community. Security.