Coder Social home page Coder Social logo

equip's People

Contributors

neuroo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

equip's Issues

How to introduce a variable in insert_before?

Trying to log time taken by a method. So want to store the time.time() in a variable in insert_before() and print the time taken in the insert_after () as follows -

MY_BEFORE_CODE = '__t1 = time.time(); print ("PERF LOG -START-'+ meth_decl.method_name +'", t1)'
MY_AFTER_CODE = 'print ("PERF LOG -END-'+ meth_decl.method_name +'", time.time() - t1)'

rewriter.insert_before(MY_BEFORE_CODE)
rewriter.insert_after(MY_AFTER_CODE)

getting following error -

SystemError: no locals found when storing '__t1'

Any pointers?

Global lambda expression affect parenting

Global lambda expressions are confusing the parenting heuristic.

import foo
A = lambda x, y: x + y

def foobar():
  print A(2, 3)

The above code currently produce the following decl:

 -> Module
   -> Method <lambda>
     -> Method foobar

Dominators code throws Key/Index Errors

Hey Romain, great tool you have here, I see you must have ran into the same problems I'm running into, you wrapped it with a try: .. except Exception: :)
https://github.com/neuroo/equip/blob/master/equip/analysis/graph/dominators.py#L61

Do you have any ideas how we should fix this? I can give you a specific test-case but it's not hard to trigger it, it's caused by a JUMP_ABSOLUTE being followed by a RETURN_VALUE and nothing jumping to the JUMP_ABSOLUTE.

115(1322)          LOAD_GLOBAL(116) ('something')
115(1325)           LOAD_CONST(100) ('/hey/foo.html')
115(1328)        CALL_FUNCTION(131) (1)
115(1331)         RETURN_VALUE( 83)
115(1332)        JUMP_ABSOLUTE(113) (1797) -------------> (1797)

You can't really fix it via

        if b not in doms or doms[b] != new_idom:
          if new_idom not in post_order_number:
            logger.debug("WELL WELL WELL new_idom is %s", new_idom)
          else:
            doms[b] = new_idom
            changed = True

because then you run into problems in __build_df.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.