--- parser3/src/main/compile.y 2008/05/30 12:27:44 1.223 +++ parser3/src/main/compile.y 2008/06/17 15:51:25 1.225 @@ -5,7 +5,7 @@ Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: compile.y,v 1.223 2008/05/30 12:27:44 misha Exp $ + $Id: compile.y,v 1.225 2008/06/17 15:51:25 misha Exp $ */ /** @@ -151,12 +151,14 @@ control_method: '@' STRING '\n' YYERROR; } if(command==CLASS_NAME) { + /* if(PC.cclass->base_class()) { // already changed from default? strcpy(PC.error, "class already have a name '"); strncat(PC.error, PC.cclass->name().cstr(), 100); strcat(PC.error, "'"); YYERROR; } + */ if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { // new class' name const String& name=*LA2S(*strings_code); @@ -166,6 +168,7 @@ control_method: '@' STRING '\n' PC.cclass->set_name(name); // append to request's classes PC.request.classes().put(name, cclass); + *PC.cclasses+=cclass; } else { strcpy(PC.error, "@"CLASS_NAME" must contain only one line with class name (contains more then one)"); YYERROR; @@ -1094,14 +1097,18 @@ default: case 'd': if(end==begin) // right after whitespace if(pc.source[0]=='e' && pc.source[1]=='f') { // def - skip_analized=2; - result=DEF; - goto break2; + switch(pc.source[2]){ + case ' ': case '\t': case '\n': case '"': case '\'': case '^': case '$': // non-quoted string without whitespace after 'def' is not allowed + skip_analized=2; + result=DEF; + goto break2; + } + // error: incorrect char after 'def' } break; case 't': if(end==begin) // right after whitespace - if(pc.source[0]=='r' && pc.source[1]=='u' && pc.source[2]=='e') { // def + if(pc.source[0]=='r' && pc.source[1]=='u' && pc.source[2]=='e') { // true skip_analized=3; result=LITERAL_TRUE; goto break2; @@ -1109,7 +1116,7 @@ default: break; case 'f': if(end==begin) // right after whitespace - if(pc.source[0]=='a' && pc.source[1]=='l' && pc.source[2]=='s' && pc.source[3]=='e') { // def + if(pc.source[0]=='a' && pc.source[1]=='l' && pc.source[2]=='s' && pc.source[3]=='e') { // false skip_analized=4; result=LITERAL_FALSE; goto break2;