* normal/lexer.c (grub_script_yylex): Don't filter out newlines.
* normal/parser.y (commandblock): Defined as <cmd>. A subroutine
for `menuentry'.
(script): Accept leading newlines.
(newlines): New rule to describe 0 or more newlines.
(commands): Accept `command' with trailing newline. Fixed the
order in which arguments were passed to `grub_script_add_cmd'.
Accept commands separated by newlines.
(function): Changed to accept newlines.
(menuentry) Rewritten.
* normal/script.c (grub_script_create_cmdmenu): Add new entries in
front of the list, instead of to the end.
* normal/command.c (grub_command_init): Remove the title command.
* normal/lexer.c (grub_script_yylex): Renamed from this...
(grub_script_yylex2): ... to this.
(grub_script_yylex): New function. Temporary
introduced to filter some tokens.
(grub_script_yyerror): Print a newline.
* normal/main.c (read_config_file): Output information about the
lines that contain errors. Wait for a key after all lines have
been processed. Don't return an empty menu.
* normal/parser.y (func_mem): Don't initialize.
(menu_entry): Likewise.
(err): New variable.
(script): Don't return anything when an error was encountered.
(ws, returns): Removed rules.
(argument): Disabled concatenated variable support.
(arguments): Remove explicit separators.
(grubcmd): Likewise.
(function): Likewise.
(menuentry): Likewise.
(if): Likewise.
(commands): Likewise. Add error handling.
* normal/script.c (grub_script_create_cmdline): If
`grub_script_parsed' is 0, assume the parser encountered an error.
* include/grub/normal.h: Include <grub/script.h>.
(grub_command_list): Removed struct.
(grub_command_list_t): Removed type.
(grub_menu_entry): Remove members `num' and `command_list'. Add
members `commands' and `sourcecode'.
* include/grub/script.h: Add inclusion guards.
(grub_script_cmd_menuentry): New struct.
(grub_script_execute_menuentry): New prototype.
(grub_script_lexer_record_start): Likewise.
(grub_script_lexer_record_stop): Likewise.
* normal/execute.c (grub_script_execute_menuentry): New function.
* normal/lexer.c (record, recording, recordpos, recordlen): New
variables.
(grub_script_lexer_record_start): New function.
(grub_script_lexer_record_stop): Likewise.
(recordchar): Likewise.
(nextchar): Likewise.
(grub_script_yylex): Use `nextchar' to fetch new characters. Use
2048 as the buffer size. Add the tokens `menuentry' and `@'.
* normal/main.c: Include <grub/parser.h> and <grub/script.h>
(current_menu): New variable.
(free_menu): Mainly rewritten.
(grub_normal_menu_addentry): New function.
(read_config_file): Rewritten.
* normal/menu.c (run_menu_entry): Mainly rewritten.
* normal/menu_entry.c (make_screen): Rewritten te code to insert
the menu entry.
(run): Mainly rewritten.
* normal/parser.y (menu_entry): New variable.
(GRUB_PARSER_TOKEN_MENUENTRY): New token.
(menuentry): New rule.
(command): Add `menuentry'.
(if_statement): Allow additional returns before `fi'.
* normal/script.c (grub_script_create_cmdmenu): New function.