# [PackageDev] target_format: plist, ext: tmLanguage --- name: TOML scopeName: source.toml fileTypes: [toml,tml] uuid: ffffeb76-439f-4c5e-b60f-d8a13606d63d patterns: - include: '#comments' - include: '#tables' - include: '#keys' - include: '#illegal' repository: comments: match: \s*((#).*)$ captures: '1': {name: comment.line.number-sign.toml} '2': {name: punctuation.definition.comment.toml} comment: Comments tables: patterns: - name: invalid.illegal.table.array.toml begin: ^\s*(\[\[\]\]|\[\[\..*\]\]|\[\[.*\.\]\]|\[\[.*\.\..*\]\]|\[\[.*[\[\]#].*\]\]|\[\[.*\]\].+\n) end: (?=^\s*\[?\[.*\]\]?) comment: "non-empty etc. like tables, see below!" - name: meta.tag.table.array.toml begin: ^\s*(\[\[)([A-Za-z_\-][A-Za-z0-9_\-\.]*)(\]\])\s* beginCaptures: '1': {name: punctuation.definition.table.array.toml} '2': {name: entity.other.attribute-name.table.array.toml} '3': {name: punctuation.definition.table.array.toml} end: (?=^\s*\[?\[[A-Za-z_\-][A-Za-z0-9_\-\.]*\]\]?) comment: A named TOML-Table-Array patterns: - include: '#comments' - include: '#keys' - include: '#illegal' - name: invalid.illegal.table.toml begin: ^\s*(\[\]|\[\..*\]|\[.*\.\]|\[.*\.\..*\]|\[.*[\[\]#].*\]|\[.*\].+\n) end: (?=^\s*\[?\[.*\]\]?) comment: "Each table name segment must be non-empty, must not contain the characters '[', ']' or '#' and is delimited by a '.'. Tables \"appear in square brackets *on a line by themselves*\"" - name: meta.tag.table.toml begin: ^\s*(\[)([A-Za-z_\-][A-Za-z0-9_\-\.]*)(\])\s* beginCaptures: '1': {name: punctuation.definition.table.toml} '2': {name: entity.other.attribute-name.table.toml} '3': {name: punctuation.definition.table.toml} end: (?=^\s*\[?\[[A-Za-z_\-][A-Za-z0-9_\-\.]*\]\]?) comment: A named TOML-Table patterns: - include: '#comments' - include: '#keys' - include: '#illegal' keys: patterns: - name: invalid.illegal.noKeyDefined.toml match: (\s*=.*)$ comment: Assignments without key are invalid - name: invalid.deprecated.noValueGiven.toml match: (\s*[A-Za-z_\-][A-Za-z0-9_\-]*\s*=)(?=\s*$) comment: Assignments without value are unusual - begin: \s*([A-Za-z_-][A-Za-z0-9_-]*|".+"|'.+'|[0-9]+)\s*(=)\s* end: ($|(?==)|\,|\s*(?=\})) beginCaptures: '1': {name: keyword.key.toml} '2': {name: punctuation.definition.keyValuePair.toml} patterns: - include: '#comments' - include: '#dataTypes' - include: '#illegal' comment: Key-value-pairs dataTypes: patterns: - include: '#inlinetable' - include: '#array' - include: '#string' - include: '#dateTime' - include: '#float' - include: '#integer' - include: '#boolean' string: patterns: - name: string.quoted.triple.literal.block.toml begin: "'''" end: "'''" comment: literal string block (no escape sequences) - name: string.quoted.single.literal.line.toml match: "'.*?'" comment: literal string line (no escape sequences) - name: string.quoted.triple.basic.block.toml begin: '"""' patterns: - name: string.quoted.triple.basic.block.toml match: '[^"\\]*(?:\\.?[^"\\]*)*' end: '"""' comment: basic string block - name: string.quoted.single.basic.line.toml match: '"[^"\\]*(?:\\.[^"\\]*)*"' comment: basic string line dateTime: match: (? everything unmatched ...