mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
Checks for multiline comments right of #el..., changes message for a certain case of a comment following a right of code comment
This commit is contained in:
committed by
patacongo
parent
a506012074
commit
0b4ffa20a8
+14
-3
@@ -969,8 +969,11 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
rhcomment = -1;
|
rhcomment = -1;
|
||||||
|
|
||||||
if (ncomment > 0 && !strncmp(&line[ii], "if", 2))
|
if (ncomment > 0 && (!strncmp(&line[ii], "if", 2)
|
||||||
|
|| !strncmp(&line[ii], "el", 2)))
|
||||||
{
|
{
|
||||||
|
/* in #if... and #el.. */
|
||||||
|
|
||||||
ERROR("No multiline comment right of code allowed here",
|
ERROR("No multiline comment right of code allowed here",
|
||||||
lineno, n);
|
lineno, n);
|
||||||
}
|
}
|
||||||
@@ -1445,8 +1448,16 @@ int main(int argc, char **argv, char **envp)
|
|||||||
if (prevrhcmt > 0 && n != prevrhcmt)
|
if (prevrhcmt > 0 && n != prevrhcmt)
|
||||||
{
|
{
|
||||||
rhcomment = prevrhcmt;
|
rhcomment = prevrhcmt;
|
||||||
WARN("Wrong column position of comment right of code",
|
if (n != indent)
|
||||||
lineno, n);
|
{
|
||||||
|
WARN("Wrong column position of "
|
||||||
|
"comment right of code", lineno, n);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ERROR("Wrong column position or missing "
|
||||||
|
"blank line before comment", lineno, n);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user