# -*- coding: utf-8 -*- ## frozen_string_literal: truemoduleRougemoduleLexersclassDart<RegexLexertitle"Dart"desc"The Dart programming language (dartlang.com)"tag'dart'filenames'*.dart'mimetypes'text/x-dart'keywords=%w(
as assert break case catch continue default do else finally for
if in is new rethrow return super switch this throw try while with
)declarations=%w(
abstract dynamic const external extends factory final get implements
native operator set static typedef var
)types=%w(bool double Dynamic enum int num Object Set String void)imports=%w(import export library part\s*of part source)id=/[a-zA-Z_]\w*/state:rootdorule%r(^
(\s*(?:[a-zA-Z_][a-zA-Z\d_.\[\]]*\s+)+?) # return arguments
([a-zA-Z_]\w*) # method name
(\s*)(\() # signature start
)mxdo|m|# TODO: do this better, this shouldn't need a delegationdelegateDart,m[1]tokenName::Function,m[2]tokenText,m[3]tokenPunctuation,m[4]endrule%r/\s+/,Textrule%r(//.*?$),Comment::Singlerule%r(/\*.*?\*/)m,Comment::Multilinerule%r/"/,Str,:dqsrule%r/'/,Str,:sqsrule%r/r"[^"]*"/,Str::Otherrule%r/r'[^']*'/,Str::Otherrule%r/##{id}*/i,Str::Symbolrule%r/@#{id}/,Name::Decoratorrule%r/(?:#{keywords.join('|')})\b/,Keywordrule%r/(?:#{declarations.join('|')})\b/,Keyword::Declarationrule%r/(?:#{types.join('|')})\b/,Keyword::Typerule%r/(?:true|false|null)\b/,Keyword::Constantrule%r/(?:class|interface)\b/,Keyword::Declaration,:classrule%r/(?:#{imports.join('|')})\b/,Keyword::Namespace,:importrule%r/(\.)(#{id})/dogroupsOperator,Name::Attributeendrule%r/#{id}:/,Name::Labelrule%r/\$?#{id}/,Namerule%r/[~^*!%&\[\](){}<>\|+=:;,.\/?-]/,Operatorrule%r/\d*\.\d+([eE]\-?\d+)?/,Num::Floatrule%r/0x[\da-fA-F]+/,Num::Hexrule%r/\d+L?/,Num::Integerrule%r/\n/,Textendstate:classdorule%r/\s+/m,Textruleid,Name::Class,:pop!endstate:dqsdorule%r/"/,Str,:pop!rule%r/[^\\\$"]+/,Strmixin:stringendstate:sqsdorule%r/'/,Str,:pop!rule%r/[^\\\$']+/,Strmixin:stringendstate:importdorule%r/;/,Operator,:pop!rule%r/(?:show|hide)\b/,Keyword::Declarationmixin:rootendstate:stringdomixin:interpolationrule%r/\\[nrt\"\'\\]/,Str::Escapeendstate:interpolationdorule%r/\$#{id}/,Str::Interpolrule%r/\$\{[^\}]+\}/,Str::Interpolendendendend