☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

Repeating Literal Parser Config

Table of contents

Description:

This key defines a parser configuration that parses a repeating set of exact literal values.

Appears in:
└── Snippet
    └── params
        └── *
            └── Repeating Literal Parser Config
Type:
Object
Properties:
optionsObject Required#

This key defines configuration options for repeating literal parser configurations.

The value is an object that can contain literal, default, minimum, and editor_key properties. These options control what literal string is matched and how many times it can appear.

Show examplesHide examples

In this example, we have configured repeating literal parser options with a literal value and default count.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[literal_param]]>>
    params:
      literal_param:
        parser: repeating_literal
        options:
          literal: separator
          default: 1
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[literal_param]]>>",
      "params": {
        "literal_param": {
          "parser": "repeating_literal",
          "options": {
            "literal": "separator",
            "default": 1
          }
        }
      }
    }
  }
}
parser"repeating_literal" Required#

This key defines the parser type for repeating literal parser configurations.

The value must be repeating_literal. This specifies that the parameter uses the repeating literal parser, which matches a literal string that can appear multiple times.

Show examplesHide examples

In this example, we have configured a repeating literal parser for a snippet parameter.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[literal_param]]>>
    params:
      literal_param:
        parser: repeating_literal
        options:
          literal: separator
          default: 1
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[literal_param]]>>",
      "params": {
        "literal_param": {
          "parser": "repeating_literal",
          "options": {
            "literal": "separator",
            "default": 1
          }
        }
      }
    }
  }
}
Examples:
Open in a new tab