prism-actionscript.js 963 B

12345678910111213141516171819
  1. Prism.languages.actionscript = Prism.languages.extend('javascript', {
  2. 'keyword': /\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,
  3. 'operator': /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/
  4. });
  5. Prism.languages.actionscript['class-name'].alias = 'function';
  6. // doesn't work with AS because AS is too complex
  7. delete Prism.languages.actionscript['parameter'];
  8. delete Prism.languages.actionscript['literal-property'];
  9. if (Prism.languages.markup) {
  10. Prism.languages.insertBefore('actionscript', 'string', {
  11. 'xml': {
  12. pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,
  13. lookbehind: true,
  14. inside: Prism.languages.markup
  15. }
  16. });
  17. }