After discussion with Marco on IRC we decided that his code is better for the core features and other things are fast to implement.
But the next questions are menu entries. I propose the following syntax:
menu [arguments] name
{
   Commands
}

arguments can be --default, --fallback perhaps some more in the future.

But the main question is about realization. We need to store the source code to be able to edit it. Marco and me propose the following solution: lexer keeps the buffer of current parsed script/block and it stores begin and end of tokens in this buffer in yylloc's new fields: buf_beg and buf_end. Then when parser founds a menu entry it copies a part of buffer using position of command. E.g (schematically):

"menu" string '{' commands '}'
{
   char was = [EMAIL PROTECTED];
   [EMAIL PROTECTED] = 0;
   create_menu_command ($2, grub_strdup (&[EMAIL PROTECTED]));
}

And menu is always stored unparsed and parsed only just before execution. Than editing is no problem.

Other solution proposed by Marco was to rerun the script file or part of it.

We would like to know what other people think about it

Vladimir 'phcoder' Serbinenko




_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to