prism-yang.js 492 B

1234567891011121314151617181920
  1. Prism.languages.yang = {
  2. // https://tools.ietf.org/html/rfc6020#page-34
  3. // http://www.yang-central.org/twiki/bin/view/Main/YangExamples
  4. 'comment': /\/\*[\s\S]*?\*\/|\/\/.*/,
  5. 'string': {
  6. pattern: /"(?:[^\\"]|\\.)*"|'[^']*'/,
  7. greedy: true
  8. },
  9. 'keyword': {
  10. pattern: /(^|[{};\r\n][ \t]*)[a-z_][\w.-]*/i,
  11. lookbehind: true
  12. },
  13. 'namespace': {
  14. pattern: /(\s)[a-z_][\w.-]*(?=:)/i,
  15. lookbehind: true
  16. },
  17. 'boolean': /\b(?:false|true)\b/,
  18. 'operator': /\+/,
  19. 'punctuation': /[{};:]/
  20. };