Skip to content

Incremental engine for long horizon agents 🌟 Star if you like it!

114 KB
Raw Blame
{
  "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
  "name": "baml",
  "scopeName": "source.baml",
  "fileTypes": [
    "baml"
  ],
  "patterns": [
    {
      "include": "#comments"
    },
    {
      "include": "#client"
    },
    {
      "include": "#retry-policy"
    },
    {
      "include": "#generator"
    },
    {
      "include": "#template-string"
    },
    {
      "include": "#block-attribute"
    },
    {
      "include": "#enum"
    },
    {
      "include": "#type-alias"
    },
    {
      "include": "#implements-for"
    },
    {
      "include": "#interface"
    },
    {
      "include": "#class"
    },
    {
      "include": "#function"
    },
    {
      "include": "#testset"
    },
    {
      "include": "#test"
    },
    {
      "include": "#let-statement"
    },
    {
      "include": "#semicolon"
    },
    {
      "include": "#associated-type"
    },
    {
      "include": "#member-fragment"
    },
    {
      "include": "#type-fragment"
    }
  ],
  "repository": {
    "accessor-dot": {
      "name": "punctuation.accessor.baml",
      "match": "\\."
    },
    "array-destructure-pattern": {
      "name": "meta.pattern.destructure.array.baml",
      "begin": "(?:\\b((?:let|const))\\b\\s*)?(\\[)",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.binding.baml"
        },
        "2": {
          "name": "punctuation.definition.array.begin.baml"
        }
      },
      "end": "(\\])(?:\\s*(:)\\s*((?:(?!\\s*(?:in\\b|if\\b|=>|=|[,}\\)])).)+))?",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.array.end.baml"
        },
        "2": {
          "name": "punctuation.separator.colon.baml"
        },
        "3": {
          "patterns": [
            {
              "include": "#comments"
            },
            {
              "include": "#type-expression"
            }
          ]
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#array-destructure-rest-operator"
        },
        {
          "include": "#pattern"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "array-destructure-rest-operator": {
      "name": "keyword.operator.rest.baml",
      "match": "\\.\\."
    },
    "array-expression": {
      "name": "meta.expression.array.baml",
      "begin": "\\[",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.array.begin.baml"
        }
      },
      "end": "\\]",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.array.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#expression"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "assignment-operator": {
      "name": "keyword.operator.assignment.baml",
      "match": "="
    },
    "associated-type": {
      "name": "meta.associated-type.baml",
      "begin": "(?:^\\s*|(?<=\\{)\\s*)(type)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.associated-type.baml"
        },
        "2": {
          "name": "entity.name.type.associated.baml"
        }
      },
      "end": "(?<=;)|(?=\\r?\\n|\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#associated-type-extends"
        },
        {
          "include": "#assignment-operator"
        },
        {
          "include": "#type-expression"
        },
        {
          "include": "#semicolon"
        }
      ]
    },
    "associated-type-extends": {
      "name": "keyword.operator.extends.baml",
      "match": "\\bextends\\b"
    },
    "associated-type-projection": {
      "name": "meta.type.associated-projection.baml",
      "begin": "\\((?=[^)\\r\\n]*\\bas\\b)",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.type.begin.baml"
        }
      },
      "end": "(\\))\\s*(\\.)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.type.end.baml"
        },
        "2": {
          "name": "punctuation.accessor.baml"
        },
        "3": {
          "name": "entity.name.type.associated.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-as-operator"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "attribute": {
      "name": "meta.attribute.baml",
      "begin": "(@)(?!@)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*(?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*)\\b",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.annotation.baml storage.type.annotation.baml"
        },
        "2": {
          "patterns": [
            {
              "include": "#accessor-dot"
            },
            {
              "include": "#attribute-path-segment"
            }
          ]
        }
      },
      "end": "(?<=\\))|(?=\\s*@|\\s*,|\\s*\\}|\\s+\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b|\\r?\\n\\s*(?:\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b|@@|\\}))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#attribute-arguments"
        }
      ]
    },
    "attribute-arguments": {
      "name": "meta.attribute.arguments.baml",
      "begin": "\\(",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.annotation-arguments.begin.bracket.round.baml"
        }
      },
      "end": "\\)",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.annotation-arguments.end.bracket.round.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#attribute-expression-block"
        },
        {
          "include": "#literal"
        },
        {
          "include": "#attribute-unquoted-string"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "attribute-expression-block": {
      "name": "meta.attribute.expression.baml",
      "begin": "\\{\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.section.expression.begin.baml"
        }
      },
      "end": "\\}\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.section.expression.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "attribute-path-segment": {
      "name": "storage.type.annotation.baml",
      "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
    },
    "attribute-unquoted-string": {
      "name": "string.unquoted.baml",
      "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
    },
    "await-expression": {
      "name": "keyword.operator.await.baml",
      "match": "\\bawait\\b"
    },
    "backtick-else": {
      "name": "meta.interpolation.control.else.baml",
      "match": "(\\$\\{)\\s*(else)\\s*(\\})",
      "captures": {
        "1": {
          "name": "punctuation.section.interpolation.begin.baml"
        },
        "2": {
          "name": "keyword.control.conditional.baml"
        },
        "3": {
          "name": "punctuation.section.interpolation.end.baml"
        }
      }
    },
    "backtick-else-if": {
      "name": "meta.interpolation.control.else-if.baml",
      "begin": "(\\$\\{)\\s*(else)\\b\\s*(if)\\b",
      "beginCaptures": {
        "1": {
          "name": "punctuation.section.interpolation.begin.baml"
        },
        "2": {
          "name": "keyword.control.conditional.baml"
        },
        "3": {
          "name": "keyword.control.conditional.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.section.interpolation.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#backtick-else-if-condition"
        }
      ]
    },
    "backtick-else-if-condition": {
      "name": "meta.if.condition.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#condition-expression"
        }
      ]
    },
    "backtick-endfor": {
      "name": "meta.interpolation.control.endfor.baml",
      "match": "(\\$\\{)\\s*(endfor)\\s*(\\})",
      "captures": {
        "1": {
          "name": "punctuation.section.interpolation.begin.baml"
        },
        "2": {
          "name": "keyword.control.loop.endfor.baml"
        },
        "3": {
          "name": "punctuation.section.interpolation.end.baml"
        }
      }
    },
    "backtick-endif": {
      "name": "meta.interpolation.control.endif.baml",
      "match": "(\\$\\{)\\s*(endif)\\s*(\\})",
      "captures": {
        "1": {
          "name": "punctuation.section.interpolation.begin.baml"
        },
        "2": {
          "name": "keyword.control.conditional.endif.baml"
        },
        "3": {
          "name": "punctuation.section.interpolation.end.baml"
        }
      }
    },
    "backtick-expression-interpolation": {
      "name": "meta.interpolation.baml",
      "begin": "(\\$\\{)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.section.interpolation.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.section.interpolation.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#backtick-interpolation-let-statement"
        },
        {
          "include": "#block-contents"
        },
        {
          "include": "#expression"
        },
        {
          "include": "#semicolon"
        }
      ]
    },
    "backtick-for-c-style-let-initializer": {
      "name": "meta.for.initializer.baml",
      "begin": "(?=(?:let|const)\\b)",
      "end": "(?=;)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#pattern"
        },
        {
          "include": "#let-else-clause"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "backtick-for-open": {
      "name": "meta.interpolation.control.for.baml",
      "begin": "(\\$\\{)\\s*(for)\\b",
      "beginCaptures": {
        "1": {
          "name": "punctuation.section.interpolation.begin.baml"
        },
        "2": {
          "name": "keyword.control.loop.for.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.section.interpolation.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#backtick-for-parenthesized-in-header"
        },
        {
          "include": "#backtick-for-parenthesized-c-style-header"
        },
        {
          "include": "#backtick-for-unparenthesized-header"
        }
      ]
    },
    "backtick-for-parenthesized-c-style-header": {
      "name": "meta.for.header.baml",
      "begin": "\\G\\s*(\\()",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.for-header.begin.baml"
        }
      },
      "end": "\\)(?=\\s*\\})",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.for-header.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#backtick-for-c-style-let-initializer"
        },
        {
          "include": "#semicolon"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "backtick-for-parenthesized-in-header": {
      "name": "meta.for.header.baml",
      "begin": "\\G\\s*(\\()(?=\\s*(?:let|const)\\b(?:(?![=;]).)*\\bin\\b)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.for-header.begin.baml"
        }
      },
      "end": "\\)(?=\\s*\\})",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.for-header.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#for-in-pattern"
        },
        {
          "include": "#for-in-keyword"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "backtick-for-unparenthesized-header": {
      "name": "meta.for.header.baml",
      "begin": "\\G\\s*(?=(?:let|const)\\b)",
      "end": "(?=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#for-in-pattern"
        },
        {
          "include": "#for-in-keyword"
        },
        {
          "include": "#condition-expression"
        }
      ]
    },
    "backtick-if-condition": {
      "name": "meta.if.condition.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#condition-expression"
        }
      ]
    },
    "backtick-if-open": {
      "name": "meta.interpolation.control.if.baml",
      "begin": "(\\$\\{)\\s*(if)\\b(?=(?:(?![\\{\\}]).)*\\})",
      "beginCaptures": {
        "1": {
          "name": "punctuation.section.interpolation.begin.baml"
        },
        "2": {
          "name": "keyword.control.conditional.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.section.interpolation.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#backtick-if-condition"
        }
      ]
    },
    "backtick-interpolation": {
      "patterns": [
        {
          "include": "#backtick-for-open"
        },
        {
          "include": "#backtick-else-if"
        },
        {
          "include": "#backtick-if-open"
        },
        {
          "include": "#backtick-else"
        },
        {
          "include": "#backtick-endfor"
        },
        {
          "include": "#backtick-endif"
        },
        {
          "include": "#backtick-expression-interpolation"
        }
      ]
    },
    "backtick-interpolation-let-pattern": {
      "name": "meta.pattern.statement.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\s*=)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#pattern"
        }
      ]
    },
    "backtick-interpolation-let-statement": {
      "name": "meta.statement.let.baml",
      "begin": "(?=(?:let|const)\\b)",
      "end": "(?=;|\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#backtick-interpolation-let-pattern"
        },
        {
          "include": "#assignment-operator"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "backtick-string": {
      "patterns": [
        {
          "include": "#backtick-string-8"
        },
        {
          "include": "#backtick-string-7"
        },
        {
          "include": "#backtick-string-6"
        },
        {
          "include": "#backtick-string-5"
        },
        {
          "include": "#backtick-string-4"
        },
        {
          "include": "#backtick-string-3"
        },
        {
          "include": "#backtick-string-2"
        },
        {
          "include": "#backtick-string-1"
        }
      ]
    },
    "backtick-string-1": {
      "name": "string.interpolated.baml",
      "begin": "(?<!\\`)(\\`{1})(?!\\`)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(?<!\\`)(\\`{1})(?!\\`)",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#backtick-interpolation"
        },
        {
          "include": "#string-escape"
        }
      ]
    },
    "backtick-string-2": {
      "name": "string.interpolated.baml",
      "begin": "(?<!\\`)(\\`{2})(?!\\`)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(?<!\\`)(\\`{2})(?!\\`)",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#backtick-interpolation"
        },
        {
          "include": "#string-escape"
        }
      ]
    },
    "backtick-string-3": {
      "name": "string.interpolated.baml",
      "begin": "(?<!\\`)(\\`{3})(?!\\`)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(?<!\\`)(\\`{3})(?!\\`)",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#backtick-interpolation"
        },
        {
          "include": "#string-escape"
        }
      ]
    },
    "backtick-string-4": {
      "name": "string.interpolated.baml",
      "begin": "(?<!\\`)(\\`{4})(?!\\`)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(?<!\\`)(\\`{4})(?!\\`)",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#backtick-interpolation"
        },
        {
          "include": "#string-escape"
        }
      ]
    },
    "backtick-string-5": {
      "name": "string.interpolated.baml",
      "begin": "(?<!\\`)(\\`{5})(?!\\`)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(?<!\\`)(\\`{5})(?!\\`)",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#backtick-interpolation"
        },
        {
          "include": "#string-escape"
        }
      ]
    },
    "backtick-string-6": {
      "name": "string.interpolated.baml",
      "begin": "(?<!\\`)(\\`{6})(?!\\`)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(?<!\\`)(\\`{6})(?!\\`)",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#backtick-interpolation"
        },
        {
          "include": "#string-escape"
        }
      ]
    },
    "backtick-string-7": {
      "name": "string.interpolated.baml",
      "begin": "(?<!\\`)(\\`{7})(?!\\`)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(?<!\\`)(\\`{7})(?!\\`)",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#backtick-interpolation"
        },
        {
          "include": "#string-escape"
        }
      ]
    },
    "backtick-string-8": {
      "name": "string.interpolated.baml",
      "begin": "(?<!\\`)(\\`{8})(?!\\`)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(?<!\\`)(\\`{8})(?!\\`)",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#backtick-interpolation"
        },
        {
          "include": "#string-escape"
        }
      ]
    },
    "backtick-string-escape-delimiter": {
      "name": "constant.character.escape.delimiter.baml",
      "match": "\\\\[`$]"
    },
    "bare-attribute": {
      "name": "meta.attribute.baml",
      "match": "(@)(?!@)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*(?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*|skip)\\b(?=\\s*(?:@|,|\\}|$|//|/\\*))",
      "captures": {
        "1": {
          "name": "punctuation.definition.annotation.baml storage.type.annotation.baml"
        },
        "2": {
          "patterns": [
            {
              "include": "#accessor-dot"
            },
            {
              "include": "#attribute-path-segment"
            }
          ]
        }
      }
    },
    "bare-binding-pattern": {
      "name": "meta.pattern.binding.baml",
      "match": "\\b((?:let|const))\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
      "captures": {
        "1": {
          "name": "keyword.declaration.binding.baml"
        },
        "2": {
          "name": "variable.other.binding.baml"
        }
      }
    },
    "bigint-literal": {
      "name": "constant.numeric.bigint.baml",
      "match": "\\b[0-9]+n"
    },
    "block-attribute": {
      "name": "meta.attribute.block.baml",
      "begin": "(@@)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*(?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*)\\b",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.annotation.baml storage.type.annotation.baml"
        },
        "2": {
          "patterns": [
            {
              "include": "#accessor-dot"
            },
            {
              "include": "#attribute-path-segment"
            }
          ]
        }
      },
      "end": "(?<=\\))|(?=\\s*@@|\\s*@|\\s*,|\\s*\\}|\\s+\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b|\\r?\\n\\s*(?:\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b|@@|\\}))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#attribute-arguments"
        }
      ]
    },
    "block-comment": {
      "name": "comment.block.baml",
      "begin": "/\\*",
      "end": "\\*/"
    },
    "block-contents": {
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#testset"
        },
        {
          "include": "#test"
        },
        {
          "include": "#watch-statement"
        },
        {
          "include": "#let-type-statement"
        },
        {
          "include": "#let-statement"
        },
        {
          "include": "#return-statement"
        },
        {
          "include": "#break-statement"
        },
        {
          "include": "#continue-statement"
        },
        {
          "include": "#defer-statement"
        },
        {
          "include": "#if-else-clause"
        },
        {
          "include": "#for-statement"
        },
        {
          "include": "#while-statement"
        },
        {
          "include": "#expression"
        },
        {
          "include": "#semicolon"
        }
      ]
    },
    "boolean-literal": {
      "name": "constant.language.boolean.baml",
      "match": "\\b(?:true|false)\\b"
    },
    "braced-expression": {
      "name": "meta.expression.braced.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.block.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.block.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#block-contents"
        },
        {
          "include": "#colon-separator"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "break-statement": {
      "name": "meta.statement.break.baml",
      "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(break)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.flow.break.baml"
        }
      },
      "end": "(?=[;}]|$)",
      "patterns": [
        {
          "include": "#comments"
        }
      ]
    },
    "byte-string-escape": {
      "patterns": [
        {
          "include": "#byte-string-escape-hex"
        },
        {
          "include": "#string-escape-control"
        },
        {
          "include": "#string-escape-quoted-delimiter"
        },
        {
          "include": "#backtick-string-escape-delimiter"
        },
        {
          "include": "#byte-string-escape-invalid"
        },
        {
          "include": "#byte-string-non-ascii"
        }
      ]
    },
    "byte-string-escape-hex": {
      "name": "constant.character.escape.hex.baml",
      "match": "\\\\x[0-9A-Fa-f]{2}"
    },
    "byte-string-escape-invalid": {
      "name": "invalid.illegal.escape.baml",
      "match": "\\\\(?:x[0-9A-Fa-f]?|u(?:\\{[^}\"\\\\]*\\}?|[0-9A-Fa-f]{0,4})|.|$)"
    },
    "byte-string-literal": {
      "name": "string.quoted.binary.double.baml",
      "begin": "\\b(b)(\")",
      "beginCaptures": {
        "1": {
          "name": "storage.type.string.baml"
        },
        "2": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "\"",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#byte-string-escape"
        }
      ]
    },
    "byte-string-non-ascii": {
      "name": "invalid.illegal.character.baml",
      "match": "[^\\x00-\\x7F]+"
    },
    "call-arguments": {
      "name": "meta.function-call.arguments.baml",
      "begin": "\\(",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.arguments.begin.baml"
        }
      },
      "end": "\\)",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.arguments.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#expression"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "catch-binding": {
      "name": "variable.parameter.catch.baml",
      "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
    },
    "catch-binding-list": {
      "name": "meta.catch.binding-list.baml",
      "begin": "\\(",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.catch-binding.begin.baml"
        }
      },
      "end": "\\)",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.catch-binding.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#catch-binding"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "catch-block": {
      "name": "meta.block.catch.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.block.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.block.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#match-arm"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "catch-expression": {
      "name": "meta.expression.catch.baml",
      "begin": "\\b(catch|catch_all)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.exception.catch.baml"
        }
      },
      "end": "(?<=\\})|(?=,|;|$)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#catch-binding-list"
        },
        {
          "include": "#catch-block"
        }
      ]
    },
    "class": {
      "name": "meta.class.baml",
      "begin": "^\\s*(class)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.class.baml"
        }
      },
      "end": "(?<=\\})|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#class-header"
        },
        {
          "include": "#class-body"
        }
      ]
    },
    "class-body": {
      "name": "meta.class.body.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.block.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.block.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#block-attribute"
        },
        {
          "include": "#bare-attribute"
        },
        {
          "include": "#attribute"
        },
        {
          "include": "#implements-block"
        },
        {
          "include": "#function"
        },
        {
          "include": "#field"
        },
        {
          "include": "#semicolon"
        }
      ]
    },
    "class-destructure-body": {
      "name": "meta.pattern.destructure.class.body.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.pattern.destructure.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.pattern.destructure.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#class-destructure-field"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "class-destructure-field": {
      "name": "meta.pattern.destructure.class.field.baml",
      "begin": "\\b(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b\\s*(:)?",
      "beginCaptures": {
        "1": {
          "name": "variable.other.property.baml"
        },
        "2": {
          "name": "punctuation.separator.colon.baml"
        }
      },
      "end": "(?=,|\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#pattern"
        }
      ]
    },
    "class-destructure-pattern": {
      "name": "meta.pattern.destructure.class.baml",
      "begin": "\\b(?:((?:let|const))\\s+)?(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*(?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*)\\b\\s*(?=(?:<[^{}=;\\r\\n]*>\\s*)?\\{)",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.binding.baml"
        },
        "2": {
          "patterns": [
            {
              "include": "#type-reference"
            }
          ]
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        },
        {
          "include": "#class-destructure-body"
        }
      ]
    },
    "class-header": {
      "name": "meta.class.header.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\{)|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#declaration-type-parameters"
        },
        {
          "include": "#class-name"
        }
      ]
    },
    "class-name": {
      "name": "entity.name.type.class.baml",
      "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
    },
    "client": {
      "name": "meta.client.baml",
      "begin": "^\\s*(client)\\b(?:\\s*(<)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(>)\\s*|\\s+)(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b(?=\\s*\\{)",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.client.baml"
        },
        "2": {
          "name": "punctuation.definition.type-parameters.begin.baml"
        },
        "3": {
          "name": "support.type.client.baml"
        },
        "4": {
          "name": "punctuation.definition.type-parameters.end.baml"
        },
        "5": {
          "name": "entity.name.client.baml"
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#config-block"
        }
      ]
    },
    "code-block": {
      "name": "meta.block.code.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.block.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.block.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#block-contents"
        }
      ]
    },
    "colon-separator": {
      "name": "punctuation.separator.colon.baml",
      "match": ":"
    },
    "comma": {
      "name": "punctuation.separator.comma.baml",
      "match": ","
    },
    "comments": {
      "patterns": [
        {
          "include": "#line-comment"
        },
        {
          "include": "#block-comment"
        }
      ]
    },
    "condition-expression": {
      "patterns": [
        {
          "include": "#literal"
        },
        {
          "include": "#array-expression"
        },
        {
          "include": "#lambda-expression"
        },
        {
          "include": "#parenthesized-expression"
        },
        {
          "include": "#if-expression"
        },
        {
          "include": "#match-expression"
        },
        {
          "include": "#spawn-expression"
        },
        {
          "include": "#map-expression"
        },
        {
          "include": "#braced-expression"
        },
        {
          "include": "#await-expression"
        },
        {
          "include": "#throw-expression"
        },
        {
          "include": "#catch-expression"
        },
        {
          "include": "#condition-is-pattern-expression"
        },
        {
          "include": "#optional-call-expression"
        },
        {
          "include": "#optional-index-expression"
        },
        {
          "include": "#optional-method-call-expression"
        },
        {
          "include": "#optional-field-access-expression"
        },
        {
          "include": "#upcast-expression"
        },
        {
          "include": "#postfix-method-call-expression"
        },
        {
          "include": "#field-access-expression"
        },
        {
          "include": "#expression-operator"
        },
        {
          "include": "#function-call-expression"
        },
        {
          "include": "#dotted-expression"
        }
      ]
    },
    "condition-is-pattern-expression": {
      "name": "meta.expression.is.baml",
      "begin": "\\b(is)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.operator.is.baml"
        }
      },
      "end": "(?=\\s*(?:&&|\\|\\||=>|[,);\\]}{]|$))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#condition-pattern"
        }
      ]
    },
    "condition-pattern": {
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#wildcard-binding-pattern"
        },
        {
          "include": "#typed-binding-pattern"
        },
        {
          "include": "#array-destructure-pattern"
        },
        {
          "include": "#bare-binding-pattern"
        },
        {
          "include": "#wildcard-pattern"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "config-array": {
      "patterns": [
        {
          "include": "#config-array-body"
        }
      ]
    },
    "config-array-body": {
      "name": "meta.config.array.baml",
      "begin": "\\[",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.array.begin.baml"
        }
      },
      "end": "\\]",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.array.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#config-block"
        },
        {
          "include": "#config-array"
        },
        {
          "include": "#expression"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "config-block": {
      "patterns": [
        {
          "include": "#config-block-body"
        }
      ]
    },
    "config-block-body": {
      "name": "meta.config.block.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.block.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.block.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#config-field"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "config-field": {
      "name": "meta.field.config.baml",
      "begin": "(?:^\\s*|(?<=[\\{,])\\s*)(?:(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b|(\"(?:\\\\.|[^\"\\\\])*\"))\\s*(:)?",
      "beginCaptures": {
        "1": {
          "name": "variable.other.property.baml"
        },
        "2": {
          "patterns": [
            {
              "include": "#string-literal"
            }
          ]
        },
        "3": {
          "name": "punctuation.separator.colon.baml"
        }
      },
      "end": "(?=,|\\r?\\n|\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#config-block"
        },
        {
          "include": "#config-array"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "constructor-body": {
      "name": "meta.constructor.body.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.constructor.body.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.constructor.body.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#constructor-field"
        },
        {
          "include": "#constructor-field-shorthand"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "constructor-expression": {
      "name": "meta.constructor.expression.baml",
      "begin": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*(?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*\\b(?=\\s*(?:<[^{}=;\\r\\n]*>\\s*)?\\{)",
      "beginCaptures": {
        "0": {
          "patterns": [
            {
              "include": "#accessor-dot"
            },
            {
              "include": "#constructor-type"
            }
          ]
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#constructor-type-arguments"
        },
        {
          "include": "#constructor-body"
        }
      ]
    },
    "constructor-field": {
      "name": "meta.constructor.field.baml",
      "begin": "\\b(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(:)",
      "beginCaptures": {
        "1": {
          "name": "variable.other.property.baml"
        },
        "2": {
          "name": "punctuation.separator.colon.baml"
        }
      },
      "end": "(?=,|\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "constructor-field-shorthand": {
      "name": "meta.constructor.field.baml",
      "begin": "(?:^|(?<=[{,])|(?<=\\*/))[ \\t]*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)[ \\t]+(?=#+\"|\"|b\"|\\`|\\[|[0-9+-]|true\\b|false\\b|null\\b|env\\b)",
      "beginCaptures": {
        "1": {
          "name": "variable.other.property.baml"
        }
      },
      "end": "(?=,|\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "constructor-type": {
      "name": "entity.name.type.baml",
      "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
    },
    "constructor-type-arguments": {
      "name": "meta.type-arguments.baml",
      "begin": "<",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.type-arguments.begin.baml"
        }
      },
      "end": ">(?=\\s*\\{)",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.type-arguments.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "continue-statement": {
      "name": "meta.statement.continue.baml",
      "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(continue)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.flow.continue.baml"
        }
      },
      "end": "(?=[;}]|$)",
      "patterns": [
        {
          "include": "#comments"
        }
      ]
    },
    "declaration-type-parameter": {
      "name": "meta.type-parameter.baml",
      "begin": "\\b(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
      "beginCaptures": {
        "1": {
          "name": "entity.name.type.parameter.baml"
        }
      },
      "end": "(?=,|>(?=\\s*(?:\\(|\\{|requires\\b|\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#declaration-type-parameter-extends"
        },
        {
          "include": "#declaration-type-parameter-intersection"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "declaration-type-parameter-extends": {
      "name": "keyword.operator.extends.baml",
      "match": "\\bextends\\b"
    },
    "declaration-type-parameter-intersection": {
      "name": "keyword.operator.type.baml",
      "match": "&"
    },
    "declaration-type-parameters": {
      "name": "meta.type-parameters.baml",
      "begin": "<",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.type-parameters.begin.baml"
        }
      },
      "end": ">(?=\\s*(?:\\(|\\{|requires\\b|\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*))",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.type-parameters.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#declaration-type-parameter"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "defer-statement": {
      "name": "meta.statement.defer.baml",
      "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(defer)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.flow.defer.baml"
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#code-block"
        }
      ]
    },
    "dotted-expression": {
      "name": "meta.dotted-expression.baml",
      "match": "\\b(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)((?:\\s*\\.\\s*(?!as\\b\\s*<)\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*)\\b",
      "captures": {
        "1": {
          "patterns": [
            {
              "include": "#namespace-root"
            },
            {
              "include": "#environment-expression-root"
            },
            {
              "include": "#self-expression-root"
            },
            {
              "include": "#expression-identifier"
            }
          ]
        },
        "2": {
          "patterns": [
            {
              "include": "#accessor-dot"
            },
            {
              "include": "#expression-identifier"
            }
          ]
        }
      }
    },
    "enum": {
      "name": "meta.enum.baml",
      "begin": "^\\s*(enum)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.enum.baml"
        }
      },
      "end": "(?<=\\})|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#enum-header"
        },
        {
          "include": "#enum-body"
        }
      ]
    },
    "enum-body": {
      "name": "meta.enum.body.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.block.begin.baml"
        }
      },
      "end": "\\}|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.block.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#block-attribute"
        },
        {
          "include": "#enum-variant"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "enum-header": {
      "name": "meta.enum.header.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\{)|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#enum-name"
        }
      ]
    },
    "enum-name": {
      "name": "entity.name.type.enum.baml",
      "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
    },
    "enum-variant": {
      "name": "meta.enum.variant.baml",
      "begin": "(?:^\\s*|(?<=[\\{,])\\s*|\\s+)(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
      "beginCaptures": {
        "1": {
          "name": "variable.other.enummember.baml"
        }
      },
      "end": "(?=,|\\s+@@|\\s*\\}|\\s+\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b|\\r?\\n\\s*(?:\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b|@@|\\}))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#bare-attribute"
        },
        {
          "include": "#attribute"
        }
      ]
    },
    "environment-expression-root": {
      "name": "support.other.namespace.baml",
      "match": "\\benv\\b"
    },
    "expression": {
      "patterns": [
        {
          "include": "#literal"
        },
        {
          "include": "#array-expression"
        },
        {
          "include": "#lambda-expression"
        },
        {
          "include": "#parenthesized-expression"
        },
        {
          "include": "#if-expression"
        },
        {
          "include": "#match-expression"
        },
        {
          "include": "#spawn-expression"
        },
        {
          "include": "#map-expression"
        },
        {
          "include": "#constructor-expression"
        },
        {
          "include": "#braced-expression"
        },
        {
          "include": "#await-expression"
        },
        {
          "include": "#throw-expression"
        },
        {
          "include": "#catch-expression"
        },
        {
          "include": "#is-pattern-expression"
        },
        {
          "include": "#optional-call-expression"
        },
        {
          "include": "#optional-index-expression"
        },
        {
          "include": "#optional-method-call-expression"
        },
        {
          "include": "#optional-field-access-expression"
        },
        {
          "include": "#upcast-expression"
        },
        {
          "include": "#postfix-method-call-expression"
        },
        {
          "include": "#field-access-expression"
        },
        {
          "include": "#expression-operator"
        },
        {
          "include": "#function-call-expression"
        },
        {
          "include": "#dotted-expression"
        }
      ]
    },
    "expression-accessor-operator": {
      "name": "punctuation.accessor.baml",
      "match": "\\?\\.|\\.|\\$"
    },
    "expression-arithmetic-operator": {
      "name": "keyword.operator.arithmetic.baml",
      "match": "\\+\\+|--|\\+|-|\\*|/|%"
    },
    "expression-arrow-operator": {
      "name": "keyword.operator.arrow.baml",
      "match": "=>|->"
    },
    "expression-bitwise-operator": {
      "name": "keyword.operator.bitwise.baml",
      "match": "&|\\^|~|\\|"
    },
    "expression-comparison-operator": {
      "name": "keyword.operator.comparison.baml",
      "match": "<=|>=|<|>"
    },
    "expression-compound-assignment-operator": {
      "name": "keyword.operator.assignment.baml",
      "match": "<<=|>>=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^="
    },
    "expression-equality-operator": {
      "name": "keyword.operator.comparison.baml",
      "match": "==|!="
    },
    "expression-identifier": {
      "name": "variable.other.readwrite.baml",
      "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
    },
    "expression-logical-operator": {
      "name": "keyword.operator.logical.baml",
      "match": "&&|\\|\\||!"
    },
    "expression-nullish-operator": {
      "name": "keyword.operator.nullish.baml",
      "match": "\\?\\?"
    },
    "expression-operator": {
      "patterns": [
        {
          "include": "#expression-arrow-operator"
        },
        {
          "include": "#expression-compound-assignment-operator"
        },
        {
          "include": "#expression-nullish-operator"
        },
        {
          "include": "#expression-logical-operator"
        },
        {
          "include": "#expression-equality-operator"
        },
        {
          "include": "#expression-shift-operator"
        },
        {
          "include": "#expression-comparison-operator"
        },
        {
          "include": "#expression-bitwise-operator"
        },
        {
          "include": "#expression-arithmetic-operator"
        },
        {
          "include": "#assignment-operator"
        },
        {
          "include": "#expression-spread-operator"
        },
        {
          "include": "#expression-accessor-operator"
        }
      ]
    },
    "expression-shift-operator": {
      "name": "keyword.operator.bitwise.shift.baml",
      "match": "<<|>>"
    },
    "expression-spread-operator": {
      "name": "keyword.operator.spread.baml",
      "match": "\\.\\.\\."
    },
    "field": {
      "name": "meta.field.baml",
      "begin": "(?:^\\s*|(?<=\\{)\\s*)(?!@)(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(:)?",
      "beginCaptures": {
        "1": {
          "name": "variable.other.property.baml"
        },
        "2": {
          "name": "punctuation.separator.colon.baml"
        }
      },
      "end": "(?=\\})|$",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "field-access-expression": {
      "name": "meta.field-access.baml",
      "match": "([.$])\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
      "captures": {
        "1": {
          "name": "punctuation.accessor.baml"
        },
        "2": {
          "name": "variable.other.readwrite.baml"
        }
      }
    },
    "float-literal": {
      "name": "constant.numeric.float.baml",
      "match": "\\b[0-9]+(?:\\.[0-9]+[eE][+-]?[0-9]+|\\.[0-9]+|[eE][+-]?[0-9]+)"
    },
    "for-c-style-let-initializer": {
      "name": "meta.for.initializer.baml",
      "begin": "(?=(?:let|const)\\b)",
      "end": "(?=;)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#pattern"
        },
        {
          "include": "#let-else-clause"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "for-in-keyword": {
      "name": "keyword.operator.in.baml",
      "match": "\\bin\\b"
    },
    "for-in-pattern": {
      "name": "meta.pattern.for-in.baml",
      "begin": "(?=(?:let|const)\\b)",
      "end": "(?=\\s+in\\b)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#pattern"
        }
      ]
    },
    "for-parenthesized-c-style-header": {
      "name": "meta.for.header.baml",
      "begin": "\\G\\s*(\\()",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.for-header.begin.baml"
        }
      },
      "end": "\\)(?=\\s*\\{)",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.for-header.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#for-c-style-let-initializer"
        },
        {
          "include": "#semicolon"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "for-parenthesized-in-header": {
      "name": "meta.for.header.baml",
      "begin": "\\G\\s*(\\()(?=\\s*(?:let|const)\\b(?:(?![=;]).)*\\bin\\b)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.for-header.begin.baml"
        }
      },
      "end": "\\)(?=\\s*\\{)",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.for-header.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#for-in-pattern"
        },
        {
          "include": "#for-in-keyword"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "for-statement": {
      "name": "meta.statement.for.baml",
      "begin": "\\b(for)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.loop.for.baml"
        }
      },
      "end": "(?<=\\})(?=\\s*(?:;|$))|(?=;|$)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#for-parenthesized-in-header"
        },
        {
          "include": "#for-parenthesized-c-style-header"
        },
        {
          "include": "#for-unparenthesized-header"
        },
        {
          "include": "#code-block"
        }
      ]
    },
    "for-unparenthesized-header": {
      "name": "meta.for.header.baml",
      "begin": "\\G\\s*(?=(?:let|const)\\b)",
      "end": "(?=\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#for-in-pattern"
        },
        {
          "include": "#for-in-keyword"
        },
        {
          "include": "#condition-expression"
        }
      ]
    },
    "function": {
      "name": "meta.function.baml",
      "begin": "^\\s*(function)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.function.baml"
        },
        "2": {
          "name": "entity.name.function.baml"
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#declaration-type-parameters"
        },
        {
          "include": "#function-parameters"
        },
        {
          "include": "#function-return-type"
        },
        {
          "include": "#function-block"
        }
      ]
    },
    "function-block": {
      "name": "meta.block.function.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.block.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.block.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#llm-client-field"
        },
        {
          "include": "#llm-prompt-field"
        },
        {
          "include": "#block-contents"
        }
      ]
    },
    "function-call-expression": {
      "name": "meta.function-call.baml",
      "begin": "\\b(?:(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(\\.)\\s*)?((?:\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\s*\\.\\s*)*)(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b(?=\\s*(?:<[^(){};]*>\\s*)?\\()",
      "beginCaptures": {
        "1": {
          "patterns": [
            {
              "include": "#namespace-root"
            },
            {
              "include": "#environment-expression-root"
            },
            {
              "include": "#self-expression-root"
            },
            {
              "include": "#expression-identifier"
            }
          ]
        },
        "2": {
          "name": "punctuation.accessor.baml"
        },
        "3": {
          "patterns": [
            {
              "include": "#accessor-dot"
            },
            {
              "include": "#expression-identifier"
            }
          ]
        },
        "4": {
          "name": "entity.name.function.baml"
        }
      },
      "end": "(?<=\\))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#function-call-type-arguments"
        },
        {
          "include": "#call-arguments"
        }
      ]
    },
    "function-call-type-arguments": {
      "name": "meta.type-arguments.baml",
      "begin": "<",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.type-arguments.begin.baml"
        }
      },
      "end": ">(?=\\s*\\()",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.type-arguments.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "function-parameters": {
      "name": "meta.parameters.baml",
      "begin": "\\(",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.parameters.begin.baml"
        }
      },
      "end": "\\)",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.parameters.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#self-parameter"
        },
        {
          "include": "#parameter"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "function-return-type": {
      "name": "meta.return-type.baml",
      "begin": "(->)",
      "beginCaptures": {
        "1": {
          "name": "keyword.operator.arrow.baml"
        }
      },
      "end": "(?=\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "generator": {
      "name": "meta.generator.baml",
      "begin": "^\\s*(generator)\\b(?:\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*))?\\s*(?=\\{)",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.generator.baml"
        },
        "2": {
          "name": "entity.name.generator.baml"
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#config-block"
        }
      ]
    },
    "if-condition": {
      "name": "meta.if.condition.baml",
      "begin": "\\G(?!\\s*else\\b)\\s*",
      "end": "(?=\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#condition-expression"
        }
      ]
    },
    "if-else-clause": {
      "name": "meta.else.baml",
      "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(else)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.conditional.baml"
        }
      },
      "end": "(?!\\s*else\\b)(?:(?<=\\})(?=\\s*(?:[,);]|$))|(?=,|\\)|;|$))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#if-expression"
        },
        {
          "include": "#code-block"
        }
      ]
    },
    "if-expression": {
      "name": "meta.expression.if.baml",
      "begin": "\\b(if)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.conditional.baml"
        }
      },
      "end": "(?!\\s*else\\b)(?:(?<=\\})(?=\\s*(?:[,);]|$))|(?=,|\\)|;|$))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#if-let-pattern"
        },
        {
          "include": "#assignment-operator"
        },
        {
          "include": "#if-condition"
        },
        {
          "include": "#code-block"
        },
        {
          "include": "#if-else-clause"
        }
      ]
    },
    "if-let-pattern": {
      "name": "meta.pattern.if-let.baml",
      "begin": "\\G\\s*(?=(?:let|const)\\b)",
      "end": "(?=\\s*=)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#pattern"
        }
      ]
    },
    "implements-block": {
      "name": "meta.implements.baml",
      "begin": "^\\s*(implements|implement)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.implements.baml"
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#implements-target"
        },
        {
          "include": "#implements-body"
        }
      ]
    },
    "implements-body": {
      "name": "meta.implements.body.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.block.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.block.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#function"
        },
        {
          "include": "#associated-type"
        },
        {
          "include": "#interface-field-link"
        },
        {
          "include": "#field"
        },
        {
          "include": "#semicolon"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "implements-for": {
      "name": "meta.implements-for.baml",
      "begin": "^\\s*(implements|implement)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.implements.baml"
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#declaration-type-parameters"
        },
        {
          "include": "#implements-for-interface-target"
        },
        {
          "include": "#implements-for-keyword"
        },
        {
          "include": "#implements-for-target"
        },
        {
          "include": "#implements-body"
        }
      ]
    },
    "implements-for-interface-target": {
      "name": "meta.implements.target.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\s+\\bfor\\b)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "implements-for-keyword": {
      "name": "keyword.declaration.for.baml",
      "match": "\\bfor\\b"
    },
    "implements-for-target": {
      "name": "meta.implements.for-target.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "implements-target": {
      "name": "meta.implements.target.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "integer-literal": {
      "name": "constant.numeric.integer.baml",
      "match": "\\b[0-9]+\\b"
    },
    "interface": {
      "name": "meta.interface.baml",
      "begin": "^\\s*(interface)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.interface.baml"
        },
        "2": {
          "name": "entity.name.type.interface.baml"
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#declaration-type-parameters"
        },
        {
          "include": "#interface-requires-clause"
        },
        {
          "include": "#interface-body"
        }
      ]
    },
    "interface-body": {
      "name": "meta.interface.body.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.block.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.block.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#interface-method-signature"
        },
        {
          "include": "#function"
        },
        {
          "include": "#associated-type"
        },
        {
          "include": "#field"
        },
        {
          "include": "#semicolon"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "interface-field-link": {
      "name": "meta.interface-field-link.baml",
      "begin": "(?:^\\s*|(?<=\\{)\\s*)(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s+(as)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
      "beginCaptures": {
        "1": {
          "name": "variable.other.property.interface.baml"
        },
        "2": {
          "name": "keyword.operator.as.baml"
        },
        "3": {
          "name": "variable.other.property.baml"
        }
      },
      "end": "(?<=;)|(?=\\r?\\n|\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#semicolon"
        }
      ]
    },
    "interface-method-return-type": {
      "name": "meta.return-type.baml",
      "begin": "(->)",
      "beginCaptures": {
        "1": {
          "name": "keyword.operator.arrow.baml"
        }
      },
      "end": "(?=;|\\r?\\n|\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "interface-method-signature": {
      "name": "meta.function.signature.baml",
      "begin": "^\\s*(function)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b(?=[^{\\r\\n]*(?:\\r?\\n|;|\\}))",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.function.baml"
        },
        "2": {
          "name": "entity.name.function.baml"
        }
      },
      "end": "(?<=;)|(?=\\r?\\n|\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#declaration-type-parameters"
        },
        {
          "include": "#function-parameters"
        },
        {
          "include": "#interface-method-return-type"
        },
        {
          "include": "#semicolon"
        }
      ]
    },
    "interface-requires-clause": {
      "name": "meta.interface.requires.baml",
      "begin": "\\b(requires)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.requires.baml"
        }
      },
      "end": "(?=\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "is-pattern-expression": {
      "name": "meta.expression.is.baml",
      "begin": "\\b(is)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.operator.is.baml"
        }
      },
      "end": "(?=\\s*(?:&&|\\|\\||=>|[,);\\]}]|$))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#pattern"
        }
      ]
    },
    "lambda-arrow": {
      "name": "keyword.operator.arrow.baml",
      "match": "->|=>"
    },
    "lambda-expression": {
      "name": "meta.expression.lambda.baml",
      "begin": "(?=\\((?:[^()]|\\([^()]*\\))*\\)\\s*(?:->|=>))",
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#function-parameters"
        },
        {
          "include": "#lambda-arrow"
        },
        {
          "include": "#lambda-return-type"
        },
        {
          "include": "#lambda-throws-clause"
        },
        {
          "include": "#code-block"
        }
      ]
    },
    "lambda-return-type": {
      "name": "meta.return-type.lambda.baml",
      "begin": "(?<=->|=>)\\s*(?!throws\\b)(?=[^\\s\\{])",
      "end": "(?=\\s*(?:throws\\b|\\{))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "lambda-throws-clause": {
      "name": "meta.throws.lambda.baml",
      "begin": "\\b(throws)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.operator.throws.baml"
        }
      },
      "end": "(?=\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "let-else-clause": {
      "name": "meta.statement.let.else.baml",
      "begin": "\\b(else)\\b(?=\\s*\\{)",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.conditional.else.baml"
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#code-block"
        }
      ]
    },
    "let-statement": {
      "name": "meta.statement.let.baml",
      "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(?=(?:let|const)\\b)",
      "end": "(?=[;}]|$)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#let-statement-pattern"
        },
        {
          "include": "#assignment-operator"
        },
        {
          "include": "#let-else-clause"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "let-statement-pattern": {
      "name": "meta.pattern.statement.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\s*=)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#pattern"
        }
      ]
    },
    "let-type-bound-intersection": {
      "name": "keyword.operator.type.baml",
      "match": "&"
    },
    "let-type-bounds": {
      "name": "meta.type-parameter.bounds.baml",
      "begin": "\\b(extends)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.operator.extends.baml"
        }
      },
      "end": "(?=\\s*=)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#let-type-bound-intersection"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "let-type-statement": {
      "name": "meta.statement.let-type.baml",
      "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(let)\\s+(type)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.binding.baml"
        },
        "2": {
          "name": "keyword.declaration.type-binding.baml"
        },
        "3": {
          "name": "entity.name.type.parameter.baml"
        }
      },
      "end": "(?=[;}]|$)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#let-type-bounds"
        },
        {
          "include": "#assignment-operator"
        },
        {
          "include": "#let-else-clause"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "line-comment": {
      "name": "comment.line.double-slash.baml",
      "match": "//.*$"
    },
    "literal": {
      "patterns": [
        {
          "include": "#byte-string-literal"
        },
        {
          "include": "#raw-quoted-string-literal"
        },
        {
          "include": "#type-literal"
        }
      ]
    },
    "llm-client-field": {
      "name": "meta.field.llm.client.baml",
      "begin": "^\\s*(client)\\b\\s*(:)?(?!\\s*\\.)",
      "beginCaptures": {
        "1": {
          "name": "keyword.other.llm.client.baml"
        },
        "2": {
          "name": "punctuation.separator.colon.baml"
        }
      },
      "end": "$",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "llm-prompt-field": {
      "name": "meta.field.llm.prompt.baml",
      "begin": "^\\s*(prompt)\\b\\s*(:)?",
      "beginCaptures": {
        "1": {
          "name": "keyword.other.llm.prompt.baml"
        },
        "2": {
          "name": "punctuation.separator.colon.baml"
        }
      },
      "end": "$",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#template-string-body"
        },
        {
          "include": "#backtick-string"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "map-expression": {
      "name": "meta.expression.map.baml",
      "begin": "\\bmap\\b(?=\\s*\\{)",
      "beginCaptures": {
        "0": {
          "name": "support.type.primitive.baml"
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#braced-expression"
        }
      ]
    },
    "match-arm": {
      "name": "meta.match.arm.baml",
      "begin": "(?=\\S)(?![,}])",
      "end": "(?=,|\\r?\\n|\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#match-arm-pattern"
        },
        {
          "include": "#match-arm-guard"
        },
        {
          "include": "#match-arm-arrow"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "match-arm-arrow": {
      "name": "keyword.operator.arrow.baml",
      "match": "=>"
    },
    "match-arm-guard": {
      "name": "meta.match.guard.baml",
      "begin": "\\b(if)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.conditional.baml"
        }
      },
      "end": "(?=\\s*=>)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "match-arm-pattern": {
      "name": "meta.pattern.match.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\s*(?:if\\b|=>))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#pattern"
        }
      ]
    },
    "match-block": {
      "name": "meta.block.match.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.block.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.block.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#match-arm"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "match-expression": {
      "name": "meta.expression.match.baml",
      "begin": "\\b(match)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.match.baml"
        }
      },
      "end": "(?<=\\})|(?=,|;|$)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#match-scrutinee-group"
        },
        {
          "include": "#match-block"
        },
        {
          "include": "#match-scrutinee"
        }
      ]
    },
    "match-scrutinee": {
      "name": "meta.match.scrutinee.baml",
      "begin": "(?=[^\\s\\{])",
      "end": "(?=\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#literal"
        },
        {
          "include": "#array-expression"
        },
        {
          "include": "#spawn-expression"
        },
        {
          "include": "#await-expression"
        },
        {
          "include": "#throw-expression"
        },
        {
          "include": "#catch-expression"
        },
        {
          "include": "#expression-operator"
        },
        {
          "include": "#function-call-expression"
        },
        {
          "include": "#dotted-expression"
        }
      ]
    },
    "match-scrutinee-group": {
      "name": "meta.match.scrutinee.group.baml",
      "begin": "\\(",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.group.begin.baml"
        }
      },
      "end": "\\)",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.group.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#expression"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "member-fragment": {
      "name": "meta.member-fragment.baml",
      "begin": "^\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(\\?)?\\s*(:)",
      "beginCaptures": {
        "1": {
          "name": "variable.other.property.baml"
        },
        "2": {
          "name": "keyword.operator.optional.baml"
        },
        "3": {
          "name": "punctuation.separator.colon.baml"
        }
      },
      "end": "$",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "namespace-root": {
      "name": "support.other.namespace.baml",
      "match": "\\b(?:root|baml)\\b"
    },
    "namespace-segment": {
      "name": "entity.name.namespace.baml",
      "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
    },
    "null-literal": {
      "name": "constant.language.null.baml",
      "match": "\\bnull\\b"
    },
    "numeric-literal": {
      "patterns": [
        {
          "include": "#bigint-literal"
        },
        {
          "include": "#float-literal"
        },
        {
          "include": "#integer-literal"
        }
      ]
    },
    "optional-call-expression": {
      "name": "meta.function-call.optional.baml",
      "begin": "(\\?\\.)\\s*(?=\\()",
      "beginCaptures": {
        "1": {
          "name": "punctuation.accessor.baml"
        }
      },
      "end": "(?<=\\))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#call-arguments"
        }
      ]
    },
    "optional-field-access-expression": {
      "name": "meta.field-access.optional.baml",
      "match": "(\\?\\.)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
      "captures": {
        "1": {
          "name": "punctuation.accessor.baml"
        },
        "2": {
          "name": "variable.other.readwrite.baml"
        }
      }
    },
    "optional-index-arguments": {
      "name": "meta.index.arguments.baml",
      "begin": "\\[",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.bracket.begin.baml"
        }
      },
      "end": "\\]",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.bracket.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "optional-index-expression": {
      "name": "meta.index.optional.baml",
      "begin": "(\\?\\.)\\s*(?=\\[)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.accessor.baml"
        }
      },
      "end": "(?<=\\])",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#optional-index-arguments"
        }
      ]
    },
    "optional-method-call-expression": {
      "name": "meta.function-call.optional.member.baml",
      "begin": "(\\?\\.)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b(?=\\s*(?:<[^(){};]*>\\s*)?\\()",
      "beginCaptures": {
        "1": {
          "name": "punctuation.accessor.baml"
        },
        "2": {
          "name": "entity.name.function.baml"
        }
      },
      "end": "(?<=\\))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#optional-method-call-type-arguments"
        },
        {
          "include": "#call-arguments"
        }
      ]
    },
    "optional-method-call-type-arguments": {
      "name": "meta.type-arguments.baml",
      "begin": "<",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.type-arguments.begin.baml"
        }
      },
      "end": ">(?=\\s*\\()",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.type-arguments.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "optional-operator": {
      "name": "keyword.operator.optional.baml",
      "match": "\\?"
    },
    "parameter": {
      "name": "meta.parameter.baml",
      "begin": "\\b(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(:)?",
      "beginCaptures": {
        "1": {
          "name": "variable.parameter.baml"
        },
        "2": {
          "name": "punctuation.separator.colon.baml"
        }
      },
      "end": "(?=,|\\))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#parameter-type-parens"
        },
        {
          "include": "#parameter-type-arguments"
        },
        {
          "include": "#parameter-default"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "parameter-default": {
      "name": "meta.parameter.default.baml",
      "begin": "=",
      "beginCaptures": {
        "0": {
          "name": "keyword.operator.assignment.baml"
        }
      },
      "end": "(?=,|\\))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "parameter-type-arguments": {
      "name": "meta.type-arguments.baml",
      "begin": "<",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.type-arguments.begin.baml"
        }
      },
      "end": ">",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.type-arguments.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "parameter-type-parens": {
      "name": "meta.group.type.baml",
      "begin": "\\(",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.type.begin.baml"
        }
      },
      "end": "\\)",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.type.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "parenthesized-expression": {
      "name": "meta.group.expression.baml",
      "begin": "\\(",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.group.begin.baml"
        }
      },
      "end": "\\)",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.group.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "pattern": {
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#wildcard-binding-pattern"
        },
        {
          "include": "#typed-binding-pattern"
        },
        {
          "include": "#class-destructure-pattern"
        },
        {
          "include": "#array-destructure-pattern"
        },
        {
          "include": "#bare-binding-pattern"
        },
        {
          "include": "#wildcard-pattern"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "postfix-method-call-expression": {
      "name": "meta.function-call.member.baml",
      "begin": "([.$])\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b(?=\\s*(?:<[^(){};]*>\\s*)?\\()",
      "beginCaptures": {
        "1": {
          "name": "punctuation.accessor.baml"
        },
        "2": {
          "name": "entity.name.function.baml"
        }
      },
      "end": "(?<=\\))",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#postfix-method-call-type-arguments"
        },
        {
          "include": "#call-arguments"
        }
      ]
    },
    "postfix-method-call-type-arguments": {
      "name": "meta.type-arguments.baml",
      "begin": "<",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.type-arguments.begin.baml"
        }
      },
      "end": ">(?=\\s*\\()",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.type-arguments.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "primitive-type": {
      "name": "support.type.primitive.baml",
      "match": "\\b(?:int|float|bigint|string|bool|image|audio|map|json|unknown|never|Self)\\b"
    },
    "raw-quoted-string-escaped-char": {
      "match": "\\\\."
    },
    "raw-quoted-string-literal": {
      "name": "string.quoted.raw.double.baml",
      "begin": "\\b(r)(\")",
      "beginCaptures": {
        "1": {
          "name": "storage.type.string.baml"
        },
        "2": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "\"",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#raw-quoted-string-escaped-char"
        }
      ]
    },
    "raw-string": {
      "patterns": [
        {
          "include": "#raw-string-8"
        },
        {
          "include": "#raw-string-7"
        },
        {
          "include": "#raw-string-6"
        },
        {
          "include": "#raw-string-5"
        },
        {
          "include": "#raw-string-4"
        },
        {
          "include": "#raw-string-3"
        },
        {
          "include": "#raw-string-2"
        },
        {
          "include": "#raw-string-1"
        }
      ]
    },
    "raw-string-1": {
      "name": "string.quoted.raw.baml",
      "begin": "(?<!#)(#{1})\"",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "\"(#{1})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      }
    },
    "raw-string-2": {
      "name": "string.quoted.raw.baml",
      "begin": "(?<!#)(#{2})\"",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "\"(#{2})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      }
    },
    "raw-string-3": {
      "name": "string.quoted.raw.baml",
      "begin": "(?<!#)(#{3})\"",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "\"(#{3})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      }
    },
    "raw-string-4": {
      "name": "string.quoted.raw.baml",
      "begin": "(?<!#)(#{4})\"",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "\"(#{4})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      }
    },
    "raw-string-5": {
      "name": "string.quoted.raw.baml",
      "begin": "(?<!#)(#{5})\"",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "\"(#{5})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      }
    },
    "raw-string-6": {
      "name": "string.quoted.raw.baml",
      "begin": "(?<!#)(#{6})\"",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "\"(#{6})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      }
    },
    "raw-string-7": {
      "name": "string.quoted.raw.baml",
      "begin": "(?<!#)(#{7})\"",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "\"(#{7})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      }
    },
    "raw-string-8": {
      "name": "string.quoted.raw.baml",
      "begin": "(?<!#)(#{8})\"",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "\"(#{8})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        }
      }
    },
    "retry-policy": {
      "name": "meta.retry-policy.baml",
      "begin": "^\\s*(retry_policy)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b(?=\\s*\\{)",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.retry-policy.baml"
        },
        "2": {
          "name": "entity.name.retry-policy.baml"
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#config-block"
        }
      ]
    },
    "return-statement": {
      "name": "meta.statement.return.baml",
      "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(return)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.flow.return.baml"
        }
      },
      "end": "(?=[;}]|$)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "self-expression-root": {
      "name": "variable.language.self.baml",
      "match": "\\bself\\b"
    },
    "self-parameter": {
      "name": "meta.parameter.baml",
      "begin": "\\b(self)\\b(?=\\s*(?:,|\\)))",
      "beginCaptures": {
        "1": {
          "name": "variable.language.self.baml"
        }
      },
      "end": "(?=\\s*(?:,|\\)))",
      "patterns": [
        {
          "include": "#comments"
        }
      ]
    },
    "semicolon": {
      "name": "punctuation.terminator.statement.baml",
      "match": ";"
    },
    "spawn-expression": {
      "name": "meta.expression.spawn.baml",
      "begin": "\\b(spawn)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.operator.spawn.baml"
        }
      },
      "end": "(?<=\\})|(?=,|;|$)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#spawn-header"
        },
        {
          "include": "#code-block"
        }
      ]
    },
    "spawn-header": {
      "name": "meta.spawn.header.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#spawn-name"
        },
        {
          "include": "#spawn-with-clause"
        }
      ]
    },
    "spawn-name": {
      "name": "meta.spawn.name.baml",
      "begin": "\\G\\s*(?!with\\b)(?=[^\\{\\r\\n])",
      "end": "(?=\\s+with\\b|\\s*\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#condition-expression"
        }
      ]
    },
    "spawn-with-clause": {
      "name": "meta.spawn.modifiers.baml",
      "begin": "\\b(with)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.operator.with.baml"
        }
      },
      "end": "(?=\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#condition-expression"
        },
        {
          "include": "#comma"
        }
      ]
    },
    "string-escape": {
      "patterns": [
        {
          "include": "#string-escape-control"
        },
        {
          "include": "#string-escape-quoted-delimiter"
        },
        {
          "include": "#backtick-string-escape-delimiter"
        },
        {
          "include": "#string-escape-hex"
        },
        {
          "include": "#string-escape-unicode"
        },
        {
          "include": "#string-escape-invalid"
        }
      ]
    },
    "string-escape-control": {
      "name": "constant.character.escape.control.baml",
      "match": "\\\\[ntr0bf]"
    },
    "string-escape-hex": {
      "name": "constant.character.escape.hex.baml",
      "match": "\\\\x[0-7][0-9A-Fa-f]"
    },
    "string-escape-invalid": {
      "name": "invalid.illegal.escape.baml",
      "match": "\\\\(?:x[0-9A-Fa-f]{0,2}|u(?:\\{[^}\"\\\\]*\\}?|[0-9A-Fa-f]{0,3})|.|$)"
    },
    "string-escape-quoted-delimiter": {
      "name": "constant.character.escape.delimiter.baml",
      "match": "\\\\[\"\\\\'/]"
    },
    "string-escape-unicode": {
      "name": "constant.character.escape.unicode.baml",
      "match": "\\\\u(?:[0-9A-Fa-f]{4}|\\{[0-9A-Fa-f](?:_?[0-9A-Fa-f])*\\})"
    },
    "string-literal": {
      "name": "string.quoted.double.baml",
      "begin": "\"",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "\"",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#string-escape"
        }
      ]
    },
    "template-comment": {
      "name": "comment.block.template.baml",
      "begin": "\\{#",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.comment.begin.baml"
        }
      },
      "end": "#\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.comment.end.baml"
        }
      }
    },
    "template-control": {
      "name": "meta.template.control.baml",
      "begin": "\\{%",
      "beginCaptures": {
        "0": {
          "name": "punctuation.section.template.begin.baml"
        }
      },
      "end": "%\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.section.template.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#template-keyword"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "template-interpolation": {
      "name": "meta.template.interpolation.baml",
      "begin": "\\{\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.section.interpolation.begin.baml"
        }
      },
      "end": "\\}\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.section.interpolation.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#template-keyword"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "template-keyword": {
      "name": "keyword.control.template.baml",
      "match": "\\b(?:for|endfor|if|elif|else|endif|in|set|filter|endfilter|macro|endmacro|raw|endraw)\\b"
    },
    "template-quoted-string-body": {
      "name": "string.quoted.double.template.baml",
      "begin": "\"",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "\"",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#template-comment"
        },
        {
          "include": "#template-control"
        },
        {
          "include": "#template-interpolation"
        },
        {
          "include": "#string-escape"
        }
      ]
    },
    "template-raw-string-body-1": {
      "name": "string.quoted.raw.template.baml",
      "begin": "(?<!#)(#{1})(\")",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        },
        "2": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(\")(#{1})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        },
        "2": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#template-comment"
        },
        {
          "include": "#template-control"
        },
        {
          "include": "#template-interpolation"
        }
      ]
    },
    "template-raw-string-body-2": {
      "name": "string.quoted.raw.template.baml",
      "begin": "(?<!#)(#{2})(\")",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        },
        "2": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(\")(#{2})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        },
        "2": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#template-comment"
        },
        {
          "include": "#template-control"
        },
        {
          "include": "#template-interpolation"
        }
      ]
    },
    "template-raw-string-body-3": {
      "name": "string.quoted.raw.template.baml",
      "begin": "(?<!#)(#{3})(\")",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        },
        "2": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(\")(#{3})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        },
        "2": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#template-comment"
        },
        {
          "include": "#template-control"
        },
        {
          "include": "#template-interpolation"
        }
      ]
    },
    "template-raw-string-body-4": {
      "name": "string.quoted.raw.template.baml",
      "begin": "(?<!#)(#{4})(\")",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        },
        "2": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(\")(#{4})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        },
        "2": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#template-comment"
        },
        {
          "include": "#template-control"
        },
        {
          "include": "#template-interpolation"
        }
      ]
    },
    "template-raw-string-body-5": {
      "name": "string.quoted.raw.template.baml",
      "begin": "(?<!#)(#{5})(\")",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        },
        "2": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(\")(#{5})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        },
        "2": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#template-comment"
        },
        {
          "include": "#template-control"
        },
        {
          "include": "#template-interpolation"
        }
      ]
    },
    "template-raw-string-body-6": {
      "name": "string.quoted.raw.template.baml",
      "begin": "(?<!#)(#{6})(\")",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        },
        "2": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(\")(#{6})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        },
        "2": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#template-comment"
        },
        {
          "include": "#template-control"
        },
        {
          "include": "#template-interpolation"
        }
      ]
    },
    "template-raw-string-body-7": {
      "name": "string.quoted.raw.template.baml",
      "begin": "(?<!#)(#{7})(\")",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        },
        "2": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(\")(#{7})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        },
        "2": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#template-comment"
        },
        {
          "include": "#template-control"
        },
        {
          "include": "#template-interpolation"
        }
      ]
    },
    "template-raw-string-body-8": {
      "name": "string.quoted.raw.template.baml",
      "begin": "(?<!#)(#{8})(\")",
      "beginCaptures": {
        "1": {
          "name": "punctuation.definition.string.begin.baml"
        },
        "2": {
          "name": "punctuation.definition.string.begin.baml"
        }
      },
      "end": "(\")(#{8})",
      "endCaptures": {
        "1": {
          "name": "punctuation.definition.string.end.baml"
        },
        "2": {
          "name": "punctuation.definition.string.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#template-comment"
        },
        {
          "include": "#template-control"
        },
        {
          "include": "#template-interpolation"
        }
      ]
    },
    "template-string": {
      "name": "meta.template-string.baml",
      "begin": "^\\s*(template_string)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.template-string.baml"
        }
      },
      "end": "(?:(?<=#)|(?<=\"))(?=\\s*(?:\\r?\\n|$))|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#template-string-name"
        },
        {
          "include": "#function-parameters"
        },
        {
          "include": "#template-string-body"
        }
      ]
    },
    "template-string-body": {
      "patterns": [
        {
          "include": "#template-raw-string-body-8"
        },
        {
          "include": "#template-raw-string-body-7"
        },
        {
          "include": "#template-raw-string-body-6"
        },
        {
          "include": "#template-raw-string-body-5"
        },
        {
          "include": "#template-raw-string-body-4"
        },
        {
          "include": "#template-raw-string-body-3"
        },
        {
          "include": "#template-raw-string-body-2"
        },
        {
          "include": "#template-raw-string-body-1"
        },
        {
          "include": "#template-quoted-string-body"
        }
      ]
    },
    "template-string-name": {
      "name": "entity.name.function.template-string.baml",
      "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
    },
    "test": {
      "name": "meta.test.baml",
      "begin": "^\\s*(test)\\b(?!(?:[^\\S\\r\\n]+\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*[^\\S\\r\\n]*\\{[^\\S\\r\\n]*(?:functions|type_builder)\\b))",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.test.baml"
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#test-header"
        },
        {
          "include": "#code-block"
        }
      ]
    },
    "test-header": {
      "name": "meta.test.header.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#test-with-keyword"
        },
        {
          "include": "#condition-expression"
        }
      ]
    },
    "test-with-keyword": {
      "name": "keyword.operator.with.baml",
      "match": "\\bwith\\b"
    },
    "testset": {
      "name": "meta.testset.baml",
      "begin": "^\\s*(testset)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.testset.baml"
        }
      },
      "end": "(?<=\\})",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#test-header"
        },
        {
          "include": "#testset-body"
        }
      ]
    },
    "testset-body": {
      "name": "meta.testset.body.baml",
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.block.begin.baml"
        }
      },
      "end": "\\}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.block.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#block-contents"
        }
      ]
    },
    "throw-expression": {
      "name": "keyword.control.flow.throw.baml",
      "match": "\\bthrow\\b"
    },
    "type-alias": {
      "name": "meta.type-alias.baml",
      "begin": "^\\s*(type)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(=)",
      "beginCaptures": {
        "1": {
          "name": "keyword.declaration.type-alias.baml"
        },
        "2": {
          "name": "entity.name.type.alias.baml"
        },
        "3": {
          "name": "keyword.operator.assignment.baml"
        }
      },
      "end": "(?<=;)|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        },
        {
          "include": "#semicolon"
        }
      ]
    },
    "type-arrow-operator": {
      "name": "keyword.operator.arrow.baml",
      "match": "->"
    },
    "type-as-operator": {
      "name": "keyword.operator.as.baml",
      "match": "\\bas\\b"
    },
    "type-expression": {
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#primitive-type"
        },
        {
          "include": "#type-literal"
        },
        {
          "include": "#type-arrow-operator"
        },
        {
          "include": "#type-throws-operator"
        },
        {
          "include": "#associated-type-projection"
        },
        {
          "include": "#type-reference"
        },
        {
          "include": "#bare-attribute"
        },
        {
          "include": "#attribute"
        },
        {
          "include": "#type-as-operator"
        },
        {
          "include": "#assignment-operator"
        },
        {
          "include": "#optional-operator"
        },
        {
          "include": "#union-operator"
        },
        {
          "include": "#type-punctuation"
        },
        {
          "include": "#colon-separator"
        }
      ]
    },
    "type-fragment": {
      "name": "meta.type-fragment.baml",
      "begin": "^\\s*(?=\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)(?=[^:=;{}()#\"'\\r\\n]*$)(?=[^<.\\[?|\\r\\n]*[<.\\[?|]|(?:(?:int|float|bigint|string|bool|image|audio|map|json|unknown|never|Self))\\s*$)",
      "end": "$",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "type-literal": {
      "patterns": [
        {
          "include": "#boolean-literal"
        },
        {
          "include": "#null-literal"
        },
        {
          "include": "#numeric-literal"
        },
        {
          "include": "#string-literal"
        },
        {
          "include": "#raw-string"
        },
        {
          "include": "#backtick-string"
        }
      ]
    },
    "type-punctuation": {
      "name": "punctuation.definition.type.baml",
      "match": "[\\[\\]<>,()]"
    },
    "type-reference": {
      "name": "meta.type-reference.baml",
      "match": "\\b(?:(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(\\.)\\s*)?((?:\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\s*\\.\\s*)*)(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
      "captures": {
        "1": {
          "patterns": [
            {
              "include": "#namespace-root"
            },
            {
              "include": "#namespace-segment"
            }
          ]
        },
        "2": {
          "name": "punctuation.accessor.baml"
        },
        "3": {
          "patterns": [
            {
              "include": "#namespace-segment"
            },
            {
              "include": "#accessor-dot"
            }
          ]
        },
        "4": {
          "name": "entity.name.type.baml"
        }
      }
    },
    "type-throws-operator": {
      "name": "keyword.operator.throws.baml",
      "match": "\\bthrows\\b"
    },
    "typed-binding-pattern": {
      "name": "meta.pattern.binding.baml",
      "match": "\\b((?:let|const))\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b\\s*(:)",
      "captures": {
        "1": {
          "name": "keyword.declaration.binding.baml"
        },
        "2": {
          "name": "variable.other.binding.baml"
        },
        "3": {
          "name": "punctuation.separator.colon.baml"
        }
      }
    },
    "union-operator": {
      "name": "keyword.operator.type.baml",
      "match": "\\|"
    },
    "upcast-expression": {
      "name": "meta.expression.upcast.baml",
      "begin": "(\\.)\\s*(as)\\b(?=\\s*<)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.accessor.baml"
        },
        "2": {
          "name": "keyword.operator.as.baml"
        }
      },
      "end": "(?<=>)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#upcast-type-arguments"
        }
      ]
    },
    "upcast-type-arguments": {
      "name": "meta.type-arguments.baml",
      "begin": "<",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.type-arguments.begin.baml"
        }
      },
      "end": ">",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.type-arguments.end.baml"
        }
      },
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#type-expression"
        }
      ]
    },
    "watch-statement": {
      "name": "meta.statement.watch.baml",
      "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(watch)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.watch.baml"
        }
      },
      "end": "(?=[;}]|$)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#watch-statement-pattern"
        },
        {
          "include": "#assignment-operator"
        },
        {
          "include": "#expression"
        }
      ]
    },
    "watch-statement-pattern": {
      "name": "meta.pattern.watch.baml",
      "begin": "\\G\\s*(?=(?:let|const)\\b)",
      "end": "(?=\\s*=)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#pattern"
        }
      ]
    },
    "while-condition": {
      "name": "meta.while.condition.baml",
      "begin": "\\G\\s*",
      "end": "(?=\\{)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#condition-expression"
        }
      ]
    },
    "while-let-pattern": {
      "name": "meta.pattern.while-let.baml",
      "begin": "\\G\\s*(?=(?:let|const)\\b)",
      "end": "(?=\\s*=)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#pattern"
        }
      ]
    },
    "while-statement": {
      "name": "meta.statement.while.baml",
      "begin": "\\b(while)\\b",
      "beginCaptures": {
        "1": {
          "name": "keyword.control.loop.while.baml"
        }
      },
      "end": "(?<=\\})(?=\\s*(?:;|$))|(?=;|$)",
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#while-let-pattern"
        },
        {
          "include": "#assignment-operator"
        },
        {
          "include": "#while-condition"
        },
        {
          "include": "#code-block"
        }
      ]
    },
    "wildcard-binding-pattern": {
      "name": "meta.pattern.wildcard.baml",
      "match": "\\b((?:let|const))\\s+(_)\\b",
      "captures": {
        "1": {
          "name": "keyword.declaration.binding.baml"
        },
        "2": {
          "name": "variable.language.wildcard.baml"
        }
      }
    },
    "wildcard-pattern": {
      "name": "variable.language.wildcard.baml",
      "match": "\\b_\\b"
    }
  }
}