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

- old
+ new

@@ -13,34 +13,34 @@ string = /"[^"]*?"/ identifier = /([-a-zA-Z$._][-a-zA-Z$._0-9]*|#{string})/ state :basic do - rule /;.*?$/, 'Comment.Single' - rule /\s+/, 'Text' + rule /;.*?$/, Comment::Single + rule /\s+/, Text - rule /#{identifier}\s*:/, 'Literal.Name.Label' + rule /#{identifier}\s*:/, Name::Label - rule /@(#{identifier}|\d+)/, 'Name.Variable.Global' - rule /(%|!)#{identifier}/, 'Name.Variable' - rule /(%|!)\d+/, 'Name.Variable.Anonymous' + rule /@(#{identifier}|\d+)/, Name::Variable::Global + rule /(%|!)#{identifier}/, Name::Variable + rule /(%|!)\d+/, Name::Variable - rule /c?#{string}/, 'Literal.String' + rule /c?#{string}/, Str - rule /0[xX][a-fA-F0-9]+/, 'Literal.Number' - rule /-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?/, 'Literal.Number' + rule /0[xX][a-fA-F0-9]+/, Num + rule /-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?/, Num - rule /[=<>{}\[\]()*.,!]|x/, 'Punctuation' + rule /[=<>{}\[\]()*.,!]|x/, Punctuation end builtin_types = %w( void float double half x86_fp80 x86mmx fp128 ppc_fp128 label metadata ) state :types do - rule /i[1-9]\d*/, 'Keyword.Type' - rule /#{builtin_types.join('|')}/, 'Keyword.Type' + rule /i[1-9]\d*/, Keyword::Type + rule /#{builtin_types.join('|')}/, Keyword::Type end builtin_keywords = %w( begin end true false declare define global constant personality private landingpad linker_private internal available_externally linkonce_odr @@ -65,11 +65,11 @@ getelementptr extractelement insertelement shufflevector getresult extractvalue insertvalue cleanup resume ) state :keywords do - rule /#{builtin_instructions.join('|')}/, 'Keyword' - rule /#{builtin_keywords.join('|')}/, 'Keyword' + rule /#{builtin_instructions.join('|')}/, Keyword + rule /#{builtin_keywords.join('|')}/, Keyword end state :root do mixin :basic mixin :keywords