summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-09-17 14:38:42 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-09-24 13:14:59 +0800
commit1a9af828d9ad0da0efa7af286db78c8904344e6b (patch)
tree9f68c764aa0b8de279380504d9f6c9f534498a47 /discover
parentd1052291224febe931fc95ed53d5008f66a72b96 (diff)
downloadtalos-petitboot-1a9af828d9ad0da0efa7af286db78c8904344e6b.tar.gz
talos-petitboot-1a9af828d9ad0da0efa7af286db78c8904344e6b.zip
discover/grub2: Allow EOF as a statement terminator
Files may not have a trailing newline. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover')
-rw-r--r--discover/grub2/parser.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/discover/grub2/parser.y b/discover/grub2/parser.y
index 3a5a142..292ce07 100644
--- a/discover/grub2/parser.y
+++ b/discover/grub2/parser.y
@@ -60,6 +60,7 @@ static void yyerror(struct grub2_parser *, char const *s);
%token TOKEN_EOL
%token TOKEN_DELIM
%token <word> TOKEN_WORD
+%token TOKEN_EOF 0
%start script
%debug
@@ -70,10 +71,12 @@ script: statements {
parser->script->statements = $1;
}
+eol: TOKEN_EOL | TOKEN_EOF;
+
statements: /* empty */ {
$$ = create_statements(parser);
}
- | statements statement TOKEN_EOL {
+ | statements statement eol {
statement_append($1, $2);
$$ = $1;
}
OpenPOWER on IntegriCloud