lib/rouge/lexers/dart.rb in rouge-3.27.0 vs lib/rouge/lexers/dart.rb in rouge-3.28.0

- old
+ new

@@ -3,29 +3,29 @@ module Rouge module Lexers class Dart < RegexLexer title "Dart" - desc "The Dart programming language (dartlang.com)" + desc "The Dart programming language (dart.dev)" 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 + as assert await break case catch continue default do else finally for + if in is new rethrow return super switch this throw try while with yield ) declarations = %w( - abstract dynamic const external extends factory final get implements - native operator set static typedef var + abstract async dynamic const covariant external extends factory final get + implements late native on operator required set static sync typedef var ) - types = %w(bool double Dynamic enum int num Object Set String void) + types = %w(bool Comparable double Dynamic enum Function int List Map Never Null num Object Pattern Set String Symbol Type Uri void) - imports = %w(import export library part\s*of part source) + imports = %w(import deferred export library part\s*of part source) id = /[a-zA-Z_]\w*/ state :root do rule %r(^ @@ -51,10 +51,10 @@ rule %r/@#{id}/, Name::Decorator rule %r/(?:#{keywords.join('|')})\b/, Keyword rule %r/(?:#{declarations.join('|')})\b/, Keyword::Declaration rule %r/(?:#{types.join('|')})\b/, Keyword::Type rule %r/(?:true|false|null)\b/, Keyword::Constant - rule %r/(?:class|interface)\b/, Keyword::Declaration, :class + rule %r/(?:class|interface|mixin)\b/, Keyword::Declaration, :class rule %r/(?:#{imports.join('|')})\b/, Keyword::Namespace, :import rule %r/(\.)(#{id})/ do groups Operator, Name::Attribute end