--- parser3/src/main/pa_string.C 2001/10/16 14:49:16 1.110 +++ parser3/src/main/pa_string.C 2001/10/19 12:43:30 1.112 @@ -4,7 +4,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_string.C,v 1.110 2001/10/16 14:49:16 parser Exp $ + $Id: pa_string.C,v 1.112 2001/10/19 12:43:30 parser Exp $ */ #include "pa_config_includes.h" @@ -153,7 +153,7 @@ String& String::real_append(STRING_APPEN char String::first_char() const { if(!fused_rows) - THROW(0, 0, + throw Exception(0, 0, this, "getting first char of empty string"); @@ -360,10 +360,7 @@ String& String::mid(size_t start, size_t String& result=*NEW String(pool()); start=max(0, start); - if(finish) - finish=min(size(), finish); - else - finish=size(); + finish=min(size(), finish); if(start==finish) return result; @@ -511,7 +508,7 @@ bool String::match(const unsigned char * bool *was_global) const { if(!regexp.size()) - THROW(0, 0, + throw Exception(0, 0, aorigin, "regexp is empty"); const char *pattern=regexp.cstr(UL_AS_IS); @@ -525,14 +522,14 @@ bool String::match(const unsigned char * pcre_tables); if(!code) - THROW(0, 0, + throw Exception(0, 0, ®exp.mid(erroffset, regexp.size()), "regular expression syntax error - %s", errptr); int info_substrings=pcre_info(code, 0, 0); if(info_substrings<0) { pcre_free(code); - THROW(0, 0, + throw Exception(0, 0, aorigin, "pcre_info error (%d)", info_substrings); @@ -572,7 +569,7 @@ bool String::match(const unsigned char * if(exec_substrings<0) { pcre_free(code); - THROW(0, 0, + throw Exception(0, 0, aorigin, "regular expression execute error (%d)", exec_substrings); @@ -620,7 +617,7 @@ String& String::change_case(Pool& pool, b=0; break; default: - PTHROW(0, 0, + throw Exception(0, 0, this, "unknown change case kind #%d", static_cast(kind)); // never @@ -817,7 +814,7 @@ double String::as_double() const { result=(double)strtod(cstr, &error_pos); if(*error_pos/*not EOS*/) - THROW(0, 0, + throw Exception(0, 0, this, "invalid number (double)"); @@ -837,7 +834,7 @@ int String::as_int() const { result=(int)strtol(cstr, &error_pos, 0); if(*error_pos/*not EOS*/) - THROW(0, 0, + throw Exception(0, 0, this, "invalid number (int)");