{
  "name": "FIGlet Font",
  "scopeName": "source.figfont",
  "patterns": [
    {
      "include": "#main"
    }
  ],
  "repository": {
    "codeTag": {
      "name": "meta.code-tag.figfont",
      "match": "(?x) ^(?!.+[@#]$)\n( (-(?:0[Xx])?0*1)(?=\\s|$)        # Invalid -1\n| (\\+?(?:[1-9][0-9]*|0(?=\\s|$))) # Decimal\n| (\\+?0[0-7]+)                    # Octal\n| (\\+?0[Xx][0-9A-Fa-f]+)          # Hex\n)\n(?:\\s+(\\S.*))?\n(?=\\s*$)",
      "captures": {
        "1": {
          "name": "meta.codepoint.figfont"
        },
        "2": {
          "name": "invalid.illegal.reserved-codepoint.figfont"
        },
        "3": {
          "name": "constant.numeric.decimal.integer.int.figfont"
        },
        "4": {
          "name": "constant.numeric.octal.integer.int.figfont"
        },
        "5": {
          "name": "constant.numeric.hexadecimal.hex.integer.int.figfont"
        },
        "6": {
          "name": "string.unquoted.description.figfont"
        }
      }
    },
    "codeTagTable": {
      "name": "meta.translation-table.figfont",
      "contentName": "string.interpolated.code-tag.figfont",
      "begin": "(?x) ^(?!.+[@#]$)\n( (-(?:[1-9][0-9]*|0(?=\\s|$))) # Decimal\n| (-0[0-7]+)                    # Octal\n| (-0[Xx][0-9A-Fa-f]+)          # Hex\n)\n(?:\\s+(\\S.*))?\n\\s*$\\n?",
      "end": "(?\u003c=@@|##)[ \\t]*$",
      "patterns": [
        {
          "include": "#endmarks"
        }
      ],
      "beginCaptures": {
        "0": {
          "name": "meta.code-tag.figfont"
        },
        "1": {
          "name": "meta.negative.codepoint.figfont"
        },
        "2": {
          "name": "constant.numeric.decimal.integer.int.figfont"
        },
        "3": {
          "name": "constant.numeric.octal.integer.int.figfont"
        },
        "4": {
          "name": "constant.numeric.hexadecimal.hex.integer.int.figfont"
        },
        "5": {
          "name": "string.unquoted.description.figfont"
        }
      }
    },
    "endmarks": {
      "name": "keyword.operator.endmark.character.figfont",
      "match": "(?:@+|#+)[ \\t]*$"
    },
    "fontData": {
      "name": "constant.character.sub-character.figfont",
      "match": "[^#@\\s]+|#+(?!#*[ \\t]*$)|@+(?!@*[ \\t]*$)"
    },
    "integer": {
      "name": "constant.numeric.decimal.integer.int.figfont",
      "match": "[-+]?[0-9]+"
    },
    "main": {
      "patterns": [
        {
          "include": "#prologue"
        },
        {
          "include": "#codeTag"
        },
        {
          "include": "#codeTagTable"
        },
        {
          "include": "#fontData"
        },
        {
          "include": "#endmarks"
        }
      ]
    },
    "prologue": {
      "name": "meta.prologue.figfont",
      "contentName": "comment.block.freeform.figfont",
      "begin": "^([ft]lf2a)(\\S|\\x7F)(\\s+.+)?\\s*$",
      "end": "^\\s*(?=\\2(?!.*(?i:hard\\W?blank))|.{0,6}[#@]\\s*$)",
      "beginCaptures": {
        "0": {
          "name": "meta.header-line.figfont"
        },
        "1": {
          "name": "keyword.control.file.signature.figfont"
        },
        "2": {
          "name": "variable.parameter.hardblank.figfont"
        },
        "3": {
          "patterns": [
            {
              "include": "#integer"
            }
          ]
        }
      }
    }
  }
}