lib/rouge/lexers/php.rb in rouge-0.3.6 vs lib/rouge/lexers/php.rb in rouge-0.3.7
- old
+ new
@@ -63,11 +63,11 @@
end
state :php do
rule /\?>/, 'Comment.Preproc', :pop!
# heredocs
- rule /<<<('?)([a-z_]\w*)\1\n.*?\n\2;?\n/im, 'String'
+ rule /<<<('?)([a-z_]\w*)\1\n.*?\n\2;?\n/im, 'Literal.String.Heredoc'
rule /\s+/, 'Text'
rule /#.*?\n/, 'Comment.Single'
rule %r(//.*?\n), 'Comment.Single'
# empty comment, otherwise seen as the start of a docstring
rule %r(/\*\*/)
@@ -134,10 +134,10 @@
state :string do
rule /"/, 'Literal.String.Double', :pop!
rule /[^\\{$"]+/, 'Literal.String.Double'
rule /\\([nrt\"$\\]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2})/,
'Literal.String.Escape'
- rule /\$[a-zA-Z_][a-zA-Z0-9_]*(\[\S+\]|->[a-zA-Z_][a-zA-Z0-9_]*)?/
+ rule /\$[a-zA-Z_][a-zA-Z0-9_]*(\[\S+\]|->[a-zA-Z_][a-zA-Z0-9_]*)?/, 'Name.Variable'
lsi = 'Literal.String.Interpol'
rule /\{\$\{/, lsi, :interp_double
rule /\{(?=\$)/, lsi, :interp_single
rule /(\{)(\S+)(\})/ do