diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-05-27 15:57:38 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-06-02 09:43:33 +0900 |
commit | 2889ed1bcbd9b068239c6e981e46eb7bc406009a () | |
tree | 2a4f359575796f5e3d5d4bd435eac9c6a1386afc | |
parent | cedc7737b6a614de1ee2aaa8d66bbca217d9fa8f (diff) |
Use `RNode_DREGX` variable for debuggers
At least LLDB needs an actual variable not only casts to access the type in debugger sessions.
-rw-r--r-- | parse.y | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -13192,15 +13192,17 @@ new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc) case NODE_DSTR: nd_set_type(node, NODE_DREGX); nd_set_loc(node, loc); - RNODE_DREGX(node)->as.nd_cflag = options & RE_OPTION_MASK; - if (RNODE_DREGX(node)->string) reg_fragment_check(p, RNODE_DREGX(node)->string, options); - for (list = RNODE_DREGX(prev = node)->nd_next; list; list = RNODE_LIST(list->nd_next)) { NODE *frag = list->nd_head; enum node_type type = nd_type(frag); if (type == NODE_STR || (type == NODE_DSTR && !RNODE_DSTR(frag)->nd_next)) { rb_parser_string_t *tail = RNODE_STR(frag)->string; if (reg_fragment_check(p, tail, options) && prev && RNODE_DREGX(prev)->string) { - rb_parser_string_t *lit = prev == node ? RNODE_DREGX(prev)->string : RNODE_STR(RNODE_LIST(prev)->nd_head)->string; if (!literal_concat0(p, lit, tail)) { return NEW_NIL(loc); /* dummy node on error */ } @@ -13218,9 +13220,9 @@ new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc) prev = 0; } } - if (!RNODE_DREGX(node)->nd_next) { /* Check string is valid regex */ - reg_compile(p, RNODE_DREGX(node)->string, options); } if (options & RE_OPTION_ONCE) { node = NEW_ONCE(node, loc); |