pedal-edu / pedal

A collection of tools to analyze student's Python source code
https://pedal-edu.github.io/pedal/
MIT License
29 stars 7 forks source link

Old style CAIT API usage is not working #2

Closed acbart closed 6 years ago

acbart commented 6 years ago

Previously, CAIT's api allowed you to extract out the root node (the module) using parse_program and then use find_all to traverse it. It seems like that is no longer supported:

https://github.com/acbart/pedal/blob/master/tests/test_cait.py#L370

Also, am I correct in understanding that CAIT rebuilds its parse tree every time you call find_matches? As opposed to building it once during parse_program, like it used to?

lukesg08 commented 6 years ago

I forgot to wrap the return value of parse_program into an EasyNode. The issue should be fixed.

lukesg08 commented 6 years ago

Also, find_matches does not reparse the program.

acbart commented 6 years ago

That is good! The new engine is very slow, mostly because of some Skulpt compilation things. I've been working on fine-tuning it, but I suspect I'll have to pay more attention to caching stuff in the future. I wouldn't worry about it yet, but we'll want to do some tests on older hardware.