On Saturday, February 8, 2014 6:42:50 AM UTC-6, Edward K. Ream wrote:
I've been saying that the new @auto project solves a problem that I've been
> working on for almost 20 years, namely, how to represent structure without
> using sentinels. Alas, this is only partially true.
>
My present opinion is that @auto *can* be made the basis for Leo's own
sources. Indeed, the problems I have been worrying about recently aren't
that bad. Here is the roadmap:
1. For my purposes, it will suffice if the importers include trailing text
into the body of nodes for classes and methods. For instance:
anIvar= False
def spam(self):
'''A method using anIvar.'''
foo = spam
can be rewritten:
def spam(self):
'''A method using anIvar.'''
anIvar= False
foo = spam
This avoids the intolerable (for me) excessive splitting of code into
node. It also moots the idea of creating "merge" nodes.
Putting all trailing code (code between the end of one
class/function/method and the next class/function/method) in a single node
is arguably the easiest thing for the importers to do. A useful
exception: comments appearing before a class/function/method will become
part of the class/function/method node.
2. As discussed yesterday, organizer nodes can replace section references
in @auto files.
In short, there is now a clear picture in my mind of what @auto trees will
look like after the importers and the new @auto code have processed the
external file. This picture is a) relatively easy to implement and b)
acceptable (to me) to use in Leo's own sources. As a result, the new @auto
project is back on track.
Edward
P.S. Although back on track, the new @auto project will require
substantial further work:
1. Imo, Leo's importers must parse code on a line-by-line basis rather than
character by character. This will greatly speed the parsers. More
importantly, it should eliminate many sources of import errors. It sounds
easy, but recent study indicates that it is not as easy as it sounds.
2. The new @auto code will never be simple, and considerable testing
remains.
3. The at-file-to-at-auto command will probably be re-imagined in light of
recent insights.
EKR
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.