lib/rouge/lexers/nginx.rb in rouge-3.4.1 vs lib/rouge/lexers/nginx.rb in rouge-3.5.0

- old
+ new

@@ -11,62 +11,62 @@ filenames 'nginx.conf' id = /[^\s$;{}()#]+/ state :root do - rule /(include)(\s+)([^\s;]+)/ do + rule %r/(include)(\s+)([^\s;]+)/ do groups Keyword, Text, Name end rule id, Keyword, :statement mixin :base end state :block do - rule /}/, Punctuation, :pop! + rule %r/}/, Punctuation, :pop! rule id, Keyword::Namespace, :statement mixin :base end state :statement do - rule /{/ do + rule %r/{/ do token Punctuation; pop!; push :block end - rule /;/, Punctuation, :pop! + rule %r/;/, Punctuation, :pop! mixin :base end state :base do - rule /\s+/, Text + rule %r/\s+/, Text - rule /#.*?\n/, Comment::Single - rule /(?:on|off)\b/, Name::Constant - rule /[$][\w-]+/, Name::Variable + rule %r/#.*?\n/, Comment::Single + rule %r/(?:on|off)\b/, Name::Constant + rule %r/[$][\w-]+/, Name::Variable # host/port - rule /([a-z0-9.-]+)(:)([0-9]+)/i do + rule %r/([a-z0-9.-]+)(:)([0-9]+)/i do groups Name::Function, Punctuation, Num::Integer end # mimetype rule %r([a-z-]+/[a-z-]+)i, Name::Class - rule /[0-9]+[kmg]?\b/i, Num::Integer - rule /(~)(\s*)([^\s{]+)/ do + rule %r/[0-9]+[kmg]?\b/i, Num::Integer + rule %r/(~)(\s*)([^\s{]+)/ do groups Punctuation, Text, Str::Regex end - rule /[:=~]/, Punctuation + rule %r/[:=~]/, Punctuation # pathname rule %r(/#{id}?), Name - rule /[^#\s;{}$\\]+/, Str # catchall + rule %r/[^#\s;{}$\\]+/, Str # catchall - rule /[$;]/, Text + rule %r/[$;]/, Text end end end end