prism-birb.js 727 B

1234567891011121314151617181920212223
  1. Prism.languages.birb = Prism.languages.extend('clike', {
  2. 'string': {
  3. pattern: /r?("|')(?:\\.|(?!\1)[^\\])*\1/,
  4. greedy: true
  5. },
  6. 'class-name': [
  7. /\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/,
  8. // matches variable and function return types (parameters as well).
  9. /\b(?:[A-Z]\w*|(?!(?:var|void)\b)[a-z]\w*)(?=\s+\w+\s*[;,=()])/
  10. ],
  11. 'keyword': /\b(?:assert|break|case|class|const|default|else|enum|final|follows|for|grab|if|nest|new|next|noSeeb|return|static|switch|throw|var|void|while)\b/,
  12. 'operator': /\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?|:/,
  13. 'variable': /\b[a-z_]\w*\b/,
  14. });
  15. Prism.languages.insertBefore('birb', 'function', {
  16. 'metadata': {
  17. pattern: /<\w+>/,
  18. greedy: true,
  19. alias: 'symbol'
  20. }
  21. });