Class: Yaparc::Many

Inherits:
Object
  • Object
show all
Includes:
Parsable
Defined in:
lib/yaparc/many.rb

Overview

permits zero or more applications of parser.

Constant Summary

Constants included from Parsable

Parsable::IS_ALPHANUM, Parsable::IS_CR, Parsable::IS_DIGIT, Parsable::IS_LOWER, Parsable::IS_SPACE, Parsable::IS_WHITESPACE

Instance Method Summary collapse

Methods included from Parsable

#parse

Constructor Details

#initialize(parser, identity = []) ⇒ Many

Returns a new instance of Many.



8
9
10
11
12
# File 'lib/yaparc/many.rb', line 8

def initialize(parser, identity = [])
  @parser = proc {
    Alt.new(ManyOne.new(parser, identity), Succeed.new(identity))
  }
end