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

Represents a case statement used for pattern matching (for regular case see Case node) More...

#include <nodes.hpp>

Public Attributes

Nodeexpr
 
NodeList in_bodies
 A list of InPattern nodes (each has pattern, guard 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 used for pattern matching (for regular case see Case node)

Member Data Documentation

◆ else_body

Node* lib_ruby_parser::CaseMatch::else_body

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

◆ else_l

MaybeLoc lib_ruby_parser::CaseMatch::else_l

Location of the else keyword

case 1; in 2; else; end
^^^^

None if there's no else branch

◆ end_l

Loc lib_ruby_parser::CaseMatch::end_l

Location of the end keyword

case 1; in 2; end
^^^

◆ expr

Node* lib_ruby_parser::CaseMatch::expr

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

case
in pattern
end

◆ expression_l

Loc lib_ruby_parser::CaseMatch::expression_l

Location of the full expression

case 1; in 2; end
^^^^^^^^^^^^^^^^^

◆ in_bodies

NodeList lib_ruby_parser::CaseMatch::in_bodies

A list of InPattern nodes (each has pattern, guard and body)

◆ keyword_l

Loc lib_ruby_parser::CaseMatch::keyword_l

Location of the case keyword

case 1; in 2; end
^^^^

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