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

Represents an if statement (i.e. if foo; bar; else; baz; end) More...

#include <nodes.hpp>

Public Attributes

Nodecond
 Condition given to the if statement, Lvar("a") for if a; b; else; c; end More...
 
Nodeif_true
 True-branch of the if statement, Lvar("b") for if a; b; else; c; end More...
 
Nodeif_false
 False-branch of the if statement, Lvar("c") for if a; b; else; c; end More...
 
Loc keyword_l
 
Loc begin_l
 
MaybeLoc else_l
 
MaybeLoc end_l
 
Loc expression_l
 

Detailed Description

Represents an if statement (i.e. if foo; bar; else; baz; end)

Member Data Documentation

◆ begin_l

Loc lib_ruby_parser::If::begin_l

Location of the then keyword

if foo then; end
^^^^

None if then keyword is omitted

◆ cond

Node* lib_ruby_parser::If::cond

Condition given to the if statement, Lvar("a") for if a; b; else; c; end

◆ else_l

MaybeLoc lib_ruby_parser::If::else_l

Location of the else keyword

if foo; else; end
^^^^

None if there's no else branch

◆ end_l

MaybeLoc lib_ruby_parser::If::end_l

Location of the end keyword

if foo; end
^^^

◆ expression_l

Loc lib_ruby_parser::If::expression_l

Location of the full expression

if a then; b; else; c end
^^^^^^^^^^^^^^^^^^^^^^^^^

◆ if_false

Node* lib_ruby_parser::If::if_false

False-branch of the if statement, Lvar("c") for if a; b; else; c; end

◆ if_true

Node* lib_ruby_parser::If::if_true

True-branch of the if statement, Lvar("b") for if a; b; else; c; end

◆ keyword_l

Loc lib_ruby_parser::If::keyword_l

Location of the if keyword

if foo; end
^^

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