[javascriptlint-commit] SF.net SVN: javascriptlint:[316] trunk
Status: Beta
Brought to you by:
matthiasmiller
|
From: <mat...@us...> - 2013-09-28 19:39:24
|
Revision: 316
http://sourceforge.net/p/javascriptlint/code/316
Author: matthiasmiller
Date: 2013-09-28 19:39:16 +0000 (Sat, 28 Sep 2013)
Log Message:
-----------
Fix unexpected-eof warning.
Modified Paths:
--------------
trunk/javascriptlint/warnings.py
trunk/jsengine/__init__.py
trunk/jsengine/parser/__init__.py
trunk/jsengine/tokenizer/__init__.py
trunk/tests/warnings/useless_comparison.js
Modified: trunk/javascriptlint/warnings.py
===================================================================
--- trunk/javascriptlint/warnings.py 2013-09-28 05:00:30 UTC (rev 315)
+++ trunk/javascriptlint/warnings.py 2013-09-28 19:39:16 UTC (rev 316)
@@ -110,6 +110,7 @@
'syntax_error': 'syntax error',
'expected_tok': 'expected token: {token}',
'unexpected_char': 'unexpected character: {char}',
+ 'unexpected_eof': 'unexpected end of file',
}
def format_error(errname, **errargs):
Modified: trunk/jsengine/__init__.py
===================================================================
--- trunk/jsengine/__init__.py 2013-09-28 05:00:30 UTC (rev 315)
+++ trunk/jsengine/__init__.py 2013-09-28 19:39:16 UTC (rev 316)
@@ -1,7 +1,7 @@
# vim: sw=4 ts=4 et
_MESSAGES = (
- 'eof',
+ 'unexpected_eof',
'semi_before_stmnt',
'syntax_error',
'unterminated_comment',
Modified: trunk/jsengine/parser/__init__.py
===================================================================
--- trunk/jsengine/parser/__init__.py 2013-09-28 05:00:30 UTC (rev 315)
+++ trunk/jsengine/parser/__init__.py 2013-09-28 19:39:16 UTC (rev 316)
@@ -781,7 +781,7 @@
elif x.tok == tok.TRY:
return _try_statement(t)
elif x.tok == tok.EOF:
- raise JSSyntaxError(x.startpos, 'eof')
+ raise JSSyntaxError(x.startpos, 'unexpected_eof')
elif x.tok == tok.FUNCTION:
return _function_declaration(t, op.CLOSURE) #TODO: warn, since this is not reliable
@@ -844,7 +844,7 @@
try:
parsestring(script)
except JSSyntaxError as error:
- return error.msg not in ('eof', 'unterminated_comment')
+ return error.msg not in ('unexpected_eof', 'unterminated_comment')
return True
class TestParser(unittest.TestCase):
Modified: trunk/jsengine/tokenizer/__init__.py
===================================================================
--- trunk/jsengine/tokenizer/__init__.py 2013-09-28 05:00:30 UTC (rev 315)
+++ trunk/jsengine/tokenizer/__init__.py 2013-09-28 19:39:16 UTC (rev 316)
@@ -176,7 +176,7 @@
if self._pos < len(self._content):
self._pos += 1
return self._content[self._pos - 1]
- raise JSSyntaxError(self.getpos(-1), 'eof')
+ raise JSSyntaxError(self.getpos(-1), 'unexpected_eof')
def readif(self, len_, seq):
s = self.peekif(len_, seq)
Modified: trunk/tests/warnings/useless_comparison.js
===================================================================
--- trunk/tests/warnings/useless_comparison.js 2013-09-28 05:00:30 UTC (rev 315)
+++ trunk/tests/warnings/useless_comparison.js 2013-09-28 19:39:16 UTC (rev 316)
@@ -59,5 +59,5 @@
if (i == 3 == i) /*warning:useless_comparison*/
return;
if (i == 3 == j == 3) /*warning:useless_comparison*/
- return;}
+ return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|