parameters: (self)
return_statement: return result
docstring: Parse an if construct.
docstring_summary: Parse an if construct.
docstring_tokens: Parse an if construct .
function: def parse_if(self):
          """Parse an if construct."""
          node = result = nodes.If(lineno=self.stream.expect('name:if').lineno)
          while 1:
              node.test = self.parse_tuple(with_condexpr=False)
              node.body = self.parse_statements(('name:elif', 'name:else',
                                                 'name:endif'))
              token = next(self.stream)
              if token.test('name:elif'):
                  new_node = nodes.If(lineno=self.stream.current.lineno)
                  node.else_ = [new_node]
                  node = new_node
                  continue
              elif token.test('name:else'):
                  node.else_ = self.parse_statements(('name:endif',),
                                                     drop_needle=True)
              else:
                  node.else_ = []
              break
          return result
function_tokens: def parse_if ( self ) : node = result = nodes . If ( lineno = self . stream . expect ( 'name:if' ) . lineno ) while 1 : node . test = self . parse_tuple ( with_condexpr = False ) node . body = self . parse_statements ( ( 'name:elif' , 'name:else' , 'name:endif' ) ) token = next ( self . stream ) if token . test ( 'name:elif' ) : new_node = nodes . If ( lineno = self . stream . current . lineno ) node . else_ = [ new_node ] node = new_node continue elif token . test ( 'name:else' ) : node . else_ = self . parse_statements ( ( 'name:endif' , ) , drop_needle = True ) else : node . else_ = [ ] break return result