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

Represents a case statement (for pattern matching see CaseMatch node) More...

#include <nodes.hpp>

Public Attributes

Nodeexpr
 
NodeList when_bodies
 A list of When nodes (each has patterns and body) More...
 
Nodeelse_body
 Body of the else branch, None if there's no else branch. More...
 
Loc keyword_l
 
MaybeLoc else_l
 
Loc end_l
 
Loc expression_l
 

Detailed Description

Represents a case statement (for pattern matching see CaseMatch node)

Member Data Documentation

◆ else_body

Node* lib_ruby_parser::Case::else_body

Body of the else branch, None if there's no else branch.

◆ else_l

MaybeLoc lib_ruby_parser::Case::else_l

Location of the else keyword

case 1; else; end
^^^^

None if there's no else branch

◆ end_l

Loc lib_ruby_parser::Case::end_l

Location of the end keyword

case 1; end
^^^

◆ expr

Node* lib_ruby_parser::Case::expr

Expression given to case, Int("1") for case 1; end None for code like

case
when pattern
end

◆ expression_l

Loc lib_ruby_parser::Case::expression_l

Location of the full expression

case 1; end
^^^^^^^^^^^

◆ keyword_l

Loc lib_ruby_parser::Case::keyword_l

Location of the case keyword

case 1; end
^^^^

◆ when_bodies

NodeList lib_ruby_parser::Case::when_bodies

A list of When nodes (each has patterns and body)


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