class Rouge::RegexLexer

def state

than returning nil.
NB: if the state stack is empty, this will throw an error rather

The current state - i.e. one on top of the state stack.
def state
  stack.last or raise 'empty stack!'
end