Sha256: dcc9becdb72cffdab44835839547983dea371d6de5ef58fef00724fb57f7b506
Contents?: true
Size: 1.57 KB
Versions: 4
Compression:
Stored size: 1.57 KB
Contents
# -*- coding: utf-8 -*- # # frozen_string_literal: true module Rouge module Lexers class MXML < RegexLexer title "MXML" desc "MXML" tag 'mxml' filenames '*.mxml' mimetypes 'application/xv+xml' state :root do rule /[^<&]+/, Text rule /&\S*?;/, Name::Entity rule /<!\[CDATA\[/m do token Comment::Preproc push :actionscript_content end rule /<!--/, Comment, :comment rule /<\?.*?\?>/, Comment::Preproc rule /<![^>]*>/, Comment::Preproc rule %r(<\s*[\w:.-]+)m, Name::Tag, :tag # opening tags rule %r(<\s*/\s*[\w:.-]+\s*>)m, Name::Tag # closing tags end state :comment do rule /[^-]+/m, Comment rule /-->/, Comment, :pop! rule /-/, Comment end state :tag do rule /\s+/m, Text rule /[\w.:-]+\s*=/m, Name::Attribute, :attribute rule %r(/?\s*>), Name::Tag, :root end state :attribute do rule /\s+/m, Text rule /(")({|@{)/m do groups Str, Punctuation push :actionscript_attribute end rule /".*?"|'.*?'|[^\s>]+/, Str, :tag end state :actionscript_content do rule /\]\]\>/m, Comment::Preproc, :pop! rule /.*?(?=\]\]\>)/m do delegate Actionscript end end state :actionscript_attribute do rule /(})(")/m do groups Punctuation, Str push :tag end rule /.*?(?=}")/m do delegate Actionscript end end end end end
Version data entries
4 entries across 4 versions & 2 rubygems
Version | Path |
---|---|
rouge-3.4.1 | lib/rouge/lexers/mxml.rb |
rouge-3.4.0 | lib/rouge/lexers/mxml.rb |
rouge-alda-3.3.0 | lib/rouge/lexers/mxml.rb |
rouge-3.3.0 | lib/rouge/lexers/mxml.rb |