--- parser3/src/classes/op.C 2002/04/18 14:00:54 1.92 +++ parser3/src/classes/op.C 2002/04/29 06:27:29 1.94 @@ -4,7 +4,7 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - $Id: op.C,v 1.92 2002/04/18 14:00:54 paf Exp $ + $Id: op.C,v 1.94 2002/04/29 06:27:29 paf Exp $ */ #include "classes.h" @@ -196,9 +196,9 @@ static void _for(Request& r, const Strin bool need_delim=false; VInt *vint=new(pool) VInt(pool, 0); + r.root->put_element(var_name, vint); for(int i=from; i<=to; i++) { vint->set_int(i); - r.root->put_element(var_name, vint); StringOrValue processed_body=r.process(body_code); if(delim_maybe_code) { // delimiter set? @@ -533,7 +533,7 @@ static void _cache(Request& r, const Str VHash& exception2vhash(Pool& pool, const Exception& e) { VHash& result=*new(pool) VHash(pool); Hash& hash=result.hash(0); - if(const char *type=e.type()) + if(const char *type=e.type(true)) hash.put(*exception_type_part_name, new(pool) VString(*new(pool) String(pool, type))); if(const String *asource=e.problem_source()) { String& source=*new(pool) String(pool); @@ -548,7 +548,7 @@ VHash& exception2vhash(Pool& pool, const new(pool) VInt(pool, 1+origin.line)); #endif } - if(const char *ecomment=e.comment()) { + if(const char *ecomment=e.comment(true)) { int comment_size=strlen(ecomment); char *pcomment=(char *)pool.malloc(comment_size); memcpy(pcomment, ecomment, comment_size); @@ -629,7 +629,7 @@ static void _throw_operator(Request& r, const char *type=params->as_string(0, "type must be string").cstr(); const String& source=params->as_string(1, "source must be string"); const char *comment=params->size()>2?params->as_string(2, "comment must be string").cstr():0; - throw Exception(type, &source, comment); + throw Exception(type, &source, "%s", comment); } }