prism-dart.js 690 B

123456789101112131415161718
  1. Prism.languages.dart = Prism.languages.extend('clike', {
  2. 'string': [
  3. /r?("""|''')[\s\S]*?\1/,
  4. /r?("|')(\\?.)*?\1/
  5. ],
  6. 'keyword': [
  7. /\b(?:async|sync|yield)\*/,
  8. /\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|default|deferred|do|dynamic|else|enum|export|external|extends|factory|final|finally|for|get|if|implements|import|in|library|new|null|operator|part|rethrow|return|set|static|super|switch|this|throw|try|typedef|var|void|while|with|yield)\b/
  9. ],
  10. 'operator': /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/
  11. });
  12. Prism.languages.insertBefore('dart','function',{
  13. 'metadata': {
  14. pattern: /@\w+/,
  15. alias: 'symbol'
  16. }
  17. });