Skip to content

Commit

Permalink
Python strip code comments
Browse files Browse the repository at this point in the history
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
  • Loading branch information
albert-github authored and Dimitri van Heesch committed Sep 3, 2016
1 parent 8ca93da commit a19feec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pycode.l
Expand Up @@ -1422,7 +1422,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT
unput(*yytext);
yy_pop_state();
}
<*>{POUNDCOMMENT} {
<*>{POUNDCOMMENT}.* {
if (YY_START==SingleQuoteString ||
YY_START==DoubleQuoteString ||
YY_START==TripleString
Expand Down

0 comments on commit a19feec

Please sign in to comment.