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

#include <nodes.hpp>

Public Attributes

Nodere
 Given regex. More...
 
Loc expression_l
 

Detailed Description

Represents implicit matching using if /regex/

if /.*&zwj;/
puts 'true'
else
puts 'false'
end

Prints "false".

Under the hood this construction matches regex against $_, so the following works:

$_ = 'match_me'
if /match_me/
puts 'true'
else
puts 'false'
end

this code prints "true".

Member Data Documentation

◆ expression_l

Loc lib_ruby_parser::MatchCurrentLine::expression_l

Location of the regex

if /re/; end
^^^^

Technically this location is redundant, but keeping it is the only way to have the same interface for all nodes.

◆ re

Node* lib_ruby_parser::MatchCurrentLine::re

Given regex.


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