inform7.js 1.3 KB

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