mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Introduce NODE_REGX to manage regexp literal
This commit is contained in:
parent
97d4363d3b
commit
e7ab5d891c
10 changed files with 283 additions and 52 deletions
|
@ -1,5 +1,6 @@
|
|||
/* This is a wrapper for parse.y */
|
||||
|
||||
#include "internal/re.h"
|
||||
#include "internal/ruby_parser.h"
|
||||
|
||||
#include "node.h"
|
||||
|
@ -1010,6 +1011,16 @@ rb_node_dregx_string_val(const NODE *node)
|
|||
return rb_str_new_parser_string(str);
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_node_regx_string_val(const NODE *node)
|
||||
{
|
||||
rb_node_regx_t *node_reg = RNODE_REGX(node);
|
||||
rb_parser_string_t *string = node_reg->string;
|
||||
VALUE str = rb_enc_str_new(string->ptr, string->len, string->enc);
|
||||
|
||||
return rb_reg_compile(str, node_reg->options, NULL, 0);
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_node_line_lineno_val(const NODE *node)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue