regcomp.c: Move code to common place
authorKarl Williamson <public@khwilliamson.com>
Mon, 28 Feb 2011 00:45:46 +0000 (17:45 -0700)
committerKarl Williamson <public@khwilliamson.com>
Mon, 28 Feb 2011 02:21:32 +0000 (19:21 -0700)
THis is part of the refactoring of the code that sets the alternate array
for multi-char folds.  Changing the node type to ANYOFV can be done at
the last second, in pass 2, as it doesn't change any sizing, etc.

regcomp.c

index a5fd3e5..4e9a098 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -10037,9 +10037,6 @@ parseit:
                            }
 
                            add_alternate(&unicode_alternate, foldbuf, foldlen);
-
-                           /* This node is variable length */
-                           OP(ret) = ANYOFV;
                        end_multi_fold: ;
                        }
                    }
@@ -10269,6 +10266,9 @@ parseit:
        av_store(av, 0, listsv);
        av_store(av, 1, NULL);
        av_store(av, 2, MUTABLE_SV(unicode_alternate));
+       if (unicode_alternate) { /* This node is variable length */
+           OP(ret) = ANYOFV;
+       }
        rv = newRV_noinc(MUTABLE_SV(av));
        n = add_data(pRExC_state, 1, "s");
        RExC_rxi->data->data[n] = (void*)rv;