bnf.js (693B)
1 /* 2 Language: Backus–Naur Form 3 Website: https://en.wikipedia.org/wiki/Backus–Naur_form 4 Author: Oleg Efimov <efimovov@gmail.com> 5 */ 6 7 /** @type LanguageFn */ 8 function bnf(hljs) { 9 return { 10 name: 'Backus–Naur Form', 11 contains: [ 12 // Attribute 13 { 14 className: 'attribute', 15 begin: /</, end: />/ 16 }, 17 // Specific 18 { 19 begin: /::=/, 20 end: /$/, 21 contains: [ 22 { 23 begin: /</, end: />/ 24 }, 25 // Common 26 hljs.C_LINE_COMMENT_MODE, 27 hljs.C_BLOCK_COMMENT_MODE, 28 hljs.APOS_STRING_MODE, 29 hljs.QUOTE_STRING_MODE 30 ] 31 } 32 ] 33 }; 34 } 35 36 module.exports = bnf;