Method: Teepee::ParagraphParser#parse

Defined in:
lib/teepee/paragraph-parser.rb

#parseObject



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/teepee/paragraph-parser.rb', line 62

def parse
  @expressions = []
  rest = tokens
  while rest.length > 0
    if rest.first.is_a? WordToken
      @expressions << rest.shift
    elsif rest.first.is_a? WhitespaceToken
      @expressions << rest.shift
    elsif rest.first.is_a? BackslashToken
      command, rest = CommandParser.parse parser, scope.derive, rest
      @expressions << command
    else
      return self
    end
  end
end