lib/rouge/lexers/toml.rb in rouge-0.4.0 vs lib/rouge/lexers/toml.rb in rouge-0.5.0

- old
+ new

@@ -12,58 +12,58 @@ end identifier = /[\w.\S]+/ state :basic do - rule /\s+/, 'Text' - rule /#.*?$/, 'Comment' - rule /(true|false)/, 'Keyword.Constant' - rule /(?<!=)\s*\[[\w\d\S]+\]/, 'Name.Namespace' + rule /\s+/, Text + rule /#.*?$/, Comment + rule /(true|false)/, Keyword::Constant + rule /(?<!=)\s*\[[\w\d\S]+\]/, Name::Namespace - rule /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/, 'Literal.Date' + rule /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/, Literal::Date - rule /(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?/, 'Literal.Number.Float' - rule /\d+[eE][+-]?[0-9]+j?/, 'Literal.Number.Float' - rule /\-?\d+/, 'Literal.Number.Integer' + rule /(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?/, Num::Float + rule /\d+[eE][+-]?[0-9]+j?/, Num::Float + rule /\-?\d+/, Num::Integer end state :root do mixin :basic rule /(#{identifier})(\s*)(=)/ do - group 'Name.Property'; group 'Text' - group 'Punctuation' + group Name::Property; group Text + group Punctuation push :value end end state :value do - rule /\n/, 'Text', :pop! + rule /\n/, Text, :pop! mixin :content end state :content do mixin :basic - rule /"/, 'Literal.String', :dq + rule /"/, Str, :dq mixin :esc_str - rule /\,/, 'Punctuation' - rule /\[/, 'Punctuation', :array + rule /\,/, Punctuation + rule /\[/, Punctuation, :array end state :dq do - rule /"/, 'Literal.String', :pop! + rule /"/, Str, :pop! mixin :esc_str - rule /[^\\"]+/, 'Literal.String' + rule /[^\\"]+/, Str end state :esc_str do - rule /\\[0t\tn\n "\\ r]/, 'Literal.String.Escape' + rule /\\[0t\tn\n "\\ r]/, Str::Escape end state :array do mixin :content - rule /\]/, 'Punctuation', :pop! + rule /\]/, Punctuation, :pop! end end end end