diff --git a/src/pyscanner.l b/src/pyscanner.l index 1ccb943dbd5..e6e2c80f35a 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; }