Status report and a big surprise

47 views
Skip to first unread message

Edward K. Ream

unread,
Jan 23, 2020, 5:49:48 AM1/23/20
to leo-editor
Work is going well on the last part of #1440.

The last task is to use this data while joining several lines into one longer line. The Orange class now have access to all needed data.  Some of this data comes from tokens, some from the ast (parse tree). This was tricky work. Happily, the code continues to simplify.

More importantly, I now understand completely what data are actually needed. As I was explaining the situation to Rebecca at breakfast yesterday, I realized that that the asttokens tool might provide all this data. An hour's work showed that this suspicion was correct. A simple script uses asttokens to replace all of the previous several month's work!

The show_asttokens_script unit test contains this script. This script is not run automatically because its name does not start with 'test'.

This is good news. All the work on #1440 has been valuable, for many reasons. The insights that lead to the script are subtle, as I'll explain in another post.

Edward

Edward K. Ream

unread,
Jan 24, 2020, 2:53:51 AM1/24/20
to leo-editor
On Thursday, January 23, 2020 at 5:49:48 AM UTC-5, Edward K. Ream wrote:

> A simple script uses asttokens to replace all of the previous several month's work!

I have just updated the unit tests that compares running times of the TOG class and asttokens. The code in leoAst.py is almost three times faster than asttokens, after counting the time to run the "simple script".

leoAst.py does more "out of the box" than asttokens, so leoAst.py is still in the running as a major new python tool.

Edward
Reply all
Reply to author
Forward
0 new messages