Update of /cvsroot/bicyclerepair/bicyclerepair/bike/parsing
In directory sc8-pr-cvs1:/tmp/cvs-serv13741/bike/parsing
Modified Files:
extended_ast.py fastparserast.py
Log Message:
* bike/query/findDefinition.py: Fixed bug reported by Marius - if
class is declared in __init__.py, it blows up.
* bike/query/findReferences.py: Fixed bugs in
'getDefinitionAndScope' logic, so can handle nested classes etc..
Index: extended_ast.py
===================================================================
RCS file: /cvsroot/bicyclerepair/bicyclerepair/bike/parsing/extended_ast.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- extended_ast.py 23 Jan 2003 10:40:42 -0000 1.32
+++ extended_ast.py 11 Feb 2003 10:16:51 -0000 1.33
@@ -150,8 +150,6 @@
def __repr__(self):
return "Package(%s,%s)"%(self.path, self.name)
-
-
wordRE = re.compile("\w+")
class Source:
nodes['Source'] = 'Source'
Index: fastparserast.py
===================================================================
RCS file: /cvsroot/bicyclerepair/bicyclerepair/bike/parsing/fastparserast.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- fastparserast.py 23 Jan 2003 10:40:42 -0000 1.7
+++ fastparserast.py 11 Feb 2003 10:16:52 -0000 1.8
@@ -1,6 +1,7 @@
from __future__ import generators
from parserutils import generateLogicalLines, maskStringsAndComments, maskStringsAndRemoveComments
import re
+import compiler
TABWIDTH = 4
@@ -114,6 +115,9 @@
def setSourceNode(self, sourcenode):
self.sourcenode = sourcenode
+ def matchesCompilerNode(self,node):
+ return isinstance(node,compiler.ast.Module) and \
+ node.name == self.name
indentRE = re.compile("^(\s*)\S")
class Node:
@@ -184,6 +188,11 @@
def __str__(self):
return "bike:Class:"+self.name
+ def matchesCompilerNode(self,node):
+ return isinstance(node,compiler.ast.Class) and \
+ node.name == self.name
+
+
fnNameRE = re.compile("^\s*def (\w+)")
@@ -202,3 +211,7 @@
def __str__(self):
return "bike:Function:"+self.name
+
+ def matchesCompilerNode(self,node):
+ return isinstance(node,compiler.ast.Function) and \
+ node.name == self.name
|