From 0dc342de848a642ecce8db697b8fecd83a63e117 Mon Sep 17 00:00:00 2001 From: yugui Date: Mon, 25 Aug 2008 15:02:05 +0000 Subject: added tag v1_9_0_4 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- trunk/sample/ripper/strip-comment.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 trunk/sample/ripper/strip-comment.rb (limited to 'trunk/sample/ripper/strip-comment.rb') diff --git a/trunk/sample/ripper/strip-comment.rb b/trunk/sample/ripper/strip-comment.rb new file mode 100644 index 0000000000..bd26b6a377 --- /dev/null +++ b/trunk/sample/ripper/strip-comment.rb @@ -0,0 +1,19 @@ +# $Id$ + +require 'ripper/filter' + +class CommentStripper < Ripper::Filter + def CommentStripper.strip(src) + new(src).parse(nil) + end + + def on_default(event, token, data) + print token + end + + def on_comment(token, data) + puts + end +end + +CommentStripper.strip(ARGF) -- cgit v1.2.3