Permalink
Browse files

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)
  • Loading branch information...
albert-github committed Dec 25, 2015
1 parent 165498d commit 322d09de48c07cf7258825e3e7733d5d994e70cf
Showing with 4 additions and 0 deletions.
  1. +4 −0 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;
}

0 comments on commit 322d09d

Please sign in to comment.