# -*- 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/\s+/,Textrule%r(//.*?$),Comment::Singlerule%r(/\*.*?\*/)m,Comment::Multilinerule/"/,Str,:dqsrule/'/,Str,:sqsrule/r"[^"]*"/,Str::Otherrule/r'[^']*'/,Str::Otherrule/##{id}*/i,Str::Symbolrule/@#{id}/,Name::Decoratorrule/(?:#{keywords.join('|')})\b/,Keywordrule/(?:#{declarations.join('|')})\b/,Keyword::Declarationrule/(?:#{types.join('|')})\b/,Keyword::Typerule/(?:true|false|null)\b/,Keyword::Constantrule/(?:class|interface)\b/,Keyword::Declaration,:classrule/(?:#{imports.join('|')})\b/,Keyword::Namespace,:importrule/(\.)(#{id})/dogroupsOperator,Name::Attributeendrule/#{id}:/,Name::Labelrule/\$?#{id}/,Namerule/[~^*!%&\[\](){}<>\|+=:;,.\/?-]/,Operatorrule/\d*\.\d+([eE]\-?\d+)?/,Num::Floatrule/0x[\da-fA-F]+/,Num::Hexrule/\d+L?/,Num::Integerrule/\n/,Textendstate:classdorule/\s+/m,Textruleid,Name::Class,:pop!endstate:dqsdorule/"/,Str,:pop!rule/[^\\\$"]+/,Strmixin:stringendstate:sqsdorule/'/,Str,:pop!rule/[^\\\$']+/,Strmixin:stringendstate:importdorule/;/,Operator,:pop!rule/(?:show|hide)\b/,Keyword::Declarationmixin:rootendstate:stringdomixin:interpolationrule/\\[nrt\"\'\\]/,Str::Escapeendstate:interpolationdorule/\$#{id}/,Str::Interpolrule/\$\{[^\}]+\}/,Str::Interpolendendendend