Method: HTML::Tokenizer#next

Defined in:
lib/html/tokenizer.rb

#nextObject

Return the next token in the sequence, or nil if there are no more tokens in the stream.



34
35
36
37
38
39
40
41
42
43
# File 'lib/html/tokenizer.rb', line 34

def next
  return nil if @scanner.eos?
  @position = @scanner.pos
  @line = @current_line
  if @scanner.check(/<\S/)
    update_current_line(scan_tag)
  else
    update_current_line(scan_text)
  end
end