Permalink
Browse files

. comment for parser

  • Loading branch information...
1 parent 8d4b778 commit a983dc321f3c06df68a6818abbe7c3dea6664c4a @kschiess committed Nov 16, 2010
Showing with 12 additions and 2 deletions.
  1. +12 −2 lib/parslet/parser.rb
View
@@ -1,6 +1,16 @@
-# A simple wrapper for the functionality to permit clean source code structure.
-# You should use this as the base class for your parsers.
+# The base class for all your parsers. Use as follows:
+#
+# require 'parslet'
+#
+# class MyParser < Parslet::Parser
+# rule(:a) { str('a').repeat }
+# root(:a)
+# end
+#
+# pp MyParser.new.parse('aaaa') # => 'aaaa'
+# pp MyParser.new.parse('bbbb') # => Parslet::Atoms::ParseFailed:
+# # Don't know what to do with bbbb at line 1 char 1.
#
class Parslet::Parser
include Parslet

0 comments on commit a983dc3

Please sign in to comment.