merge with mainline
This commit is contained in:
commit
f745095a37
351 changed files with 46449 additions and 19735 deletions
|
@ -21,7 +21,7 @@
|
|||
#include <grub/parser.h>
|
||||
#include <grub/mm.h>
|
||||
|
||||
static grub_script_function_t grub_script_function_list;
|
||||
grub_script_function_t grub_script_function_list;
|
||||
|
||||
grub_script_function_t
|
||||
grub_script_function_create (struct grub_script_arg *functionname_arg,
|
||||
|
@ -104,18 +104,6 @@ grub_script_function_find (char *functionname)
|
|||
return func;
|
||||
}
|
||||
|
||||
int
|
||||
grub_script_function_iterate (int (*iterate) (grub_script_function_t))
|
||||
{
|
||||
grub_script_function_t func;
|
||||
|
||||
for (func = grub_script_function_list; func; func = func->next)
|
||||
if (iterate (func))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
grub_script_function_call (grub_script_function_t func,
|
||||
int argc __attribute__((unused)),
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <grub/parser.h>
|
||||
#include <grub/script_sh.h>
|
||||
|
||||
static grub_err_t
|
||||
grub_err_t
|
||||
grub_normal_parse_line (char *line, grub_reader_getline_t getline)
|
||||
{
|
||||
struct grub_script *parsed_script;
|
||||
|
@ -39,19 +39,3 @@ grub_normal_parse_line (char *line, grub_reader_getline_t getline)
|
|||
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
static struct grub_parser grub_sh_parser =
|
||||
{
|
||||
.name = "grub",
|
||||
.parse_line = grub_normal_parse_line
|
||||
};
|
||||
|
||||
GRUB_MOD_INIT(sh)
|
||||
{
|
||||
grub_parser_register ("grub", &grub_sh_parser);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(sh)
|
||||
{
|
||||
grub_parser_unregister (&grub_sh_parser);
|
||||
}
|
||||
|
|
|
@ -20,12 +20,14 @@
|
|||
%{
|
||||
#include <grub/script_sh.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/misc.h>
|
||||
|
||||
#define YYFREE grub_free
|
||||
#define YYMALLOC grub_malloc
|
||||
#define YYLTYPE_IS_TRIVIAL 0
|
||||
#define YYENABLE_NLS 0
|
||||
|
||||
#include "grub_script.tab.h"
|
||||
%}
|
||||
|
||||
%union {
|
||||
|
@ -127,6 +129,7 @@ word: GRUB_PARSER_TOKEN_NAME { $$ = grub_script_add_arglist (state, 0, $1); }
|
|||
statement: command { $$ = $1; }
|
||||
| function { $$ = 0; }
|
||||
| menuentry { $$ = $1; }
|
||||
;
|
||||
|
||||
argument : "case" { $$ = grub_script_add_arglist (state, 0, $1); }
|
||||
| "do" { $$ = grub_script_add_arglist (state, 0, $1); }
|
||||
|
|
|
@ -112,9 +112,9 @@ typedef size_t yy_size_t;
|
|||
%option extra-type="struct grub_parser_param*"
|
||||
|
||||
BLANK [ \t]
|
||||
COMMENT ^[ \t]*#.*$
|
||||
COMMENT #.*$
|
||||
|
||||
CHAR [^|&$;<> \t\n\'\"\\]
|
||||
CHAR [^{}|&$;<> \t\n\'\"\\]
|
||||
DIGITS [[:digit:]]+
|
||||
NAME [[:alpha:]_][[:alnum:][:digit:]_]*
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue