On Friday 23 December 2005 02:08 am, Gregory B. wrote:
On 12/23/05, Steve L. [email protected] wrote:
[clip]
This is generally better and easier than parsing config files.
Google it… I’m sure you’ll find plenty o’ resources.
That having been said, if you provide a sane YAML format for
UMENU, I will try to create some sort of menu generation for
HighLine that is compatible with it. (After running it by James,
of course).
Hmmm,
It looks to me like standard UMENU .mnu files are almost YAML
anyway. It looks to me like one could indent everything between “L”
lines, put dashes in front of the “L” lines, and place one new line
(Menu) at the top, and it would conform to YAML.
In .mnu files, column 1 is the key, column 2 is ignored, and
everything column 3 and beyond is value. In a YAMLized version, the
first column after whitespace would be the key, the second would be
a colon, and everything else would be value.
You mentioned that Ruby supports YAML. Would that mean that UMENU
would not need to parse the YAMLized version of .mnu files, but
instead Ruby would parse it for us? If so, what would be the format
within memory?
There might be a temptation to place an entire menu SYSTEM within a
single file, instead of the current UMENU method of one file per
menu. For performance reasons, that would be a bad idea, as a huge
file would need to be read from disk and parsed every time someone
pressed Ctrl+9 (for example) to bring up a start menu. My menu
system has 613 command choices in 152 submenus, and takes over 2
seconds to parse on an Athlon XP2600+ with 1.5GB of RAM.
Also, keeping an entire menu system in memory at once could prove
problematic on low-memory systems, and in every other respect,
UMENU is designed to run in a very small footprint.
EMDL (Easy Menu Definition Language) includes a whole menu system in
a single file. The theory is, the EMDL parser need be run only when
the menu system is changed. EMDL has been formulated specifically
for fast and easy construction, especially when using vimoutliner
(http://www.vimoutliner.org). An EMDL to YAML .mnu converter
wouldn’t be hard, always assuming the YAML .mnu files are basically
just an indented and colonized version of the current .mnu files.
Curious – just how much YAML support does Ruby give the programmer?
Thanks
SteveT
Steve L.
[email protected]