# File lib/rkelly/lexeme.rb, line 6 def initialize(name, pattern, &block) @name = name @pattern = pattern @block = block end
# File lib/rkelly/lexeme.rb, line 12 def match(scanner) match = scanner.check(pattern) return Token.new(name, match.to_s, &@block) if match match end