[javascriptlint-commit] SF.net SVN: javascriptlint: [168] trunk/pyjsl
Status: Beta
Brought to you by:
matthiasmiller
|
From: <mat...@us...> - 2008-03-20 20:48:41
|
Revision: 168
http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=168&view=rev
Author: matthiasmiller
Date: 2008-03-20 13:48:39 -0700 (Thu, 20 Mar 2008)
Log Message:
-----------
various fixes for Python 2.4
Modified Paths:
--------------
trunk/pyjsl/conf.py
trunk/pyjsl/jsparse.py
trunk/pyjsl/lint.py
Modified: trunk/pyjsl/conf.py
===================================================================
--- trunk/pyjsl/conf.py 2008-03-04 15:15:14 UTC (rev 167)
+++ trunk/pyjsl/conf.py 2008-03-20 20:48:39 UTC (rev 168)
@@ -8,7 +8,7 @@
self.lineno = None
self.path = None
-class Setting():
+class Setting:
wants_parm = False
wants_dir = False
@@ -48,7 +48,7 @@
parm = os.path.join(dir, parm)
self.value.append((self._recurse.value, parm))
-class Conf():
+class Conf:
def __init__(self):
recurse = BooleanSetting(False)
self._settings = {
@@ -94,7 +94,8 @@
assert not '\n' in line
# Allow comments
- line = line.partition('#')[0]
+ if '#' in line:
+ line = line[:line.find('#')]
line = line.rstrip()
if not line:
return
Modified: trunk/pyjsl/jsparse.py
===================================================================
--- trunk/pyjsl/jsparse.py 2008-03-04 15:15:14 UTC (rev 167)
+++ trunk/pyjsl/jsparse.py 2008-03-20 20:48:39 UTC (rev 168)
@@ -12,7 +12,7 @@
['tok.%s' % prop for prop in dir(tok)]
))
-class NodePos():
+class NodePos:
def __init__(self, line, col):
self.line = line
self.col = col
@@ -29,7 +29,7 @@
def __str__(self):
return '(line %i, col %i)' % (self.line+1, self.col+1)
-class NodePositions():
+class NodePositions:
" Given a string, allows [x] lookups for NodePos line and column numbers."
def __init__(self, text):
# Find the length of each line and incrementally sum all of the lengths
@@ -55,7 +55,7 @@
lines[0] = lines[0][start.col:]
return ''.join(lines)
-class NodeRanges():
+class NodeRanges:
def __init__(self):
self._offsets = []
def add(self, start, end):
@@ -74,7 +74,7 @@
def has(self, pos):
return bisect.bisect_right(self._offsets, pos) % 2 == 1
-class _Node():
+class _Node:
def add_child(self, node):
if node:
node.node_index = len(self.kids)
Modified: trunk/pyjsl/lint.py
===================================================================
--- trunk/pyjsl/lint.py 2008-03-04 15:15:14 UTC (rev 167)
+++ trunk/pyjsl/lint.py 2008-03-20 20:48:39 UTC (rev 168)
@@ -70,7 +70,7 @@
parms = control_comment[len(keyword):].strip()
return (comment, keyword, parms)
-class Scope():
+class Scope:
def __init__(self, node):
self._is_with_scope = node.kind == tok.WITH
self._parent = None
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|