]> granicus.if.org Git - onig/commitdiff
refactoring
authorK.Kosako <kkosako0@gmail.com>
Sun, 4 Nov 2018 07:28:14 +0000 (16:28 +0900)
committerK.Kosako <kkosako0@gmail.com>
Sun, 4 Nov 2018 07:28:14 +0000 (16:28 +0900)
src/regparse.c
src/regparse.h

index b6769fdd8014ffd886d3e22bd68bb9a89cb456c0..a96fc588e7547fd3c45e0f7585ea383db85badb4 100644 (file)
@@ -2450,17 +2450,20 @@ node_new_option(OnigOptionType option)
   Node* node = node_new_bag(BAG_OPTION);
   CHECK_NULL_RETURN(node);
   BAG_(node)->o.options = option;
-  BAG_(node)->o.is_no_effect = 0;
   return node;
 }
 
 static Node*
-node_new_no_effect(OnigOptionType option)
+node_new_group(Node* content)
 {
-  Node* node = node_new_bag(BAG_OPTION);
+  Node* node;
+
+  node = node_new();
   CHECK_NULL_RETURN(node);
-  BAG_(node)->o.options = option;
-  BAG_(node)->o.is_no_effect = 1;
+  NODE_SET_TYPE(node, NODE_LIST);
+  NODE_CAR(node) = content;
+  NODE_CDR(node) = NULL_NODE;
+
   return node;
 }
 
@@ -7761,12 +7764,11 @@ parse_exp(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
        Node* target;
 
        target = *np;
-       *np = node_new_no_effect(env->options);
+       *np = node_new_group(target);
        if (IS_NULL(*np)) {
          onig_node_free(target);
          return ONIGERR_MEMORY;
        }
-       NODE_BODY(*np) = target;
       }
     }
     else if (r == 2) { /* option only */
index bb8a6a5f38f0f25f6e14905eef59127e3f3ef4cd..523946497de6667febf887b06a9376c066875dbc 100644 (file)
@@ -123,7 +123,6 @@ typedef struct {
     } m;
     struct {
       OnigOptionType options;
-      int is_no_effect;
     } o;
     struct {
       /* body is condition */