Class: Yaparc::Many

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

Overview

class ManyParser

Constant Summary

Constants included from Parsable

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

Instance Attribute Summary

Attributes included from Parsable

#tree

Instance Method Summary collapse

Methods included from Parsable

#eval, included, #parse

Constructor Details

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

Returns a new instance of Many.



322
323
324
325
326
# File 'lib/yaparc.rb', line 322

def initialize(parser, identity = [])
  @parser = lambda do |input|
    Alt.new(ManyOne.new(parser, identity), Succeed.new(identity))
  end
end