diff options
author | albert-github <albert.tests@gmail.com> | 2015-12-25 18:41:52 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2015-12-25 18:41:52 (GMT) |
commit | 322d09de48c07cf7258825e3e7733d5d994e70cf (patch) | |
tree | 96140b29d3995b631bc62cf4c38c9368338bd3fa /src | |
parent | 165498dc9ea33bc9991c5ab5234b5e51d74569d0 (diff) | |
download | Doxygen-322d09de48c07cf7258825e3e7733d5d994e70cf.zip Doxygen-322d09de48c07cf7258825e3e7733d5d994e70cf.tar.gz Doxygen-322d09de48c07cf7258825e3e7733d5d994e70cf.tar.bz2 |
Bug 641036 - python script with #!/usr/bin/python are not documented correctly
Handle #! at first line as a special comment (on *nix systems starts the mentioned program with the file as input)
Diffstat (limited to 'src')
-rw-r--r-- | src/pyscanner.l | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pyscanner.l b/src/pyscanner.l index 1ccb943..e6e2c80 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -487,6 +487,7 @@ STRINGPREFIX ("r"|"u"|"ur"|"R"|"U"|"UR"|"Ur"|"uR") KEYWORD ("lambda"|"import"|"class"|"assert"|"as"|"from"|"global"|"def"|"True"|"False") FLOWKW ("or"|"and"|"is"|"not"|"print"|"for"|"in"|"if"|"try"|"except"|"yield"|"raise"|"break"|"continue"|"pass"|"if"|"return"|"while"|"elif"|"else"|"finally") POUNDCOMMENT "#"[^#\n][^\n]* +SCRIPTCOMMENT "#!".* STARTDOCSYMS "##" @@ -609,6 +610,9 @@ STARTDOCSYMS "##" "@staticmethod" { gstat=TRUE; } + {SCRIPTCOMMENT} { // Unix type script comment + if (yyLineNr != 1) REJECT; + } {POUNDCOMMENT} { // normal comment g_packageCommentAllowed = FALSE; } |