Skip to content

Commit

Permalink
properly pop the :classname state
Browse files Browse the repository at this point in the history
otherwise initial constants will be Name::Class
  • Loading branch information
http://jneen.net/ committed Dec 21, 2016
1 parent b51f9d2 commit a0549d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rouge/lexers/ruby.rb
Expand Up @@ -306,7 +306,7 @@ def self.analyze_text(text)
goto :expr_start
end

rule /[A-Z_]\w*/, Name::Class
rule /[A-Z_]\w*/, Name::Class, :pop!

rule(//) { pop! }
end
Expand Down
6 changes: 6 additions & 0 deletions spec/visual/samples/ruby
Expand Up @@ -2,6 +2,12 @@
# ruby 1.9 examples
#######

class Random
RANDOM_VAR = 1
RANDOM_2 = 2
RANDOM_3 = 3
end

state :foo do
rule %r(/) do
token Operator
Expand Down

0 comments on commit a0549d0

Please sign in to comment.