author | Michael Krelin <hacker@klever.net> | 2005-04-03 11:49:46 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2005-04-03 11:49:46 (UTC) |
commit | f2ddc6833252f106cf9aa589bc13216ba25ee4e6 (patch) (side-by-side diff) | |
tree | 70187b30b79a3c850e8017337d1d1dc4918a06e5 /lib/sitecing_parser.ll | |
parent | 67b825ecb491066424b7e48f864c0b76b4156b28 (diff) | |
download | sitecing-f2ddc6833252f106cf9aa589bc13216ba25ee4e6.zip sitecing-f2ddc6833252f106cf9aa589bc13216ba25ee4e6.tar.gz sitecing-f2ddc6833252f106cf9aa589bc13216ba25ee4e6.tar.bz2 |
bugfix: comments weren't discarded in "derive" line
-rw-r--r-- | lib/sitecing_parser.ll | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sitecing_parser.ll b/lib/sitecing_parser.ll index 9514ce4..4fd6709 100644 --- a/lib/sitecing_parser.ll +++ b/lib/sitecing_parser.ll @@ -383,129 +383,129 @@ NOIDCHAR [^A-Za-z0-9_] m._lastid = m.output; m.output.clear(); } } \* { modus_operandi& m = M(); ECHO; if(!m._lastid.empty()) { if(!m._type.empty()) m._type += ' '; m._type += m._lastid; } m._lastid = m.output; m.output.clear(); } \;|\n|\= { modus_operandi& m = M(); if(m.output.empty()) { m._name=m._lastid; }else{ if(!m._lastid.empty()) { // XXX: lastid should never be emtpy, I believe? if(!m._type.empty()) m._type += ' '; m._type += m._lastid; } m._name=m.output; m.output.clear(); } BEGIN(VARINIT); if(*yytext!='=') unput('\n'); } } <VARINIT>{ \n { modus_operandi& m = M(); string::size_type t = m.output.find_first_not_of(" \t"); if(t!=string::npos) m.output.erase(0,t); t = m.output.find_last_not_of(" \t;"); if(t!=string::npos) m.output.erase(t+1); member_variables.push_back(member_variable(m._type,m._name,m.output)); if(!m.output.empty()) have_initializers=true; modi.pop_front(); BEGIN(INITIAL); } } <DECLLINE>\n { ECHO; decl += M().output; modi.pop_front(); BEGIN(INITIAL); } <IMPLLINE>\n { ECHO; impl += M().output; modi.pop_front(); BEGIN(INITIAL); } <CLASSLINE>\n { class_name = M().output; modi.pop_front(); BEGIN(INITIAL); } -<CLASSLINE,DECLLINE,IMPLLINE,VARLINE,VARINIT,IMPORTLINE,IMPORTCOMPONENT,CODEMETHODLINE,CODEMETHODARGS,INLINE,METHODLINE,METHODARGS,DECLBLOCK,IMPLBLOCK,CONSTRUCTOR,DESTRUCTOR,CODEMETHODBLOCK,CODELINE,CODEBLOCK,PRAGMALINE>{ +<CLASSLINE,DECLLINE,IMPLLINE,VARLINE,VARINIT,IMPORTLINE,IMPORTCOMPONENT,CODEMETHODLINE,CODEMETHODARGS,INLINE,METHODLINE,METHODARGS,DECLBLOCK,IMPLBLOCK,CONSTRUCTOR,DESTRUCTOR,CODEMETHODBLOCK,CODELINE,CODEBLOCK,PRAGMALINE,DERIVELINE,DERIVECOMPONENT>{ "/*" { yy_push_state(SLASHSTAR_COMMENT); if(!M().devour_comments()) { ECHO; } } "//" { yy_push_state(SLASHSLASH_COMMENT); if(!M().devour_comments()) { ECHO; } } \" { yy_push_state(STRING); ECHO; } \'\\.\' { ECHO; } } <INITIAL,METHODBLOCK,OUTPUTBLOCK>{ \" soft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\\"",2); \n soft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\n",2); \r soft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\r",2); \t soft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\t",2); \b soft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\b",2); \a soft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\a",2); . soft_anchor(); M().modify(modus_operandi::modus_text); ECHO; {WHITESPACE}+ soft_anchor(); M().modify(modus_operandi::modus_text); ECHO; } <DECLBLOCK,IMPLBLOCK,CONSTRUCTOR,DESTRUCTOR,CODEMETHODBLOCK,METHODBLOCK,CODEBLOCK>{ \<\/\%decl\> { if(YY_START!=DECLBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); decl += M().output; modi.pop_front(); BEGIN(INITIAL); } \<\/\%impl\> { if(YY_START!=IMPLBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); impl += M().output; modi.pop_front(); BEGIN(INITIAL); } \<\/\%constructor\> { if(YY_START!=CONSTRUCTOR) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); member_functions.push_back(member_function("","","",M().output)); have_constructor = true; modi.pop_front(); BEGIN(INITIAL); } \<\/\%destructor\> { if(YY_START!=DESTRUCTOR) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); member_functions.push_back(member_function("","~","",M().output)); modi.pop_front(); BEGIN(INITIAL); } \<\/\%codemethod\> { if(YY_START!=CODEMETHODBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); modus_operandi& m = M(); member_functions.push_back(member_function(m._type,m._name,m._args,m.output)); modi.pop_front(); BEGIN(INITIAL); |