| Class | REXML::Validation::ZeroOrMore |
| In: |
lib/rexml/validation/relaxng.rb
|
| Parent: | Optional |
# File lib/rexml/validation/relaxng.rb, line 308
308: def expected
309: return [ @prior.expected, @events[0] ].flatten if @current == 0
310: return [@events[@current]]
311: end
# File lib/rexml/validation/relaxng.rb, line 287
287: def next( event )
288: expand_ref_in( @events, @current ) if @events[@current].class == Ref
289: if ( @events[@current].matches?(event) )
290: @current += 1
291: if @events[@current].nil?
292: @current = 0
293: return self
294: elsif @events[@current].kind_of? State
295: @current += 1
296: @events[@current-1].previous = self
297: return @events[@current-1]
298: else
299: return self
300: end
301: else
302: @prior = @previous.pop
303: return @prior.next( event ) if @current == 0
304: return nil
305: end
306: end