[javascriptlint-commit] SF.net SVN: javascriptlint:[306] trunk
Status: Beta
Brought to you by:
matthiasmiller
From: <mat...@us...> - 2013-09-28 03:45:40
|
Revision: 306 http://sourceforge.net/p/javascriptlint/code/306 Author: matthiasmiller Date: 2013-09-28 03:45:38 +0000 (Sat, 28 Sep 2013) Log Message: ----------- #45 jsl: declarations should allow for surrounding spaces Modified Paths: -------------- trunk/javascriptlint/lint.py trunk/tests/control_comments/control_comments.js Modified: trunk/javascriptlint/lint.py =================================================================== --- trunk/javascriptlint/lint.py 2013-09-28 03:38:24 UTC (rev 305) +++ trunk/javascriptlint/lint.py 2013-09-28 03:45:38 UTC (rev 306) @@ -48,13 +48,13 @@ def _parse_control_comment(comment): """ Returns None or (keyword, parms) """ - if comment.atom.lower().startswith('jsl:'): - control_comment = comment.atom[4:] - elif comment.atom.startswith('@') and comment.atom.endswith('@'): - control_comment = comment.atom[1:-1] + comment_atom = comment.atom.lower().strip() + if comment_atom.startswith('jsl:'): + control_comment = comment_atom[4:] + elif comment_atom.startswith('@') and comment_atom.endswith('@'): + control_comment = comment_atom[1:-1] else: return None - control_comment = control_comment.lower().rstrip() keywords = ( 'ignoreall', Modified: trunk/tests/control_comments/control_comments.js =================================================================== --- trunk/tests/control_comments/control_comments.js 2013-09-28 03:38:24 UTC (rev 305) +++ trunk/tests/control_comments/control_comments.js 2013-09-28 03:45:38 UTC (rev 306) @@ -32,10 +32,12 @@ // The following are illegal. Make sure jsl doesn't choke. /*jsl:*/ /*warning:jsl_cc_not_understood*/ - if (a) - { + if (a) { /*jsl:pass */ } + else if (b) { + /* jsl:pass */ //allow spaces on both sides + } /*jsl:ignoreal*/ /*warning:jsl_cc_not_understood*/ /*jsl:declarebogus*/ /*warning:jsl_cc_not_understood*/ /*jsl:declare bogus */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |