From 17314fa144c11a0012c2af35e17dc49c9994edb2 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Thu, 21 Apr 2011 13:34:37 -0500 Subject: [PATCH] Add parser error hint when in doc mode about checking ## comment syntax. --- src/parse.y | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/parse.y b/src/parse.y index 8e8a75cad7..debdf02177 100644 --- a/src/parse.y +++ b/src/parse.y @@ -1622,7 +1622,7 @@ opt_doc_list: int yyerror(const char msg[]) { - char* msgbuf = new char[strlen(msg) + strlen(last_tok) + 64]; + char* msgbuf = new char[strlen(msg) + strlen(last_tok) + 128]; if ( last_tok[0] == '\n' ) sprintf(msgbuf, "%s, on previous line", msg); @@ -1631,6 +1631,10 @@ int yyerror(const char msg[]) else sprintf(msgbuf, "%s, at or near \"%s\"", msg, last_tok); + if ( generate_documentation ) + strcat(msgbuf, "\nDocumentation mode is enabled: " + "remember to check syntax of ## style comments\n"); + error(msgbuf); return 0;