diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-11-20 20:31:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-20 20:31:42 (GMT) |
commit | 696f23776e63cfd3e1a57899c0e5cecf5369e688 (patch) | |
tree | 2725c80974e94ab80a3f4033685e7a3e24415164 | |
parent | a5792da8b4bf88a9d93cfd0582cec469747de3b2 (diff) | |
parent | a51a6d4845f8a8220700883db7c786a0007f1094 (diff) | |
download | Doxygen-696f23776e63cfd3e1a57899c0e5cecf5369e688.zip Doxygen-696f23776e63cfd3e1a57899c0e5cecf5369e688.tar.gz Doxygen-696f23776e63cfd3e1a57899c0e5cecf5369e688.tar.bz2 |
Merge pull request #8190 from albert-github/feature/bug_mscgen_cnt
Incorrect line count in case of an error in msc input
-rw-r--r-- | libmscgen/mscgen_language.y | 1 | ||||
-rw-r--r-- | libmscgen/mscgen_lexer.h | 1 | ||||
-rw-r--r-- | libmscgen/mscgen_lexer.l | 7 |
3 files changed, 9 insertions, 0 deletions
diff --git a/libmscgen/mscgen_language.y b/libmscgen/mscgen_language.y index 02b36bb..52dedb3 100644 --- a/libmscgen/mscgen_language.y +++ b/libmscgen/mscgen_language.y @@ -209,6 +209,7 @@ Msc MscParse(FILE *in) yyin = in; + lex_resetparser(); /* Parse, and check that no errors are found */ if(yyparse((void *)&m) != 0) { diff --git a/libmscgen/mscgen_lexer.h b/libmscgen/mscgen_lexer.h index 0cbb21f..bba38c1 100644 --- a/libmscgen/mscgen_lexer.h +++ b/libmscgen/mscgen_lexer.h @@ -56,6 +56,7 @@ Boolean lex_getutf8(void); unsigned long lex_getlinenum(void); char *lex_getline(void); void lex_destroy(void); +void lex_resetparser(void); #endif /* MSCGEN_LEXER_H */ diff --git a/libmscgen/mscgen_lexer.l b/libmscgen/mscgen_lexer.l index 52f5e05..ea812f9 100644 --- a/libmscgen/mscgen_lexer.l +++ b/libmscgen/mscgen_lexer.l @@ -234,5 +234,12 @@ Boolean lex_getutf8(void) return lex_utf8; } +void lex_resetparser() +{ + lex_linenum = 1; + lex_line = NULL; + lex_utf8 = FALSE; +} + #include "mscgen_lexer.l.h" /* END OF FILE */ |