From: Akim Demaille Date: Thu, 4 Apr 2013 13:41:49 +0000 (+0200) Subject: grammar: style changes X-Git-Tag: v2.7.90~57 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/dac72a91d98c9122282b8faf017a09fe3b5c6484 grammar: style changes * src/parse-gram.y (PARAM_TYPE): Remove useless typedef guard. There's a header guard. Use 'yyo' with %printer. Use a consistent style for %union one-liners. --- diff --git a/src/parse-gram.y b/src/parse-gram.y index 50b90cf0..f03069dc 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -217,8 +217,6 @@ static char const *char_name (char); `---------*/ %code requires { -# ifndef PARAM_TYPE -# define PARAM_TYPE typedef enum { param_none = 0, @@ -226,7 +224,6 @@ static char const *char_name (char); param_parse = 1 << 1, param_both = param_lex | param_parse } param_type; -# endif }; %code { @@ -239,17 +236,14 @@ static char const *char_name (char); static void add_param (param_type type, char *decl, location loc); static param_type current_param = param_none; }; -%union -{ - param_type param; -} +%union {param_type param;} %token PERCENT_PARAM "%param"; %printer { switch ($$) { #define CASE(In, Out) \ - case param_ ## In: fputs ("%" #Out, stderr); break + case param_ ## In: fputs ("%" #Out, yyo); break CASE (lex, lex-param); CASE (parse, parse-param); CASE (both, param);