--- parser3/src/main/compile.y 2001/10/10 12:22:17 1.170 +++ parser3/src/main/compile.y 2001/10/18 06:52:05 1.172 @@ -5,7 +5,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: compile.y,v 1.170 2001/10/10 12:22:17 parser Exp $ + $Id: compile.y,v 1.172 2001/10/18 06:52:05 parser Exp $ */ /** @@ -59,6 +59,7 @@ static int yylex(YYSTYPE *lvalp, void *p %token BAD_STRING_COMPARISON_OPERATOR %token BAD_HEX_LITERAL +%token BAD_METHOD_DECL_START %token LAND "&&" %token LOR "||" @@ -584,7 +585,14 @@ static int yylex(YYSTYPE *lvalp, void *p } else PC.col++; - if(c=='^') + if(c=='@' && PC.col==0+1) { + if(PC.ls==LS_USER) { + push_LS(PC, LS_DEF_NAME); + RC; + } else // @ in first column inside some code + result=BAD_METHOD_DECL_START; + goto break2; + } else if(c=='^') switch(PC.ls) { case LS_EXPRESSION_VAR_NAME_WITH_COLON: case LS_EXPRESSION_VAR_NAME_WITHOUT_COLON: @@ -603,7 +611,7 @@ default: case '(': case ')': case '[': case ']': case '{': case '}': - case '"': + case '"': case ':': if(end!=begin) { // append piece till ^ PC.string->APPEND_CLEAN(begin, end-begin, PC.file, begin_line); @@ -683,12 +691,6 @@ default: case '^': push_LS(PC, LS_METHOD_NAME); RC; - case '@': - if(PC.col==0+1) { - push_LS(PC, LS_DEF_NAME); - RC; - } - break; case ']': if(PC.ls==LS_NAME_SQUARE_PART) if(--lexical_brackets_nestage==0) {// $name.[co<]?>de<]?>