Class: RParsec::RepeatParser

Inherits:
Parser
  • Object
show all
Defined in:
lib/rparsec/repeat_parser.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Parser

Parser::MyMonad

Constants included from Functors

Functors::And, Functors::At, Functors::BitAnd, Functors::Call, Functors::Compare, Functors::Dec, Functors::Div, Functors::Eq, Functors::Feed, Functors::Fst, Functors::Ge, Functors::Gt, Functors::Id, Functors::Idn, Functors::Inc, Functors::Le, Functors::Lt, Functors::Match, Functors::Minus, Functors::Mod, Functors::Mul, Functors::Ne, Functors::Neg, Functors::Not, Functors::Or, Functors::Plus, Functors::Power, Functors::Snd, Functors::Succ, Functors::To_a, Functors::To_f, Functors::To_i, Functors::To_s, Functors::To_sym, Functors::Union, Functors::Xor

Instance Attribute Summary

Attributes inherited from Parser

#name

Attributes included from Monad

#this

Instance Method Summary collapse

Methods inherited from Parser

#>>, #atomize, #bindn, #catchp, #delimited, #delimited1, #expect, #followed, #fragment, #infixl, #infixn, #infixr, #lexeme, #lookahead, #many, #many_, #map, #mapn, #nested, #not, #optional, #parse, #peek, #postfix, #prefix, #repeat, #repeat_, #separated, #separated1, #seq, #some, #some_, #to_s, #token, #|

Methods included from Monad

#bind, #initMonad, #map, #plus, #seq, #value

Methods included from Functors

#compose, #const, #curry, #flip, make_curry, make_reverse_curry, #nth, #power, #repeat, #reverse_curry, #reverse_uncurry, #uncurry

Instance Method Details

#_parse(ctxt) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/rparsec/repeat_parser.rb', line 6

def _parse ctxt
  result = []
  @times.times do
    return false unless @parser._parse ctxt
    result << ctxt.result
  end
  return ctxt.retn(result)
end