summaryrefslogtreecommitdiff
path: root/demo/demo_stream2.rb
diff options
context:
space:
mode:
authorno author <noone@nowhere>2005-09-26 02:58:54 +0000
committerno author <noone@nowhere>2005-09-26 02:58:54 +0000
commit84b8431608174e74a4c0d2394eb330a6621bc74b (patch)
treeffc2bd7ce21708a9147247c80b0e7fc7728ea063 /demo/demo_stream2.rb
downloadcoderay-84b8431608174e74a4c0d2394eb330a6621bc74b.tar.gz
New Repository, initial import
Diffstat (limited to 'demo/demo_stream2.rb')
-rw-r--r--demo/demo_stream2.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/demo/demo_stream2.rb b/demo/demo_stream2.rb
new file mode 100644
index 0000000..8a6bec7
--- /dev/null
+++ b/demo/demo_stream2.rb
@@ -0,0 +1,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.