As part of the wider focus of my programming, I have redone the c2py
script as the c-to-python command.
Warning:
This command translates the body text of an entire tree. The "before"
body text is assumed to be C code; the "after" body text will be the
not-completely-translated Python code. Therefore, you should do the
work in a **copy** of the original tree if you want to retain the
original code.
Still To do:
** run indent first to regularize *C* indentation. This is very
important.
What I did (heavily abridged):
- Wrapped the code in a class.
- Get tab_width from @tabwidth directives.
- Get user data from::
@data c-to-python-class-list
@data c-to-python-type-list
@data c-to-python-ivars-dict
keys end in a colon
all other lines contain comma-delimited values for the current
key.
Summary
c2py was the first python program I ever wrote. Remarkably, I made
few substantive changes in the go-round.
What stands out starkly is how much better Leo is as a programming
environment now compared to the old Leo vintage 2001. I suspect the
difference is even larger than I remember...
Edward
P.S. You may well wonder why I bothered to do this. An internal
debate is raging within me about strategy, but I'll reveal this debate
at a later time.
EKR
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.