Permalink
Browse files

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
  • Loading branch information...
albert-github authored and Dimitri van Heesch committed Sep 2, 2016
1 parent 8ca93da commit a19feec4a7864dc17fcb570330ae2f7b9a5c6e45
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/pycode.l
View
@@ -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

0 comments on commit a19feec

Please sign in to comment.