class Rouge::RegexLexer::ClosedState

Attributes

state[R]

Public Class Methods

new(state) click to toggle source
# File lib/rouge/regex_lexer.rb, line 19
def initialize(state)
  @state = state
end

Public Instance Methods

rule() click to toggle source
# File lib/rouge/regex_lexer.rb, line 23
def rule
  @state.rules.last
end
to_s() click to toggle source
# File lib/rouge/regex_lexer.rb, line 27
def to_s
  rule = @state.rules.last
  msg = "State :#{state.name} cannot continue after #{rule.inspect}, which will always match."
  if rule.re.source.include?('*')
    msg += " Consider replacing * with +."
  end

  msg
end