lib/rouge/lexers/shell.rb in rouge-0.2.8 vs lib/rouge/lexers/shell.rb in rouge-0.2.9
- old
+ new
@@ -70,10 +70,11 @@
rule /'/, 'Literal.String.Single', :pop!
rule /[^']+/, 'Literal.String.Single'
end
state :data do
+ rule /\s+/, 'Text'
rule /\\./, 'Literal.String.Escape'
rule /\$?"/, 'Literal.String.Double', :double_quotes
# single quotes are much easier than double quotes - we can
# literally just scan until the next single quote.
@@ -83,13 +84,12 @@
rule /$?'/, 'Literal.String.Single', :single_quotes
rule /\*/, 'Keyword'
rule /;/, 'Text'
- rule /\s+/, 'Text'
rule /[^=\*\s{}()$"\'`\\<]+/, 'Text'
- rule /\d+(?= |\Z)/, 'Number'
+ rule /\d+(?= |\Z)/, 'Literal.Number'
rule /</, 'Text'
mixin :interp
end
state :curly do
@@ -106,10 +106,10 @@
end
state :math do
rule /\)\)/, 'Keyword', :pop!
rule %r([-+*/%^|&]|\*\*|\|\|), 'Operator'
- rule /\d+/, 'Number'
+ rule /\d+/, 'Literal.Number'
mixin :root
end
state :case do
rule /\besac\b/, 'Keyword', :pop!