blob: 8a6bec79181af5461cb810ff2e64c2abb18784e0 (
plain)
1
2
3
4
5
6
7
8
|
require 'coderay'
token_stream = CodeRay::TokenStream.new do |kind, text|
puts 'kind: %s, text size: %d.' % [kind, text.size]
end
token_stream << [:regexp, '/\d+/']
#-> kind: rexpexp, text size: 5.
|