{ "name": "SyON", "scopeName": "source.sy", "patterns": [ { "include": "#blockInnards" } ], "repository": { "array": { "name": "meta.array.sy", "begin": "\\[", "end": "\\]", "patterns": [ { "include": "#main" }, { "name": "string.unquoted.sy", "match": "(?:[^,\\[\\]{}\u003c\u003e\"'`\\s:]|:(?=\\S))+" } ], "beginCaptures": { "0": { "name": "punctuation.definition.array.begin.bracket.square.sy" } }, "endCaptures": { "0": { "name": "punctuation.definition.array.end.bracket.square.sy" } } }, "block": { "patterns": [ { "name": "meta.block.tagged.sy", "begin": "((?:[^{}\\[\\]:\\s,]|[:#](?=\\S))(?:[^:{}]|:(?=\\S)|\\\\[{:])*?)({)", "end": "}", "patterns": [ { "include": "#blockInnards" } ], "beginCaptures": { "1": { "name": "entity.name.block.tag.label.sy" }, "2": { "name": "punctuation.section.scope.block.begin.bracket.curly.sy" } }, "endCaptures": { "0": { "name": "punctuation.section.scope.block.end.bracket.curly.sy" } } }, { "name": "meta.block.sy", "begin": "{", "end": "}", "patterns": [ { "include": "#blockInnards" } ], "beginCaptures": { "0": { "name": "punctuation.section.scope.block.begin.bracket.curly.sy" } }, "endCaptures": { "0": { "name": "punctuation.section.scope.block.end.bracket.curly.sy" } } } ] }, "blockInnards": { "patterns": [ { "include": "#fieldQuotedEarly" }, { "include": "#main" }, { "match": "((?:[^{}\\[\\]:\\s,]|[:#](?=\\S))(?:[^:{}]|:(?=\\S)|\\\\[{:])*?)", "captures": { "1": { "name": "entity.name.tag.property.sy" } } } ] }, "boolean": { "patterns": [ { "name": "constant.language.boolean.true.sy", "match": "(?x)\n(?:^|(?\u003c=[\\s\\[{,]))\n(?:true|yes|on|TRUE|YES|ON)\n(?=$|[\\s\\]},])" }, { "name": "constant.language.boolean.false.sy", "match": "(?x)\n(?:^|(?\u003c=[\\s\\[{,]))\n(?:false|no|off|TRUE|YES|ON)\n(?=$|[\\s\\]},])" } ] }, "brackets": { "name": "meta.expression.sy", "begin": "\\(", "end": "\\)", "patterns": [ { "include": "#operator" }, { "include": "#main" } ], "beginCaptures": { "0": { "name": "punctuation.section.scope.block.begin.bracket.round.sy" } }, "endCaptures": { "0": { "name": "punctuation.section.scope.block.end.bracket.round.sy" } } }, "bytestream": { "patterns": [ { "name": "meta.bytestream.base64.sy", "begin": "(\u003c)(base64)(:)", "end": "(\u003e)\\s*([^:,}\\]]+)", "patterns": [ { "name": "constant.character.encoded.base64.sy", "match": "[A-Za-z0-9+/=]+" }, { "include": "#comment" }, { "name": "invalid.illegal.character.sy", "match": "[^\\s\u003e]+" } ], "beginCaptures": { "1": { "name": "punctuation.section.bytestream.begin.bracket.angle.sy" }, "2": { "name": "storage.modifier.encoding.base64.sy" }, "3": { "name": "punctuation.separator.key-value.sy" } }, "endCaptures": { "1": { "name": "punctuation.section.bytestream.end.bracket.angle.sy" }, "2": { "name": "invalid.illegal.characters.sy" } } }, { "name": "meta.bytestream.base85.sy", "begin": "\u003c~", "end": "~\u003e", "patterns": [ { "name": "constant.character.encoded.base85.sy", "match": "[!-uz]+" }, { "name": "invalid.illegal.character.sy", "match": "[^!-uz\\s~]" } ], "beginCaptures": { "0": { "name": "punctuation.section.bytestream.begin.bracket.angle.sy" } }, "endCaptures": { "0": { "name": "punctuation.section.bytestream.end.bracket.angle.sy" } } }, { "name": "meta.bytestream.sy", "begin": "\u003c", "end": "(\u003e)\\s*([^:,}\\]]+)", "patterns": [ { "name": "constant.numeric.integer.int.hexadecimal.hex.sy", "match": "[A-Fa-f0-9]+" }, { "include": "#comment" }, { "name": "invalid.illegal.character.sy", "match": "[^\\s\u003e]+" } ], "beginCaptures": { "0": { "name": "punctuation.section.bytestream.begin.bracket.angle.sy" } }, "endCaptures": { "1": { "name": "punctuation.section.bytestream.end.bracket.angle.sy" }, "2": { "name": "invalid.illegal.characters.sy" } } } ] }, "comma": { "name": "punctuation.separator.delimiter.comma.sy", "match": "," }, "comment": { "patterns": [ { "name": "comment.block.sy", "begin": "(?:^|(?\u003c=\\s|\\xC2\\xAD|\\xAD))(#{3,})(?=\\s|$)", "end": "\\1", "beginCaptures": { "1": { "name": "punctuation.definition.comment.begin.sy" } }, "endCaptures": { "0": { "name": "punctuation.definition.comment.end.sy" } } }, { "name": "comment.line.number-sign.sy", "begin": "(?:^|(?\u003c=\\s|\\xC2\\xAD|\\xAD))#(?=\\s|$)", "end": "$", "beginCaptures": { "0": { "name": "punctuation.definition.comment.sy" } } } ] }, "date": { "name": "constant.other.date.sy", "match": "(?x)\n# Date\n[0-9]{4} - # Year\n[0-9]{2} - # Month\n[0-9]{2} # Day\n\n# Time\n(?:\n\t(?:T|\\s+)\n\t[0-9]{1,2} : # Hours\n\t[0-9]{1,2} : # Minutes\n\t[0-9]{1,2} # Seconds\n\t(?:\\.[0-9]+)? # Milliseconds\n\t(\\+[0-9]{4}|Z)? # Timezone\n)?\n\n# Followed by delimiter, EOL, or comment\n(?= \\s* (?:$|[,\\]}])\n| \\s+ \\#(?:$|\\s)\n)" }, "escape": { "patterns": [ { "name": "constant.character.escape.newline.sy", "begin": "\\\\$\\s*", "end": "^", "beginCaptures": { "0": { "name": "punctuation.backslash.definition.escape.sy" } } }, { "name": "constant.character.escape.unicode.sy", "match": "(\\\\)x[A-Fa-f0-9]{2}", "captures": { "1": { "name": "punctuation.backslash.definition.escape.sy" } } }, { "name": "constant.character.escape.unicode.sy", "match": "(\\\\)u[A-Fa-f0-9]{4}", "captures": { "1": { "name": "punctuation.backslash.definition.escape.sy" } } }, { "name": "constant.character.escape.unicode.sy", "match": "(\\\\)u({)[A-Fa-f0-9]+(})", "captures": { "1": { "name": "punctuation.backslash.definition.escape.sy" }, "2": { "name": "punctuation.definition.unicode-escape.begin.bracket.curly.sy" }, "3": { "name": "punctuation.definition.unicode-escape.end.bracket.curly.sy" } } }, { "name": "invalid.illegal.unicode-escape.sy", "match": "\\\\u{[^}\"]*}" }, { "name": "invalid.illegal.unicode-escape.sy", "match": "\\\\u(?![A-Fa-f0-9]{4})[^\"]*" }, { "name": "constant.character.escape.sy", "match": "(\\\\).", "captures": { "0": { "name": "punctuation.backslash.definition.escape.sy" } } } ] }, "escapeVerbatim": { "name": "constant.character.escape.backtick.sy", "match": "(\\\\)`", "captures": { "1": { "name": "punctuation.backslash.definition.escape.sy" } } }, "expression": { "name": "meta.expression.sy", "match": "(?x)\n\\G\n(\n\t(?:\\s*\\()*\n\t\\s*\n\t~? [-+]? ~?\n\t\\d\n\t[-+*/%~^\u0026|\\(\\)eE\\s.oOxXbB\\d]*\n)\n(?=\n\t\\s*\n\t(?: $\n\t| ,\n\t| \\]\n\t| \\}\n\t| (?\u003c=\\s)\\#(?=\\s|$)\n\t)\n)", "captures": { "1": { "patterns": [ { "include": "#brackets" }, { "include": "#number" }, { "include": "#operator" } ] } } }, "field": { "name": "meta.field.sy", "begin": "(?x)\n(?:\n\t# Quoted property name\n\t(?\u003c=[:{\\[]) \\s*\n\t(?: (\"(?:[^\"\\\\]|\\\\.)*\")\n\t| ('(?:[^'\\\\]|\\\\.)*')\n\t| (`(?:[^`\\\\]|\\\\.)*`)\n\t) \\s* (:)\n\t\n\t|\n\t\n\t# Unquoted property name\n\t([^{}\\[\\]\u003c\u003e\\s][^,]*?)\n\t(?\u003c!\\\\) (:)\n\t\n\t|\n\t\n\t# Presumably one following a multiline string\n\t(?\u003c=[\"'`]) \\s* (:)\n)\n(?=\\s|$)\n\\s*", "end": "(?=\\s*})|^(?!\\G)", "patterns": [ { "include": "#fieldInnards" } ], "beginCaptures": { "1": { "name": "entity.name.tag.property.quoted.double.sy", "patterns": [ { "include": "#escape" } ] }, "2": { "name": "entity.name.tag.property.quoted.single.sy", "patterns": [ { "include": "#escape" } ] }, "3": { "name": "entity.name.tag.property.quoted.backtick.sy", "patterns": [ { "include": "#escapeVerbatim" } ] }, "4": { "name": "punctuation.separator.key-value.sy" }, "5": { "name": "entity.name.tag.property.sy", "patterns": [ { "include": "#escape" } ] }, "6": { "name": "punctuation.separator.key-value.sy" }, "7": { "name": "punctuation.separator.key-value.sy" } } }, "fieldInnards": { "patterns": [ { "include": "#date" }, { "include": "#expression" }, { "include": "#main" }, { "name": "string.unquoted.sy", "match": "(?x) \\G\n(?! ~?[-+]?[0-9]\n| (?\u003c=\\s)\\#(?=\\s|$)\n)\n[^\\s{}\\[\\]\u003c:\"'`]\n\n(?: [^\\#,}\\]:]\n| (?\u003c=\\S) [\\#:]\n| [:\\#] (?=\\S)\n)*\n(?!\n\t\\s*\n\t(?:[\\{:])\n)", "captures": { "0": { "patterns": [ { "include": "#url" } ] } } } ] }, "fieldQuotedEarly": { "name": "meta.field.sy", "begin": "(?x) ^ \\s*\n(?: (\"(?:[^\"\\\\]|\\\\.)*\")\n| ('(?:[^'\\\\]|\\\\.)*')\n| (`(?:[^`\\\\]|\\\\.)*`)\n) \\s* (:)\n(?=\\s|$)\n\\s*", "end": "(?=\\s*})|^(?!\\G)", "patterns": [ { "include": "#fieldInnards" } ], "beginCaptures": { "1": { "name": "entity.name.tag.property.quoted.double.sy", "patterns": [ { "include": "#escape" } ] }, "2": { "name": "entity.name.tag.property.quoted.single.sy", "patterns": [ { "include": "#escape" } ] }, "3": { "name": "entity.name.tag.property.quoted.backtick.sy", "patterns": [ { "include": "#escapeVerbatim" } ] }, "4": { "name": "punctuation.separator.key-value.sy" } } }, "main": { "patterns": [ { "include": "#comment" }, { "include": "#regexp" }, { "include": "#fieldQuotedEarly" }, { "include": "#string" }, { "include": "#stringJunk" }, { "include": "#block" }, { "include": "#field" }, { "include": "#array" }, { "include": "#bytestream" }, { "include": "#brackets" }, { "include": "#boolean" }, { "include": "#null" }, { "include": "#date" }, { "include": "#number" }, { "include": "#comma" }, { "include": "#operator" } ] }, "null": { "name": "constant.language.null.sy", "match": "(?x)\n(?:^|(?\u003c=[\\s\\[{,]))\n(?:null|NULL)\n(?=$|[\\s\\]},])" }, "number": { "match": "(?x)\n(?:^|(?\u003c=[\\s\\[\\({,~]))\n(?: ([-+]?0[xX][A-Fa-f0-9]+) # Hexadecimal\n| ([-+]?0[oO][0-7]+) # Octal\n| ([-+]?0[bB][0-1]+) # Binary\n| ([-+]?[0-9]+\\.(?:[0-9]*[eE][+-]?[0-9]+|[0-9]+)) # Float\n| ([-+]?[0-9]+(?:[eE][+-]?[0-9]+)?) # Integer\n)\n\\s*\n(?= $\n| [-+*/%^\u0026|\\)\u003c\u003e\\s\\]},]\n| (?\u003c=\\s)\\#(?=\\s|$)\n)", "captures": { "1": { "name": "constant.numeric.integer.int.hexadecimal.hex.sy" }, "2": { "name": "constant.numeric.integer.int.octal.oct.sy" }, "3": { "name": "constant.numeric.integer.int.binary.bin.sy" }, "4": { "name": "constant.numeric.float.decimal.dec.sy" }, "5": { "name": "constant.numeric.integer.int.decimal.dec.sy" } } }, "operator": { "patterns": [ { "name": "keyword.operator.arithmetic.sy", "match": "\\*\\*|[-+*/%]" }, { "name": "keyword.operator.bitwise.sy", "match": "(\u003c\u003c|\u003e\u003e|\u003e\u003e\u003e|[~\u0026|^])" } ] }, "regexp": { "patterns": [ { "name": "string.regexp.multiline.sy", "begin": "(/{3,})", "end": "(\\1)([A-Za-z]*)", "patterns": [ { "include": "source.regexp#main" } ], "beginCaptures": { "1": { "patterns": [ { "name": "punctuation.definition.string.begin.triple-slash.sy", "match": "^/{3}$" }, { "name": "punctuation.definition.string.begin.sy", "match": ".+" } ] } }, "endCaptures": { "1": { "patterns": [ { "name": "punctuation.definition.string.end.triple-slash.sy", "match": "^/{3}$" }, { "name": "punctuation.definition.string.end.sy", "match": ".+" } ] }, "2": { "patterns": [ { "include": "source.regexp#scopedModifiers" } ] } } }, { "name": "string.regexp.sy", "begin": "(/)", "end": "(/)([A-Za-z]*)", "patterns": [ { "include": "source.regexp#main" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.sy" } }, "endCaptures": { "1": { "name": "punctuation.definition.string.end.sy" }, "2": { "patterns": [ { "include": "source.regexp#scopedModifiers" } ] } } } ] }, "string": { "patterns": [ { "name": "string.quoted.double.heredoc.sy", "begin": "(\"{3,})", "end": "\\1", "patterns": [ { "include": "#stringInnards" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.sy" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.sy" } } }, { "name": "string.quoted.single.heredoc.sy", "begin": "('{3,})", "end": "\\1", "patterns": [ { "include": "#stringInnards" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.sy" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.sy" } } }, { "name": "string.quoted.verbatim.backtick.heredoc.sy", "begin": "(`{3,})", "end": "\\1", "patterns": [ { "name": "constant.character.escape.heredoc.sy", "match": "(\\\\)```", "captures": { "1": { "name": "punctuation.backslash.definition.escape.sy" } } } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.sy" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.sy" } } }, { "name": "string.quoted.double.sy", "begin": "\"", "end": "\"", "patterns": [ { "include": "#stringInnards" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.sy" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.sy" } } }, { "name": "string.quoted.single.sy", "begin": "'", "end": "'", "patterns": [ { "include": "#stringInnards" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.sy" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.sy" } } }, { "name": "string.quoted.verbatim.backtick.sy", "begin": "`", "end": "`", "patterns": [ { "include": "#escapeVerbatim" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.sy" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.sy" } } } ] }, "stringInnards": { "patterns": [ { "include": "#url" }, { "include": "#escape" } ] }, "stringJunk": { "name": "invalid.illegal.syntax.sy", "begin": "(?\u003c=[\"'`])(?!\\s*$)(?=\\s*[^:,}\\]])", "end": "(?=[:,}\\]])" }, "url": { "patterns": [ { "name": "constant.other.reference.link.underline.sy", "match": "(?x) \\b\n# Protocol\n( https?\n| s?ftp\n| ftps\n| file\n| wss?\n| smb\n| git (?:\\+https?)\n| ssh\n| rsync\n| afp\n| nfs\n| (?:x-)?man(?:-page)?\n| gopher\n| txmt\n| issue\n| atom\n) ://\n\n# Path specifier\n(?:\n\t(?! \\#\\w*\\#)\n\t(?: [-:\\@\\w.,~%+_/?=\u0026\\#;|!])\n)+\n\n# Don't include trailing punctuation\n(?\u003c![-.,?:\\#;])" }, { "name": "markup.underline.link.mailto.sy", "match": "(?x) \\b\nmailto: (?:\n\t(?! \\#\\w*\\#)\n\t(?: [-:@\\w.,~%+_/?=\u0026\\#;|!])\n)+\n(?\u003c![-.,?:\\#;])" } ] } } }