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) (unidiff) | |
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 | |||
@@ -399,97 +399,97 @@ NOIDCHAR [^A-Za-z0-9_] | |||
399 | if(m.output.empty()) { | 399 | if(m.output.empty()) { |
400 | m._name=m._lastid; | 400 | m._name=m._lastid; |
401 | }else{ | 401 | }else{ |
402 | if(!m._lastid.empty()) { // XXX: lastid should never be emtpy, I believe? | 402 | if(!m._lastid.empty()) { // XXX: lastid should never be emtpy, I believe? |
403 | if(!m._type.empty()) m._type += ' '; | 403 | if(!m._type.empty()) m._type += ' '; |
404 | m._type += m._lastid; | 404 | m._type += m._lastid; |
405 | } | 405 | } |
406 | m._name=m.output; | 406 | m._name=m.output; |
407 | m.output.clear(); | 407 | m.output.clear(); |
408 | } | 408 | } |
409 | BEGIN(VARINIT); | 409 | BEGIN(VARINIT); |
410 | if(*yytext!='=') | 410 | if(*yytext!='=') |
411 | unput('\n'); | 411 | unput('\n'); |
412 | } | 412 | } |
413 | } | 413 | } |
414 | <VARINIT>{ | 414 | <VARINIT>{ |
415 | \n{ | 415 | \n{ |
416 | modus_operandi& m = M(); | 416 | modus_operandi& m = M(); |
417 | string::size_type t = m.output.find_first_not_of(" \t"); | 417 | string::size_type t = m.output.find_first_not_of(" \t"); |
418 | if(t!=string::npos) | 418 | if(t!=string::npos) |
419 | m.output.erase(0,t); | 419 | m.output.erase(0,t); |
420 | t = m.output.find_last_not_of(" \t;"); | 420 | t = m.output.find_last_not_of(" \t;"); |
421 | if(t!=string::npos) | 421 | if(t!=string::npos) |
422 | m.output.erase(t+1); | 422 | m.output.erase(t+1); |
423 | member_variables.push_back(member_variable(m._type,m._name,m.output)); | 423 | member_variables.push_back(member_variable(m._type,m._name,m.output)); |
424 | if(!m.output.empty()) | 424 | if(!m.output.empty()) |
425 | have_initializers=true; | 425 | have_initializers=true; |
426 | modi.pop_front(); | 426 | modi.pop_front(); |
427 | BEGIN(INITIAL); | 427 | BEGIN(INITIAL); |
428 | } | 428 | } |
429 | } | 429 | } |
430 | <DECLLINE>\n{ | 430 | <DECLLINE>\n{ |
431 | ECHO; | 431 | ECHO; |
432 | decl += M().output; | 432 | decl += M().output; |
433 | modi.pop_front(); | 433 | modi.pop_front(); |
434 | BEGIN(INITIAL); | 434 | BEGIN(INITIAL); |
435 | } | 435 | } |
436 | <IMPLLINE>\n{ | 436 | <IMPLLINE>\n{ |
437 | ECHO; | 437 | ECHO; |
438 | impl += M().output; | 438 | impl += M().output; |
439 | modi.pop_front(); | 439 | modi.pop_front(); |
440 | BEGIN(INITIAL); | 440 | BEGIN(INITIAL); |
441 | } | 441 | } |
442 | <CLASSLINE>\n{ | 442 | <CLASSLINE>\n{ |
443 | class_name = M().output; | 443 | class_name = M().output; |
444 | modi.pop_front(); | 444 | modi.pop_front(); |
445 | BEGIN(INITIAL); | 445 | BEGIN(INITIAL); |
446 | } | 446 | } |
447 | <CLASSLINE,DECLLINE,IMPLLINE,VARLINE,VARINIT,IMPORTLINE,IMPORTCOMPONENT,CODEMETHODLINE,CODEMETHODARGS,INLINE,METHODLINE,METHODARGS,DECLBLOCK,IMPLBLOCK,CONSTRUCTOR,DESTRUCTOR,CODEMETHODBLOCK,CODELINE,CODEBLOCK,PRAGMALINE>{ | 447 | <CLASSLINE,DECLLINE,IMPLLINE,VARLINE,VARINIT,IMPORTLINE,IMPORTCOMPONENT,CODEMETHODLINE,CODEMETHODARGS,INLINE,METHODLINE,METHODARGS,DECLBLOCK,IMPLBLOCK,CONSTRUCTOR,DESTRUCTOR,CODEMETHODBLOCK,CODELINE,CODEBLOCK,PRAGMALINE,DERIVELINE,DERIVECOMPONENT>{ |
448 | "/*"{ | 448 | "/*"{ |
449 | yy_push_state(SLASHSTAR_COMMENT); | 449 | yy_push_state(SLASHSTAR_COMMENT); |
450 | if(!M().devour_comments()) { | 450 | if(!M().devour_comments()) { |
451 | ECHO; | 451 | ECHO; |
452 | } | 452 | } |
453 | } | 453 | } |
454 | "//"{ | 454 | "//"{ |
455 | yy_push_state(SLASHSLASH_COMMENT); | 455 | yy_push_state(SLASHSLASH_COMMENT); |
456 | if(!M().devour_comments()) { | 456 | if(!M().devour_comments()) { |
457 | ECHO; | 457 | ECHO; |
458 | } | 458 | } |
459 | } | 459 | } |
460 | \" { | 460 | \" { |
461 | yy_push_state(STRING); | 461 | yy_push_state(STRING); |
462 | ECHO; | 462 | ECHO; |
463 | } | 463 | } |
464 | \'\\.\'{ | 464 | \'\\.\'{ |
465 | ECHO; | 465 | ECHO; |
466 | } | 466 | } |
467 | } | 467 | } |
468 | 468 | ||
469 | <INITIAL,METHODBLOCK,OUTPUTBLOCK>{ | 469 | <INITIAL,METHODBLOCK,OUTPUTBLOCK>{ |
470 | \"soft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\\"",2); | 470 | \"soft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\\"",2); |
471 | \nsoft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\n",2); | 471 | \nsoft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\n",2); |
472 | \rsoft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\r",2); | 472 | \rsoft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\r",2); |
473 | \tsoft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\t",2); | 473 | \tsoft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\t",2); |
474 | \bsoft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\b",2); | 474 | \bsoft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\b",2); |
475 | \asoft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\a",2); | 475 | \asoft_anchor(); M().modify(modus_operandi::modus_text); LexerOutput("\\a",2); |
476 | .soft_anchor(); M().modify(modus_operandi::modus_text); ECHO; | 476 | .soft_anchor(); M().modify(modus_operandi::modus_text); ECHO; |
477 | {WHITESPACE}+soft_anchor(); M().modify(modus_operandi::modus_text); ECHO; | 477 | {WHITESPACE}+soft_anchor(); M().modify(modus_operandi::modus_text); ECHO; |
478 | } | 478 | } |
479 | 479 | ||
480 | <DECLBLOCK,IMPLBLOCK,CONSTRUCTOR,DESTRUCTOR,CODEMETHODBLOCK,METHODBLOCK,CODEBLOCK>{ | 480 | <DECLBLOCK,IMPLBLOCK,CONSTRUCTOR,DESTRUCTOR,CODEMETHODBLOCK,METHODBLOCK,CODEBLOCK>{ |
481 | \<\/\%decl\>{ | 481 | \<\/\%decl\>{ |
482 | if(YY_START!=DECLBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); | 482 | if(YY_START!=DECLBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); |
483 | decl += M().output; | 483 | decl += M().output; |
484 | modi.pop_front(); | 484 | modi.pop_front(); |
485 | BEGIN(INITIAL); | 485 | BEGIN(INITIAL); |
486 | } | 486 | } |
487 | \<\/\%impl\>{ | 487 | \<\/\%impl\>{ |
488 | if(YY_START!=IMPLBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); | 488 | if(YY_START!=IMPLBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); |
489 | impl += M().output; | 489 | impl += M().output; |
490 | modi.pop_front(); | 490 | modi.pop_front(); |
491 | BEGIN(INITIAL); | 491 | BEGIN(INITIAL); |
492 | } | 492 | } |
493 | \<\/\%constructor\>{ | 493 | \<\/\%constructor\>{ |
494 | if(YY_START!=CONSTRUCTOR) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); | 494 | if(YY_START!=CONSTRUCTOR) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); |
495 | member_functions.push_back(member_function("","","",M().output)); | 495 | member_functions.push_back(member_function("","","",M().output)); |