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

Represents matching with assignment into a local variable (i.e. pattern => var) More...

#include <nodes.hpp>

Public Attributes

String name
 Name of the variable that is assigned if matching succeeds. More...
 
Loc name_l
 
Loc expression_l
 

Detailed Description

Represents matching with assignment into a local variable (i.e. pattern => var)

Member Data Documentation

◆ expression_l

Loc lib_ruby_parser::MatchVar::expression_l

Location of the full expression

case foo; in pattern => bar; end
^^^

Note it can also be produced by a hash pattern

case foo; in { a: }; end
^^

◆ name

String lib_ruby_parser::MatchVar::name

Name of the variable that is assigned if matching succeeds.

◆ name_l

Loc lib_ruby_parser::MatchVar::name_l

Location of the name

case foo; in pattern => bar; end
^^^

Note it can also be produced by a hash pattern

case foo; in { a: }; end
^

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