inform7.js (1591B)
1 /* 2 Language: Inform 7 3 Author: Bruno Dias <bruno.r.dias@gmail.com> 4 Description: Language definition for Inform 7, a DSL for writing parser interactive fiction. 5 Website: http://inform7.com 6 */ 7 8 function inform7(hljs) { 9 var START_BRACKET = '\\['; 10 var END_BRACKET = '\\]'; 11 return { 12 name: 'Inform 7', 13 aliases: ['i7'], 14 case_insensitive: true, 15 keywords: { 16 // Some keywords more or less unique to I7, for relevance. 17 keyword: 18 // kind: 19 'thing room person man woman animal container ' + 20 'supporter backdrop door ' + 21 // characteristic: 22 'scenery open closed locked inside gender ' + 23 // verb: 24 'is are say understand ' + 25 // misc keyword: 26 'kind of rule' 27 }, 28 contains: [ 29 { 30 className: 'string', 31 begin: '"', end: '"', 32 relevance: 0, 33 contains: [ 34 { 35 className: 'subst', 36 begin: START_BRACKET, end: END_BRACKET 37 } 38 ] 39 }, 40 { 41 className: 'section', 42 begin: /^(Volume|Book|Part|Chapter|Section|Table)\b/, 43 end: '$' 44 }, 45 { 46 // Rule definition 47 // This is here for relevance. 48 begin: /^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/, 49 end: ':', 50 contains: [ 51 { 52 //Rule name 53 begin: '\\(This', end: '\\)' 54 } 55 ] 56 }, 57 { 58 className: 'comment', 59 begin: START_BRACKET, end: END_BRACKET, 60 contains: ['self'] 61 } 62 ] 63 }; 64 } 65 66 module.exports = inform7;