6629bda6c730982c3e4602ec78ff3b0cbf701c61 braney Tue May 25 17:31:38 2021 -0700 implement cart editing. Needs doc. ;-) diff --git src/lib/regexHelper.c src/lib/regexHelper.c index 6d1c9bd..6f3ced4 100644 --- src/lib/regexHelper.c +++ src/lib/regexHelper.c @@ -124,30 +124,35 @@ * that's not the desired behavior for unmatched substr. */ { int val = 0; if (regexSubstrMatched(substr)) { int len = substr.rm_eo - substr.rm_so; char buf[len+1]; regexSubstringCopy(string, substr, buf, sizeof(buf)); val = atoi(buf); } else val = 0; return val; } +#ifdef NOTNOW +/* THIS CODE DOESN'T PARSE REGULAR EXPRESSIONS CORRECTLY IN THAT + * IT ASSUMES THAT THE ORDER OF PARENTHETICAL EXPRESSIONS IN THE OUTPUT + * IS THE SAME ORDER THEY APPEAR IN THE INPUT + */ static struct regexSnippet *parseSnippets(char *input) /* Generate a data structure that describes how the parenthetical * regular expressions should be substituted in the output. */ { char *in = input; struct regexSnippet *out = NULL; char *prev = input; for(;;) { if ((*in == 0) || ((*in == '\\') && isdigit(in[1]))) { struct regexSnippet *snippet; AllocVar(snippet); @@ -282,15 +287,16 @@ char *regexEdit(struct regexEdit *editArray, unsigned numEdits, char *input, boolean quiet) /* Perform a list of edits on a string. */ { struct regexCompiledEdit *compiledEdits = compileEdits(editArray, numEdits, quiet); if (compiledEdits == NULL) return FALSE; char *outString = input; for(; numEdits && outString; compiledEdits++, numEdits--) outString = doOneEdit(compiledEdits, outString, quiet); return outString; } +#endif