Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
ae845dea
Commit
ae845dea
authored
May 25, 2013
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 700908 - code after \@cond is removed
parent
9a72b1b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
4 deletions
+31
-4
pre.l
src/pre.l
+31
-4
No files found.
src/pre.l
View file @
ae845dea
...
...
@@ -59,6 +59,16 @@
#define DBG_CTX(x) do { } while(0)
#define YY_NEVER_INTERACTIVE 1
struct CondCtx
{
CondCtx(int line,QCString id,bool b)
: lineNr(line),sectionId(id), skip(b) {}
int lineNr;
QCString sectionId;
bool skip;
};
struct FileState
{
FileState(int size) : fileBuf(size),
...
...
@@ -360,7 +370,7 @@ static bool g_isImported;
static QCString g_blockName;
static int g_condCtx;
static bool g_skip;
static QStack<
bool>
g_condStack;
static QStack<
CondCtx>
g_condStack;
static bool g_insideCS; // C# has simpler preprocessor
static bool g_isSource;
...
...
@@ -1613,7 +1623,7 @@ static void startCondSection(const char *sectId)
//printf("startCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
CondParser prs;
bool expResult = prs.parse(g_yyFileName,g_yyLineNr,sectId);
g_condStack.push(new
bool(
g_skip));
g_condStack.push(new
CondCtx(g_yyLineNr,sectId,
g_skip));
if (!expResult)
{
g_skip=TRUE;
...
...
@@ -1629,8 +1639,8 @@ static void endCondSection()
}
else
{
bool
*ctx = g_condStack.pop();
g_skip=
*ctx
;
CondCtx
*ctx = g_condStack.pop();
g_skip=
ctx->skip
;
}
//printf("endCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
}
...
...
@@ -2457,6 +2467,9 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
BEGIN(SkipVerbatim);
}
<SkipCComment,SkipCPPComment>[\\@][\\@]"cond"[ \t]+ { // escaped @cond
outputArray(yytext,(int)yyleng);
}
<SkipCPPComment>[\\@]"cond"[ \t]+ { // conditional section
g_ccomment=TRUE;
g_condCtx=YY_START;
...
...
@@ -2530,6 +2543,12 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<SkipCond>[^\/\!*\\@\n]+ { }
<SkipCond>"//"[/!] { g_ccomment=FALSE; }
<SkipCond>"/*"[*!] { g_ccomment=TRUE; }
<SkipCond,SkipCComment,SkipCPPComment>[\\@][\\@]"endcond"/[^a-z_A-Z0-9] {
if (!g_skip)
{
outputArray(yytext,(int)yyleng);
}
}
<SkipCond>[\\@]"endcond"/[^a-z_A-Z0-9] {
bool oldSkip = g_skip;
endCondSection();
...
...
@@ -3088,6 +3107,14 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
preYYlex();
g_lexInit=TRUE;
while (!g_condStack.isEmpty())
{
CondCtx *ctx = g_condStack.pop();
QCString sectionInfo = " ";
if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label %s ",ctx->sectionId.data());
warn(fileName,ctx->lineNr,"Conditional section%sdoes not have "
"a corresponding \\endcond command within this file.",sectionInfo.data());
}
// make sure we don't extend a \cond with missing \endcond over multiple files (see bug 624829)
forceEndCondSection();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment