Example #1
0
 def from_source(cls, src, trace=False, define_builtins=True):
     scope = Scope(define_builtins=define_builtins)
     visitor = UnknownSymbolVisitor(scope, trace=trace)
     if isinstance(src, string_types):
         src = parse_ast(src)
     visitor.visit(src)
     scope.flush_symbol()
     return scope
 def from_source(cls, src, trace=False, define_builtins=True):
     scope = Scope(define_builtins=define_builtins)
     visitor = UnknownSymbolVisitor(scope, trace=trace)
     if isinstance(src, string_types):
         src = parse_ast(src)
     visitor.visit(src)
     scope.flush_symbol()
     return scope
Example #3
0
 def index_source(self, filename, source):
     try:
         st = parse_ast(source, filename)
     except Exception as e:
         logger.debug('failed to parse %s: %s', filename, e)
         return False
     visitor = SymbolVisitor(self)
     visitor.visit(st)
     return True
Example #4
0
 def index_source(self, filename, source):
     try:
         st = parse_ast(source, filename)
     except Exception as e:
         logger.debug("failed to parse %s: %s", filename, e)
         return False
     visitor = SymbolVisitor(self)
     visitor.visit(st)
     return True
Example #5
0
 def index_source(self, filename, source):
     try:
         st = parse_ast(source, filename)
     except Exception as e:
         print('Failed to parse %s: %s' % (filename, e))
         return False
     visitor = SymbolVisitor(self)
     visitor.visit(st)
     return True