lib-ruby-parser (C++ bindings)  4.0.1+ruby-3.1.1
C++ bindings for lib-ruby-parser library
lib_ruby_parser::While Class Reference

Represents while loop. More...

#include <nodes.hpp>

Public Attributes

Nodecond
 Condition of the loop. More...
 
Nodebody
 
Loc keyword_l
 
MaybeLoc begin_l
 
MaybeLoc end_l
 
Loc expression_l
 

Detailed Description

Represents while loop.

Member Data Documentation

◆ begin_l

MaybeLoc lib_ruby_parser::While::begin_l

Location of the do keyword

while cond do; foo; end
^^

do is optional, and so begin_l can be None

◆ body

Node* lib_ruby_parser::While::body

Body of the loop.

None if body is empty

◆ cond

Node* lib_ruby_parser::While::cond

Condition of the loop.

◆ end_l

MaybeLoc lib_ruby_parser::While::end_l

Location of the end keyword

while cond do; foo; end
^^^

None if loop is a modifier (i.e. foo while bar)

◆ expression_l

Loc lib_ruby_parser::While::expression_l

Location of the full expression

while cond do; foo; end
^^^^^^^^^^^^^^^^^^^^^^^
foo while bar
^^^^^^^^^^^^^

◆ keyword_l

Loc lib_ruby_parser::While::keyword_l

Location of the while keyword

while cond do; foo; end
^^^^^

The documentation for this class was generated from the following file: