2006-16-04 Marco Gerards <marco@gnu.org>

* 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.
This commit is contained in:
marco_g 2006-04-16 18:02:42 +00:00
parent b7d9f5fdea
commit 6de2ee9903
6 changed files with 113 additions and 60 deletions

View file

@ -170,7 +170,6 @@ grub_script_create_cmdline (char *cmdname, struct grub_script_arglist *arglist)
cmd = grub_script_malloc (sizeof (*cmd));
cmd->cmd.exec = grub_script_execute_cmdline;
/* cmd->cmd.free = grub_script_free_cmdline; */
cmd->cmd.next = 0;
cmd->arglist = arglist;
cmd->cmdname = cmdname;
@ -305,7 +304,7 @@ grub_script_parse (char *script, grub_err_t (*getline) (char **))
/* Parse the script, the result is stored in
`grub_script_parsed'. */
if (grub_script_yyparse ())
if (grub_script_yyparse () || ! grub_script_parsed)
{
struct grub_script_mem *memfree;
memfree = grub_script_mem_record_stop (membackup);