taggerscript.js (927B)
1 /* 2 Language: Tagger Script 3 Author: Philipp Wolfer <ph.wolfer@gmail.com> 4 Description: Syntax Highlighting for the Tagger Script as used by MusicBrainz Picard. 5 Website: https://picard.musicbrainz.org 6 */ 7 function taggerscript(hljs) { 8 9 var COMMENT = { 10 className: 'comment', 11 begin: /\$noop\(/, 12 end: /\)/, 13 contains: [{ 14 begin: /\(/, 15 end: /\)/, 16 contains: ['self', { 17 begin: /\\./ 18 }] 19 }], 20 relevance: 10 21 }; 22 23 var FUNCTION = { 24 className: 'keyword', 25 begin: /\$(?!noop)[a-zA-Z][_a-zA-Z0-9]*/, 26 end: /\(/, 27 excludeEnd: true 28 }; 29 30 var VARIABLE = { 31 className: 'variable', 32 begin: /%[_a-zA-Z0-9:]*/, 33 end: '%' 34 }; 35 36 var ESCAPE_SEQUENCE = { 37 className: 'symbol', 38 begin: /\\./ 39 }; 40 41 return { 42 name: 'Tagger Script', 43 contains: [ 44 COMMENT, 45 FUNCTION, 46 VARIABLE, 47 ESCAPE_SEQUENCE 48 ] 49 }; 50 } 51 52 module.exports = taggerscript;