{ "name": "Roff (Device Description)", "scopeName": "source.ditroff.desc", "patterns": [ { "begin": "(?=^\\s*(?:fonts|res|hor|vert|unitwidth|biggestfont)(?:\\s|$))", "end": "(?=A)B", "patterns": [ { "name": "meta.charset.ditroff.desc", "begin": "^(charset)\\s*$", "end": "(?=A)B", "patterns": [ { "include": "#comment" }, { "name": "entity.name.glyph.ditroff.desc", "match": "\\S+" } ], "beginCaptures": { "1": { "name": "keyword.control.section.ditroff.desc" } } }, { "include": "#main" } ] }, { "include": "#main" } ], "repository": { "charset": { "name": "meta.charset.ditroff.desc", "begin": "^(charset)\\s*$", "end": "^(?=kernpairs|\\s*$)", "patterns": [ { "name": "meta.glyph.ditroff.desc", "match": "(?x) ^\n\\s* ((---)|\\S+) # Name\n\\s+ ([-\\d]+(?:,[-\\d]+){0,5}) # Metrics\n\\s+ (\\d) # Glyph type\n\\s+ (0[Xx][0-9A-Fa-f]+|\\d+) # Code\n(?:\\s+(?!--)(\\S+))? # Entity name", "captures": { "1": { "name": "entity.name.glyph.ditroff.desc" }, "2": { "name": "punctuation.definition.unnamed.glyph.ditroff.desc" }, "3": { "patterns": [ { "name": "constant.numeric.integer.ditroff.desc", "match": "-?\\d+" }, { "name": "punctuation.delimiter.comma.ditroff.desc", "match": "," } ] }, "4": { "name": "constant.numeric.integer.ditroff.desc" }, "5": { "name": "constant.numeric.integer.ditroff.desc" }, "6": { "name": "variable.other.ditroff.desc" } } }, { "name": "meta.glyph.alias.ditroff.desc", "match": "^\\s*(\\S+)\\s+(\")(?=\\s|$)", "captures": { "1": { "name": "entity.type.var.ditroff.desc" }, "2": { "name": "keyword.operator.ditroff.desc" } } }, { "name": "comment.line.double-dash.ditroff.desc", "begin": "(?\u003c=\\s)--(?!-)", "end": "(?=$)", "beginCaptures": { "0": { "name": "punctuation.definition.comment.ditroff.desc" } } }, { "include": "#comment" } ], "beginCaptures": { "1": { "name": "keyword.control.section.ditroff.desc" } } }, "comment": { "name": "comment.line.number-sign.ditroff.desc", "begin": "#", "end": "$", "beginCaptures": { "0": { "name": "punctuation.definition.comment.ditroff.desc" } } }, "fields": { "patterns": [ { "name": "meta.$1-list.ditroff.desc", "begin": "^\\s*(ligatures|sizes)(?=\\s)", "end": "(?\u003c=\\s)0(?=\\s*$)|(?=^(?!\\s*$)(?!\\s*[\\d#]))", "patterns": [ { "name": "constant.numeric.range.ditroff.desc", "match": "\\d+(-)\\d+", "captures": { "1": { "name": "punctuation.separator.range.dash.ditroff.desc" } } }, { "include": "#comment" }, { "name": "constant.numeric.integer.desc", "match": "\\d+" }, { "name": "variable.parameter.ditroff.desc", "match": "\\S{2,}" } ], "beginCaptures": { "1": { "name": "entity.type.var.ditroff.desc" } }, "endCaptures": { "0": { "name": "punctuation.terminator.statement.ditroff.desc" } } }, { "name": "meta.papersize.ditroff.desc", "begin": "^\\s*(papersize)(?=\\s)", "end": "(?=$|#)", "patterns": [ { "include": "#paperSizes" } ], "beginCaptures": { "1": { "name": "entity.type.var.ditroff.desc" } } }, { "begin": "(?x)^\\s*\n(afmfonts|allpunct|anysize|biggestfont|broken|checksum|designsize|encoding|family\n|fonts|hor|image_generator|internalname|lc_ctype|name|orientation|paper(?:length|width)\n|pass_filenames|postpro|prepro|print|res|sizescale|slant|spacewidth|spare\\d|special\n|styles|tcommand|unicode|unitwidth|unscaled_charwidths|use_charnames_in_special|vert\n|X11|(?:lbp|pcl)[a-z]+)\n(?=\\s)", "end": "(?=$|#)", "patterns": [ { "name": "constant.numeric.ditroff.desc", "match": "-?[\\d.]+(?=\\s|$)" }, { "name": "variable.parameter.ditroff.desc", "match": "\\S+" } ], "beginCaptures": { "1": { "name": "entity.type.var.ditroff.desc" } } } ] }, "fontPath": { "match": "^(?:(\\w+)?\\t+)?(\\S+)\\t+(\\*)?(\\S+(?:\\.pf[ab]|[\\/]Resource[\\/]Font[\\/]\\S+))\\s*$", "captures": { "1": { "name": "variable.other.foundry.ditroff.desc" }, "2": { "name": "entity.name.var.ditroff.desc" }, "3": { "name": "keyword.operator.globstar.ditroff.desc" }, "4": { "name": "string.quoted.double.filename.ditroff.desc" } } }, "foundry": { "name": "meta.foundry-data.ditroff.desc", "begin": "^(#)Foundry\\|Name\\|Searchpath\\s*$", "end": "(?=A)B", "patterns": [ { "include": "#comment" }, { "match": "^([^\\s|]+)(\\|)([YN])(\\|)([rins]+)?(\\|)(?:([.\\w]*)(\\|)([.\\w]*)(?=\\|))?", "captures": { "1": { "name": "entity.name.var.ditroff.desc" }, "2": { "name": "punctuation.delimiter.pipe.ditroff.desc" }, "3": { "name": "constant.boolean.is-base64.ditroff.desc" }, "4": { "name": "punctuation.delimiter.pipe.ditroff.desc" }, "5": { "name": "constant.language.flags.ditroff.desc" }, "6": { "name": "punctuation.delimiter.pipe.ditroff.desc" }, "7": { "name": "variable.parameter.ditroff.desc" }, "8": { "name": "punctuation.delimiter.pipe.ditroff.desc" }, "9": { "name": "variable.parameter.ditroff.desc" } } }, { "match": "^(foundry)(\\|)(\\w*)(\\|)((\\()\\w+(\\)))?([^|#]+)", "captures": { "1": { "name": "storage.type.foundry.ditroff.desc" }, "2": { "name": "punctuation.delimiter.pipe.ditroff.desc" }, "3": { "name": "variable.other.foundry.ditroff.desc" }, "4": { "name": "punctuation.delimiter.pipe.ditroff.desc" }, "5": { "name": "string.interpolated.ditroff.desc" }, "6": { "name": "punctuation.definition.arguments.begin.ditroff.desc" }, "7": { "name": "punctuation.definition.arguments.end.ditroff.desc" }, "8": { "name": "string.quoted.double.filename.ditroff.desc", "patterns": [ { "name": "punctuation.separator.key-value.colon.ditroff.desc", "match": ":" } ] } } }, { "name": "meta.foundry-font.ditroff.desc", "match": "(?\u003c=\\|)(?:([^|!]+\\.pf[ab])|([^|!]+)(!)([^|!]+\\.pf[ab]))$", "captures": { "1": { "name": "string.quoted.double.filename.ditroff.desc" }, "2": { "name": "variable.parameter.ditroff.desc" }, "3": { "name": "punctuation.separator.fontname.ditroff.desc" }, "4": { "name": "string.quoted.double.filename.ditroff.desc" } } }, { "name": "meta.afmtodit-flag.ditroff.desc", "match": "^([a-z])(=)(?=-)([^#]+)(?=$|#)", "captures": { "1": { "name": "variable.other.ditroff.desc" }, "2": { "name": "keyword.operator.assignment.ditroff.desc" }, "3": { "name": "constant.other.ditroff.desc" } } }, { "name": "punctuation.delimiter.pipe.ditroff.desc", "match": "\\|" } ], "beginCaptures": { "0": { "name": "comment.line.number-sign.ditroff.desc" }, "1": { "name": "punctuation.definition.comment.ditroff.desc" } } }, "kernpairs": { "name": "meta.kernpairs.ditroff.desc", "begin": "^(kernpairs)\\s*$", "end": "^(?=charset|\\s*$)", "patterns": [ { "name": "meta.kerning-pair.ditroff.desc", "match": "^\\s*(\\S+)\\s+(\\S+)\\s+(-?\\d+)", "captures": { "1": { "name": "entity.name.var.ditroff.desc" }, "2": { "name": "entity.name.var.ditroff.desc" }, "3": { "name": "constant.numeric.integer.ditroff.desc" } } } ], "beginCaptures": { "1": { "name": "keyword.control.section.ditroff.desc" } } }, "main": { "patterns": [ { "include": "#foundry" }, { "include": "#comment" }, { "include": "#charset" }, { "include": "#fields" }, { "include": "#kernpairs" }, { "include": "#fontPath" } ] }, "paperSizes": { "patterns": [ { "name": "support.constant.papersize.ditroff.desc", "match": "(?i)(?:[A-D][0-7]|DL|letter|legal|tabloid|ledger|statement|executive|com10|monarch)(?=$|[\\s#])" }, { "name": "meta.custom-papersize.ditroff.desc", "match": "(?\u003c=\\s)([\\d.]+)([icpP])(,)([\\d.]+)([icpP])(?=\\s|$)", "captures": { "1": { "name": "constant.numeric.ditroff.desc" }, "2": { "name": "keyword.other.unit.ditroff.desc" }, "3": { "name": "punctuation.delimiter.comma.ditroff.desc" }, "4": { "name": "constant.numeric.ditroff.desc" }, "5": { "name": "keyword.other.unit.ditroff.desc" } } } ] } } }