module WikiThat::Break

Lexer module for handline line breaks @author Bryan T. Meyers

Public Instance Methods

lex_break() click to toggle source

Lex the current text as a line break

# File lib/wiki-that/lexer/tokens/break.rb, line 29
def lex_break
  count = 0

  #Find all consecutive newlines
  while match? BREAK_SPECIAL
    if match? %W(\n)
      count += 1
    end
    advance
  end

  append Token.new(:break, count)
end