class Rouge::RegexLexer::State
def initialize(lexer_class, name, &defn)
def initialize(lexer_class, name, &defn) @lexer_class = lexer_class @name = name @defn = defn end
def load!
def load! return self if @loaded @loaded = true StateDSL.new(rules).instance_eval(&@defn) self end
def relative_state(state_name=nil, &b)
def relative_state(state_name=nil, &b) if state_name @lexer_class.get_state(state_name) else State.new(@lexer_class, b.inspect, &b).load! end end
def rules
def rules @rules ||= [] end