dart.min.js 2.1 KB

12345678910111213141516171819202122
  1. /*! `dart` grammar compiled for Highlight.js 11.7.0 */
  2. (()=>{var e=(()=>{"use strict";return e=>{const n={className:"subst",variants:[{
  3. begin:"\\$[A-Za-z0-9_]+"}]},a={className:"subst",variants:[{begin:/\$\{/,
  4. end:/\}/}],keywords:"true false null this is new super"},t={className:"string",
  5. variants:[{begin:"r'''",end:"'''"},{begin:'r"""',end:'"""'},{begin:"r'",end:"'",
  6. illegal:"\\n"},{begin:'r"',end:'"',illegal:"\\n"},{begin:"'''",end:"'''",
  7. contains:[e.BACKSLASH_ESCAPE,n,a]},{begin:'"""',end:'"""',
  8. contains:[e.BACKSLASH_ESCAPE,n,a]},{begin:"'",end:"'",illegal:"\\n",
  9. contains:[e.BACKSLASH_ESCAPE,n,a]},{begin:'"',end:'"',illegal:"\\n",
  10. contains:[e.BACKSLASH_ESCAPE,n,a]}]};a.contains=[e.C_NUMBER_MODE,t]
  11. ;const i=["Comparable","DateTime","Duration","Function","Iterable","Iterator","List","Map","Match","Object","Pattern","RegExp","Set","Stopwatch","String","StringBuffer","StringSink","Symbol","Type","Uri","bool","double","int","num","Element","ElementList"],r=i.map((e=>e+"?"))
  12. ;return{name:"Dart",keywords:{
  13. keyword:["abstract","as","assert","async","await","break","case","catch","class","const","continue","covariant","default","deferred","do","dynamic","else","enum","export","extends","extension","external","factory","false","final","finally","for","Function","get","hide","if","implements","import","in","inferface","is","late","library","mixin","new","null","on","operator","part","required","rethrow","return","set","show","static","super","switch","sync","this","throw","true","try","typedef","var","void","while","with","yield"],
  14. built_in:i.concat(r).concat(["Never","Null","dynamic","print","document","querySelector","querySelectorAll","window"]),
  15. $pattern:/[A-Za-z][A-Za-z0-9_]*\??/},
  16. contains:[t,e.COMMENT(/\/\*\*(?!\/)/,/\*\//,{subLanguage:"markdown",relevance:0
  17. }),e.COMMENT(/\/{3,} ?/,/$/,{contains:[{subLanguage:"markdown",begin:".",
  18. end:"$",relevance:0}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{
  19. className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,
  20. contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]
  21. },e.C_NUMBER_MODE,{className:"meta",begin:"@[A-Za-z]+"},{begin:"=>"}]}}})()
  22. ;hljs.registerLanguage("dart",e)})();