Utilities/ClassBrowsers/jsclbr.py

changeset 2965
d133c7edd88a
parent 2779
4d433896b6d6
child 2997
7f0ef975da9e
equal deleted inserted replaced
2964:84b65fb9e780 2965:d133c7edd88a
109 109
110 return self.__dict 110 return self.__dict
111 111
112 def __visit(self, root): 112 def __visit(self, root):
113 """ 113 """
114 Private method implementing the visit logic delegating to interesting methods. 114 Private method implementing the visit logic delegating to interesting
115 methods.
116
117 @param root root node to visit
115 """ 118 """
116 call = lambda n: getattr(self, "visit_{0}".format(n.type), self.visit_noop)(n) 119 call = lambda n: getattr(self, "visit_{0}".format(n.type), self.visit_noop)(n)
117 call(root) 120 call(root)
118 for node in root: 121 for node in root:
119 self.__visit(node) 122 self.__visit(node)
250 Attribute(self.__module, "const " + var.name, 253 Attribute(self.__module, "const " + var.name,
251 self.__file, var.line)) 254 self.__file, var.line))
252 255
253 256
254 def readmodule_ex(module, path=[]): 257 def readmodule_ex(module, path=[]):
255 ''' 258 """
256 Read a JavaScript file and return a dictionary of functions and variables. 259 Read a JavaScript file and return a dictionary of functions and variables.
257 260
258 @param module name of the JavaScript file (string) 261 @param module name of the JavaScript file (string)
259 @param path path the file should be searched in (list of strings) 262 @param path path the file should be searched in (list of strings)
260 @return the resulting dictionary 263 @return the resulting dictionary
261 ''' 264 """
262 global _modules 265 global _modules
263 266
264 dict = {} 267 dict = {}
265 268
266 if module in _modules: 269 if module in _modules:

eric ide

mercurial