summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lexscanner.l15
-rw-r--r--src/scanner.l17
2 files changed, 27 insertions, 5 deletions
diff --git a/src/lexscanner.l b/src/lexscanner.l
index 2b6b3a0..44219f3 100644
--- a/src/lexscanner.l
+++ b/src/lexscanner.l
@@ -709,10 +709,18 @@ NONLopt [^\n]*
<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
yyextra->cCodeBuffer += yytext;
yyextra->docBlockName=&yytext[1];
+ if (yyextra->docBlockName.at(1)=='[')
+ {
+ yyextra->docBlockName.at(1)=']';
+ }
if (yyextra->docBlockName.at(1)=='{')
{
yyextra->docBlockName.at(1)='}';
}
+ if (yyextra->docBlockName.at(1)=='(')
+ {
+ yyextra->docBlockName.at(1)=')';
+ }
yyextra->fencedSize=0;
yyextra->nestedComment=FALSE;
BEGIN(DocCopyBlock);
@@ -777,11 +785,14 @@ NONLopt [^\n]*
}
<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
yyextra->cCodeBuffer += yytext;
- BEGIN(DocBlock);
+ if (yyextra->docBlockName==&yytext[1])
+ {
+ BEGIN(DocBlock);
+ }
}
<DocCopyBlock>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
yyextra->cCodeBuffer += yytext;
- if (&yytext[4]==yyextra->docBlockName)
+ if (yyextra->docBlockName==&yytext[4])
{
BEGIN(DocBlock);
}
diff --git a/src/scanner.l b/src/scanner.l
index 00fa3b4..3a927be 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -4543,7 +4543,7 @@ NONLopt [^\n]*
yyextra->docBlockName=&yytext[1];
if (yyextra->docBlockName.at(1)=='[')
{
- yyextra->docBlockName.at(1)='}';
+ yyextra->docBlockName.at(1)=']';
}
if (yyextra->docBlockName.at(1)=='{')
{
@@ -4558,7 +4558,7 @@ NONLopt [^\n]*
}
<CopyArgVerbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endcode"|"f$"|"f]"|"f}"|"f)")/[^a-z_A-Z0-9\-] { // end of verbatim block
yyextra->fullArgString+=yytext;
- if (yytext[1]=='f') // end of formula
+ if (yytext[1]=='f' && yyextra->docBlockName==&yytext[1])
{
BEGIN(CopyArgCommentLine);
}
@@ -6556,10 +6556,18 @@ NONLopt [^\n]*
<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
yyextra->docBlock << yytext;
yyextra->docBlockName=&yytext[1];
+ if (yyextra->docBlockName.at(1)=='[')
+ {
+ yyextra->docBlockName.at(1)=']';
+ }
if (yyextra->docBlockName.at(1)=='{')
{
yyextra->docBlockName.at(1)='}';
}
+ if (yyextra->docBlockName.at(1)=='(')
+ {
+ yyextra->docBlockName.at(1)=')';
+ }
yyextra->fencedSize=0;
yyextra->nestedComment=FALSE;
BEGIN(DocCopyBlock);
@@ -6637,7 +6645,10 @@ NONLopt [^\n]*
}
<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
yyextra->docBlock << yytext;
- BEGIN(DocBlock);
+ if (yyextra->docBlockName==&yytext[1])
+ {
+ BEGIN(DocBlock);
+ }
}
<DocCopyBlock>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
yyextra->docBlock << yytext;