diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2011-10-27 18:00:16 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2011-10-27 18:00:16 (GMT) |
commit | 8491e9fbd06ef8a8f1cc542a524c673d7781d4b6 (patch) | |
tree | 7c1bfd20df6135fa1aac607ebe1a46d31d7f4b65 /src/scanner.l | |
parent | 3af6ff4c3d2748b45f468695a3db9f26eef4e630 (diff) | |
download | Doxygen-8491e9fbd06ef8a8f1cc542a524c673d7781d4b6.zip Doxygen-8491e9fbd06ef8a8f1cc542a524c673d7781d4b6.tar.gz Doxygen-8491e9fbd06ef8a8f1cc542a524c673d7781d4b6.tar.bz2 |
Release-1.7.5.1-20111027
Diffstat (limited to 'src/scanner.l')
-rw-r--r-- | src/scanner.l | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/scanner.l b/src/scanner.l index cf07d47..cf6d538 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -173,6 +173,7 @@ static QCString idlProp; static bool g_lexInit = FALSE; static bool externC; +static QCString g_hereDocId; //----------------------------------------------------------------------------- @@ -695,6 +696,8 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) %x CopyArgComment %x CopyArgCommentLine %x CopyArgVerbatim +%x HereDoc +%x HereDocEnd %x IDLAttribute %x IDLProp @@ -1822,6 +1825,16 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) else BEGIN( EndTemplate ); } +<EndTemplate>"<<<" { + if (!insidePHP) + { + REJECT; + } + else + { + BEGIN(HereDoc); + } + } <ClassTemplSpec,EndTemplate>"<<" { current->name+=yytext; // *currentTemplateSpec+=yytext; @@ -1901,6 +1914,20 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) else REJECT; } +<HereDoc>{ID} { // PHP heredoc + g_hereDocId = yytext; + BEGIN(HereDocEnd); + } +<HereDoc>"'"{ID}/"'" { // PHP nowdoc + g_hereDocId = &yytext[1]; + } +<HereDocEnd>^{ID} { // id at start of the line could mark the end of the block + if (g_hereDocId==yytext) // it is the end marker + { + BEGIN(FindMembers); + } + } +<HereDocEnd>. { } <FindMembers>"Q_OBJECT" { // Qt object macro } <FindMembers>"Q_PROPERTY" { // Qt property declaration @@ -2387,7 +2414,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) } } } -<FindMembers,FindFields,ReadInitializer>"//"([!/]?){B}*{CMD}"}".*|"/*"([!*]?){B}*{CMD}"}".*"*/" { +<FindMembers,FindFields,ReadInitializer>"//"([!/]?){B}*{CMD}"}".*|"/*"([!*]?){B}*{CMD}"}"[^*]*"*/" { closeGroup(current,yyFileName,yyLineNr); } <FindMembers>"=" { // in PHP code this could also be due to "<?=" @@ -5537,7 +5564,14 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) <SkipCxxComment>.*"\\\n" { // line continuation - yyLineNr++; + if (insideCS) + { + REJECT; + } + else + { + yyLineNr++; + } } <SkipCxxComment>.*/\n { BEGIN( lastCContext ) ; |