{
  "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
  "name": "Zelyra",
  "scopeName": "source.zyl",
  "fileTypes": [
    "zyl"
  ],
  "patterns": [
    {
      "include": "#comments"
    },
    {
      "include": "#strings"
    },
    {
      "include": "#keywords"
    },
    {
      "include": "#types"
    },
    {
      "include": "#decorators"
    },
    {
      "include": "#functions"
    },
    {
      "include": "#numbers"
    },
    {
      "include": "#operators"
    },
    {
      "include": "#html_tags"
    }
  ],
  "repository": {
    "comments": {
      "patterns": [
        {
          "name": "comment.block.zyl",
          "begin": "^\\s*##\\s*$",
          "end": "^\\s*##\\s*$"
        },
        {
          "name": "comment.line.number-sign.zyl",
          "match": "#.*$"
        },
        {
          "name": "comment.line.double-slash.zyl",
          "match": "//.*$"
        }
      ]
    },
    "strings": {
      "patterns": [
        {
          "name": "string.quoted.double.zyl",
          "begin": "\"",
          "end": "\"",
          "patterns": [
            {
              "name": "constant.character.escape.zyl",
              "match": "\\\\."
            }
          ]
        }
      ]
    },
    "keywords": {
      "patterns": [
        {
          "name": "keyword.control.zyl",
          "match": "\\b(action|admin_path|admin_permission|admin_role|api|appearance|audit|audit_chain|auth|auto|await|break|columns|component|confirm|confirm_page|continue|crud|database|default|deprecated|detail|else|engine|ensures|enum|error_page|errors|false|field|fields|filter|fn|for|form|handler|html|icon|if|import|in|index|input|invariant|label|layout|list|login_block_seconds|login_rate_limit|loop|match|max|mutable|output|page|paginated|parallel|permissions|permits|placeholder|postgres|primary|props|pub|rate_limit|readonly|redirect|required|requires|reset_block_seconds|reset_rate_limit|reset_tokens|return|role_permissions|roles|search|searchable|sessions|soft_delete|sort|sortable|source|sql|struct|success|success_page|table|tableview|title|transaction|true|type|unique|uses|version|view|while|widget)\\b"
        }
      ]
    },
    "types": {
      "patterns": [
        {
          "name": "entity.name.type.builtin.zyl",
          "match": "\\b(Int|UInt|Float|Decimal|Bool|String|Char|Bytes|Timestamp|Date|Time|Duration|Unit|Option|Result|Array|Tuple|Set|Map|HttpResult)\\b"
        },
        {
          "name": "entity.name.type.custom.zyl",
          "match": "\\b[A-Z][a-zA-Z0-9_]*\\b"
        }
      ]
    },
    "decorators": {
      "patterns": [
        {
          "name": "entity.other.attribute-name.decorator.zyl",
          "match": "@[a-zA-Z_][a-zA-Z0-9_]*"
        }
      ]
    },
    "functions": {
      "patterns": [
        {
          "match": "\\b(fn)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
          "captures": {
            "1": {
              "name": "keyword.declaration.zyl"
            },
            "2": {
              "name": "entity.name.function.definition.zyl"
            }
          }
        },
        {
          "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(",
          "captures": {
            "1": {
              "name": "entity.name.function.call.zyl"
            }
          }
        }
      ]
    },
    "numbers": {
      "patterns": [
        {
          "name": "constant.numeric.float.zyl",
          "match": "\\b[0-9]+\\.[0-9]+([eE][+-]?[0-9]+)?\\b"
        },
        {
          "name": "constant.numeric.integer.zyl",
          "match": "\\b[0-9]+\\b"
        }
      ]
    },
    "operators": {
      "patterns": [
        {
          "name": "keyword.operator.pipeline.zyl",
          "match": "\\|>|\\.\\.|\\|"
        },
        {
          "name": "keyword.operator.arrow.zyl",
          "match": "->|=>"
        },
        {
          "name": "keyword.operator.comparison.zyl",
          "match": "==|!=|<=|>=|<|>"
        },
        {
          "name": "keyword.operator.logical.zyl",
          "match": "&&|\\|\\||!"
        },
        {
          "name": "keyword.operator.arithmetic.zyl",
          "match": "\\+|-|\\*|/|%"
        },
        {
          "name": "keyword.operator.assignment.zyl",
          "match": "="
        }
      ]
    },
    "html_tags": {
      "patterns": [
        {
          "name": "meta.tag.zyl",
          "match": "<(/?)([a-zA-Z0-9-]+)([^>]*)>",
          "captures": {
            "1": {
              "name": "punctuation.definition.tag.zyl"
            },
            "2": {
              "name": "entity.name.tag.html.zyl"
            },
            "3": {
              "name": "meta.tag.attributes.zyl"
            }
          }
        }
      ]
    }
  }
}
