Method: RLTK::Lexer::Environment#rule_exec

Defined in:
lib/rltk/lexer.rb

#rule_exec(match, txt, &block) ⇒ Object

This function will instance_exec a block for a rule after setting the match value.

Parameters:

  • match (Match)

    Match object for matching text.

  • txt (String)

    Text of matching string.

  • block (Proc)

    Block for matched rule.



263
264
265
266
267
# File 'lib/rltk/lexer.rb', line 263

def rule_exec(match, txt, &block)
  self.match = match
  
  self.instance_exec(txt, &block)
end