2021-03-10 11:35:00 -05:00
hljs . registerLanguage ( "dart" , ( ( ) => { "use strict" ; return e => { const n = {
className : "subst" , variants : [ { begin : "\\$[A-Za-z0-9_]+" } ] } , a = { className : "subst" ,
variants : [ { begin : /\$\{/ , end : /\}/ } ] , keywords : "true false null this is new super"
} , t = { className : "string" , variants : [ { begin : "r'''" , end : "'''" } , { begin : 'r"""' ,
end : '"""' } , { begin : "r'" , end : "'" , illegal : "\\n" } , { begin : 'r"' , end : '"' , illegal : "\\n"
} , { begin : "'''" , end : "'''" , contains : [ e . BACKSLASH _ESCAPE , n , a ] } , { begin : '"""' ,
end : '"""' , contains : [ e . BACKSLASH _ESCAPE , n , a ] } , { begin : "'" , end : "'" , illegal : "\\n" ,
contains : [ e . BACKSLASH _ESCAPE , n , a ] } , { begin : '"' , end : '"' , illegal : "\\n" ,
contains : [ e . BACKSLASH _ESCAPE , n , a ] } ] } ; a . contains = [ e . C _NUMBER _MODE , t ]
; 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 + "?" ) )
; return { name : "Dart" , keywords : {
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" ,
built _in : i . concat ( r ) . concat ( [ "Never" , "Null" , "dynamic" , "print" , "document" , "querySelector" , "querySelectorAll" , "window" ] ) ,
$pattern : /[A-Za-z][A-Za-z0-9_]*\??/ } ,
contains : [ t , e . COMMENT ( /\/\*\*(?!\/)/ , /\*\// , { subLanguage : "markdown" , relevance : 0
} ) , e . COMMENT ( /\/{3,} ?/ , /$/ , { contains : [ { subLanguage : "markdown" , begin : "." ,
end : "$" , relevance : 0 } ] } ) , e . C _LINE _COMMENT _MODE , e . C _BLOCK _COMMENT _MODE , {
className : "class" , beginKeywords : "class interface" , end : /\{/ , excludeEnd : ! 0 ,
contains : [ { beginKeywords : "extends implements" } , e . UNDERSCORE _TITLE _MODE ]
} , e . C _NUMBER _MODE , { className : "meta" , begin : "@[A-Za-z]+" } , { begin : "=>" } ] } } } ) ( ) ) ;