From 00da27677ab8b2c201aeed21b0f19a993ce10d4f Mon Sep 17 00:00:00 2001 From: Andy Heninger Date: Wed, 20 Nov 2002 23:30:20 +0000 Subject: [PATCH] ICU-105 Regular Expressions, improved formatting of debug output. X-SVN-Rev: 10306 --- icu4c/source/i18n/regeximp.h | 2 +- icu4c/source/i18n/repattrn.cpp | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/icu4c/source/i18n/regeximp.h b/icu4c/source/i18n/regeximp.h index b176ed54c0..f55834f244 100644 --- a/icu4c/source/i18n/regeximp.h +++ b/icu4c/source/i18n/regeximp.h @@ -17,7 +17,7 @@ // debugging support. Enable one or more of the #defines immediately following // //#define REGEX_SCAN_DEBUG -#define REGEX_DUMP_DEBUG +//#define REGEX_DUMP_DEBUG //#define REGEX_RUN_DEBUG // End of #defines inteded to be directly set. diff --git a/icu4c/source/i18n/repattrn.cpp b/icu4c/source/i18n/repattrn.cpp index 46268e6552..f19f4a599f 100644 --- a/icu4c/source/i18n/repattrn.cpp +++ b/icu4c/source/i18n/repattrn.cpp @@ -447,7 +447,6 @@ void RegexPattern::dumpOp(int32_t index) const { case URX_START_CAPTURE: case URX_END_CAPTURE: - case URX_STATIC_SETREF: case URX_STATE_SAVE: case URX_JMP: case URX_BACKSLASH_B: @@ -481,7 +480,6 @@ void RegexPattern::dumpOp(int32_t index) const { case URX_SETREF: { - REGEX_DUMP_DEBUG_PRINTF("%d ", val); UnicodeString s; UnicodeSet *set = (UnicodeSet *)fSets->elementAt(val); set->toPattern(s, TRUE); @@ -489,7 +487,22 @@ void RegexPattern::dumpOp(int32_t index) const { REGEX_DUMP_DEBUG_PRINTF("%c", s.charAt(i)); } } + break; + case URX_STATIC_SETREF: + { + UnicodeString s; + if (val & URX_NEG_SET) { + REGEX_DUMP_DEBUG_PRINTF("NOT "); + val &= ~URX_NEG_SET; + } + UnicodeSet *set = fStaticSets[val]; + set->toPattern(s, TRUE); + for (int32_t i=0; i