Skip to content

Commit a19feec

Browse files
albert-githubDimitri van Heesch
authored andcommitted
Python strip code comments
In python the STRIP_CODE_COMMENTS didn't work properly, the "## /file" was not seen by the rule <*>{POUNDCOMMENT}" as the longer "<*>"#".* took precedence. Example file bb.py: ## \file # ## pyfie docu # \include aa.h # \include bb.py # \include cc.f # def pyfie(): pass
1 parent 8ca93da commit a19feec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pycode.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT
14221422
unput(*yytext);
14231423
yy_pop_state();
14241424
}
1425-
<*>{POUNDCOMMENT} {
1425+
<*>{POUNDCOMMENT}.* {
14261426
if (YY_START==SingleQuoteString ||
14271427
YY_START==DoubleQuoteString ||
14281428
YY_START==TripleString

0 commit comments

Comments
 (0)