diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2010-06-15 11:11:10 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2010-06-15 11:11:10 (GMT) |
commit | 0c6ee149829948582e5e5c1b96c8b3105b02672a (patch) | |
tree | b47b3252c432a415bf772add061e451f5782d6c7 /src/pre.l | |
parent | a1528245b280f1068daad8cd850ea345a3f8b568 (diff) | |
download | Doxygen-0c6ee149829948582e5e5c1b96c8b3105b02672a.zip Doxygen-0c6ee149829948582e5e5c1b96c8b3105b02672a.tar.gz Doxygen-0c6ee149829948582e5e5c1b96c8b3105b02672a.tar.bz2 |
Release-1.7.0
Diffstat (limited to 'src/pre.l')
-rw-r--r-- | src/pre.l | 29 |
1 files changed, 25 insertions, 4 deletions
@@ -131,7 +131,7 @@ static void setFileName(const char *name) //printf("setFileName(%s) g_yyFileName=%s g_yyFileDef=%p\n", // name,g_yyFileName.data(),g_yyFileDef); if (g_yyFileDef && g_yyFileDef->isReference()) g_yyFileDef=0; - g_insideCS = g_yyFileName.right(3)==".cs"; + g_insideCS = getLanguageFromFileName(g_yyFileName)==SrcLangExt_CSharp; } static void incrLevel() @@ -1365,6 +1365,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) %x Command %x SkipCommand %x SkipLine +%x SkipString %x CopyLine %x CopyString %x Include @@ -1822,13 +1823,17 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) BEGIN(SkipLine); } <SkipCommand>. -<SkipLine>[^/\n]+ +<SkipLine>[^'"/\n]+ +<SkipLine>{CHARLIT} { } +<SkipLine>\" { + BEGIN(SkipString); + } <SkipLine>. -<SkipLine,SkipCommand,SkipCPPBlock>"//"[^\n]* { +<SkipLine,SkipCommand,SkipCPPBlock,SkipString>"//"[^\n]* { g_lastCPPContext=YY_START; BEGIN(RemoveCPPComment); } -<SkipLine,SkipCommand,SkipCPPBlock>"/*"/[^\n]* { +<SkipLine,SkipCommand,SkipCPPBlock,SkipString>"/*"/[^\n]* { g_lastCContext=YY_START; BEGIN(RemoveCComment); } @@ -1837,6 +1842,12 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) g_yyLineNr++; BEGIN(SkipCPPBlock); } +<SkipString>[^"\\\n]+ { } +<SkipString>\\. { } +<SkipString>\" { + BEGIN(SkipLine); + } +<SkipString>. { } <IncludeID>{ID}{B}*/"(" { g_nospaces=TRUE; g_roundCount=0; @@ -2104,6 +2115,16 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) g_defLitText+=yytext; g_defText+=' '; } +<RemoveCComment>"*/"{B}*"#" { // see bug 594021 for a usecase for this rule + if (g_lastCContext==SkipCPPBlock) + { + BEGIN(SkipCommand); + } + else + { + REJECT; + } + } <RemoveCComment>"*/" { BEGIN(g_lastCContext); } <RemoveCComment>"//" <RemoveCComment>"/*" |