Ruby 3.4.5p51 (2025-07-16 revision 20cda200d3ce092571d0b5d342dadca69636cb0f)
|
Public APIs related to rb_cSymbol. More...
#include "ruby/internal/attr/const.h"
#include "ruby/internal/attr/nonnull.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/value.h"
Go to the source code of this file.
Functions | |
ID | rb_id_attrset (ID id) |
Calculates an ID of attribute writer. | |
int | rb_is_const_id (ID id) |
Classifies the given ID, then sees if it is a constant. | |
int | rb_is_global_id (ID id) |
Classifies the given ID, then sees if it is a global variable. | |
int | rb_is_instance_id (ID id) |
Classifies the given ID, then sees if it is an instance variable. | |
int | rb_is_attrset_id (ID id) |
Classifies the given ID, then sees if it is an attribute writer. | |
int | rb_is_class_id (ID id) |
Classifies the given ID, then sees if it is a class variable. | |
int | rb_is_local_id (ID id) |
Classifies the given ID, then sees if it is a local variable. | |
int | rb_is_junk_id (ID) |
Classifies the given ID, then sees if it is a junk ID. | |
int | rb_symname_p (const char *str) |
Sees if the passed C string constructs a valid syntactic symbol. | |
VALUE | rb_backref_get (void) |
Queries the last match, or Regexp.last_match, or the $~. | |
void | rb_backref_set (VALUE md) |
Updates $~. | |
VALUE | rb_lastline_get (void) |
Queries the last line, or the $_. | |
void | rb_lastline_set (VALUE str) |
Updates $_. | |
VALUE | rb_sym_all_symbols (void) |
Collects every single bits of symbols that have ever interned in the entire history of the current process. |
Public APIs related to rb_cSymbol.
Definition in file parse.h.
VALUE rb_backref_get | ( | void | ) |
Queries the last match, or Regexp.last_match, or the $~.
You don't have to use it, because in reality you can get $~ using rb_gv_get() as usual.
RUBY_Qnil | The method has not ran a regular expression. |
otherwise | An instance of rb_cMatch. |
Definition at line 1835 of file vm.c.
Referenced by rb_f_global_variables().
void rb_backref_set | ( | VALUE | md | ) |
Updates $~.
You don't have to use it, because in reality you can set $~ using rb_gv_set() as usual.
[in] | md | Arbitrary Ruby object. |
Definition at line 1841 of file vm.c.
Referenced by rb_reg_match2().
int rb_is_attrset_id | ( | ID | id | ) |
int rb_is_class_id | ( | ID | id | ) |
int rb_is_const_id | ( | ID | id | ) |
Classifies the given ID, then sees if it is a constant.
In case an ID is in Unicode (likely), its "constant"-ness is determined if its first character is either upper case or title case. Otherwise it is detected if case- folding the first character changes its case or not.
[in] | id | An id to classify. |
1 | It is a constant. |
0 | It isn't. |
Definition at line 1064 of file symbol.c.
Referenced by rb_define_const().
int rb_is_global_id | ( | ID | id | ) |
int rb_is_instance_id | ( | ID | id | ) |
int rb_is_junk_id | ( | ID | id | ) |
int rb_is_local_id | ( | ID | id | ) |
Classifies the given ID, then sees if it is a local variable.
A local variable starts with a lowercase character, followed by some alphanumeric characters or _, then ends with anything other than !, ?, or =.
[in] | id | An id to classify. |
1 | It is a local variable. |
0 | It isn't. |
VALUE rb_lastline_get | ( | void | ) |
Queries the last line, or the $_.
You don't have to use it, because in reality you can get $_ using rb_gv_get() as usual.
RUBY_Qnil | There has never been a "line" yet. |
otherwise | The last set $_ value. |
Definition at line 1847 of file vm.c.
Referenced by rb_io_print(), and rb_reg_match2().
void rb_lastline_set | ( | VALUE | str | ) |
Updates $_.
You don't have to use it, because in reality you can set $_ using rb_gv_set() as usual.
[in] | str | Arbitrary Ruby object. |
Definition at line 1853 of file vm.c.
Referenced by rb_gets().
VALUE rb_sym_all_symbols | ( | void | ) |
int rb_symname_p | ( | const char * | str | ) |