parser3.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. Language: Parser3
  3. Requires: xml.js
  4. Author: Oleg Volchkov <oleg@volchkov.net>
  5. Website: https://www.parser.ru/en/
  6. Category: template
  7. */
  8. function parser3(hljs) {
  9. const CURLY_SUBCOMMENT = hljs.COMMENT(
  10. /\{/,
  11. /\}/,
  12. { contains: [ 'self' ] }
  13. );
  14. return {
  15. name: 'Parser3',
  16. subLanguage: 'xml',
  17. relevance: 0,
  18. contains: [
  19. hljs.COMMENT('^#', '$'),
  20. hljs.COMMENT(
  21. /\^rem\{/,
  22. /\}/,
  23. {
  24. relevance: 10,
  25. contains: [ CURLY_SUBCOMMENT ]
  26. }
  27. ),
  28. {
  29. className: 'meta',
  30. begin: '^@(?:BASE|USE|CLASS|OPTIONS)$',
  31. relevance: 10
  32. },
  33. {
  34. className: 'title',
  35. begin: '@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$'
  36. },
  37. {
  38. className: 'variable',
  39. begin: /\$\{?[\w\-.:]+\}?/
  40. },
  41. {
  42. className: 'keyword',
  43. begin: /\^[\w\-.:]+/
  44. },
  45. {
  46. className: 'number',
  47. begin: '\\^#[0-9a-fA-F]+'
  48. },
  49. hljs.C_NUMBER_MODE
  50. ]
  51. };
  52. }
  53. export { parser3 as default };