discover/grub2: Implement statement blocks
[petitboot] / discover / grub2 / parser-api.c
index 6e05ecf56faaa9261ee5c292aa35e97bbf7155e0..37c88a264d750590f282bf0bfa39262ec9b7c2f5 100644 (file)
@@ -42,6 +42,16 @@ struct grub2_statement *create_statement_if(struct grub2_parser *parser,
        stmt->ifstmt.false_case = false_case;
        return stmt;
 }
+
+struct grub2_statement *create_statement_block(struct grub2_parser *parser,
+               struct grub2_statements *stmts)
+{
+       struct grub2_statement *stmt = talloc(parser, struct grub2_statement);
+       stmt->type = STMT_TYPE_BLOCK;
+       stmt->block.statements = stmts;
+       return stmt;
+}
+
 void statement_append(struct grub2_statements *stmts,
                struct grub2_statement *stmt)
 {