diff options
Diffstat (limited to 'discover/grub2')
-rw-r--r-- | discover/grub2/parser.y | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/discover/grub2/parser.y b/discover/grub2/parser.y index 81856df..3a5a142 100644 --- a/discover/grub2/parser.y +++ b/discover/grub2/parser.y @@ -11,7 +11,10 @@ #include "parser.h" #include "lexer.h" +static void print_token(FILE *fp, int type, YYSTYPE value); + #define YYLEX_PARAM parser->scanner +#define YYPRINT(f, t, v) print_token(f, t, v) static void yyerror(struct grub2_parser *, char const *s); %} @@ -147,6 +150,13 @@ void yyerror(struct grub2_parser *parser, char const *s) s, yyget_text(parser->scanner)); } +static void print_token(FILE *fp, int type, YYSTYPE value) +{ + if (type != TOKEN_WORD) + return; + fprintf(fp, "%s", value.word->text); +} + struct grub2_statements *create_statements(struct grub2_parser *parser) { struct grub2_statements *stmts = talloc(parser, |