Mercurial > hg > Applications > Grep
diff c/regexParser/regexParser.cc @ 152:1c9e8ba64f6a pairPro
add implement charclassMerge (not working)
author | masa |
---|---|
date | Wed, 16 Dec 2015 17:28:53 +0900 |
parents | 6ba059ce9109 |
children |
line wrap: on
line diff
--- a/c/regexParser/regexParser.cc Wed Dec 16 17:09:56 2015 +0900 +++ b/c/regexParser/regexParser.cc Wed Dec 16 17:28:53 2015 +0900 @@ -88,15 +88,12 @@ CharClassPtr insertCharClass(CharClassPtr cc, unsigned long begin, unsigned long end) { if (end < cc->cond.range.begin ) { // 1 - CharClassPtr cc1 = createCharClassRange(cc->cond.range.begin,cc->cond.range.end,cc->left,cc->right); if (cc->left) { - cc1->left = insertCharClass(cc->left,begin,end); - return cc1; + cc->left = insertCharClass(cc->left,begin,end); } else { - CharClassPtr cc2 = createCharClassRange(begin,end,0,0); - cc1->left = cc2; - return cc1; + cc->left = createCharClassRange(begin,end,0,0); } + return cc; } else if (end == cc->cond.range.begin ) { // 2 cc->cond.range.begin = begin; return cc;