--- parser3/src/main/compile.y 2001/02/25 08:50:13 1.39 +++ parser3/src/main/compile.y 2001/02/25 09:42:04 1.41 @@ -1,5 +1,5 @@ /* - $Id: compile.y,v 1.39 2001/02/25 08:50:13 paf Exp $ + $Id: compile.y,v 1.41 2001/02/25 09:42:04 paf Exp $ */ %{ @@ -258,8 +258,9 @@ class_method_name: STRING ':' name_advan String& name=*SLA2S($1); VClass *vclass=static_cast(PC->request->classes().get(name)); if(!vclass) { - strcpy(PC->error, name.cstr()); - strcat(PC->error, ": undefined class in call"); + strcat(PC->error, "'"); + strcat(PC->error, name.cstr()); + strcat(PC->error, "' class is undefined in call"); YYERROR; } $$=CL(vclass); @@ -409,21 +410,23 @@ int yylex(YYSTYPE *lvalp, void *pc) { } else PC->col++; - /* escaping: ^^ ^$ ^; ^) ^} ^( ^{ */ + // escaping: ^^ ^$ ^; ^) ^} ^( ^{ if(c=='^') { - char pending_c=*PC->source; + char next_c=*PC->source; - if(pending_c=='^' || pending_c=='$' || pending_c==';' || - pending_c=='(' || pending_c==')' || - pending_c=='{' || pending_c=='}') { - /* append piece till ^ */ - PC->string->APPEND(begin, end-begin, PC->file, begin_line); - /* reset piece 'start' position & line */ - begin=PC->source/*^*/; + if(next_c=='^' || next_c=='$' || next_c==';' || + next_c=='(' || next_c==')' || + next_c=='{' || next_c=='}') { + if(end!=begin) { + // append piece till ^ + PC->string->APPEND(begin, end-begin, PC->file, begin_line); + } + // reset piece 'start' position & line + begin=PC->source; // ^ begin_line=PC->line; - /* skip over ^ and _ */ - PC->source+=2; - /* skip analysis = forced literal */ + // skip over ^ and _ + PC->source++; + // skip analysis = forced literal continue; } }