prism-neon.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. Prism.languages.neon = {
  2. 'comment': {
  3. pattern: /#.*/,
  4. greedy: true
  5. },
  6. 'datetime': {
  7. pattern: /(^|[[{(=:,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/,
  8. lookbehind: true,
  9. alias: 'number'
  10. },
  11. 'key': {
  12. pattern: /(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/,
  13. lookbehind: true,
  14. alias: 'property'
  15. },
  16. 'number': {
  17. pattern: /(^|[[{(=:,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+(?:\.\d*)?|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),:=\s])/,
  18. lookbehind: true
  19. },
  20. 'boolean': {
  21. pattern: /(^|[[{(=:,\s])(?:false|no|true|yes)(?=$|[\]}),:=\s])/i,
  22. lookbehind: true
  23. },
  24. 'null': {
  25. pattern: /(^|[[{(=:,\s])(?:null)(?=$|[\]}),:=\s])/i,
  26. lookbehind: true,
  27. alias: 'keyword'
  28. },
  29. 'string': {
  30. pattern: /(^|[[{(=:,\s])(?:('''|""")\r?\n(?:(?:[^\r\n]|\r?\n(?![\t ]*\2))*\r?\n)?[\t ]*\2|'[^'\r\n]*'|"(?:\\.|[^\\"\r\n])*")/,
  31. lookbehind: true,
  32. greedy: true
  33. },
  34. 'literal': {
  35. pattern: /(^|[[{(=:,\s])(?:[^#"',:=[\]{}()\s`-]|[:-][^"',=[\]{}()\s])(?:[^,:=\]})(\s]|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/,
  36. lookbehind: true,
  37. alias: 'string',
  38. },
  39. 'punctuation': /[,:=[\]{}()-]/,
  40. };