[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/11] grammar: style changes
From: |
Akim Demaille |
Subject: |
[PATCH 05/11] grammar: style changes |
Date: |
Thu, 4 Apr 2013 17:36:22 +0200 |
* 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.
---
src/parse-gram.y | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/src/parse-gram.y b/src/parse-gram.y
index 50b90cf..f03069d 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 <param> 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);
--
1.8.2
- [PATCH 00/11] support "%define variable {value}", Akim Demaille, 2013/04/04
- [PATCH 05/11] grammar: style changes,
Akim Demaille <=
- [PATCH 07/11] style: fix comments, Akim Demaille, 2013/04/04
- [PATCH 11/11] api.namespace: demonstrate and use {...} values instead of "..." values, Akim Demaille, 2013/04/04
- [PATCH 04/11] grammar: split %union to group together related aspects, Akim Demaille, 2013/04/04
- [PATCH 02/11] style: comment changes, Akim Demaille, 2013/04/04
- [PATCH 08/11] grammar: record the kind of %define variable values, Akim Demaille, 2013/04/04
- [PATCH 01/11] muscle: minor refactoring, Akim Demaille, 2013/04/04
- [PATCH 10/11] grammar: do not add a \n at the end of blocks of code, Akim Demaille, 2013/04/04
- [PATCH 03/11] muscle: refactor, Akim Demaille, 2013/04/04
- [PATCH 09/11] regen, Akim Demaille, 2013/04/04
- [PATCH 06/11] regen, Akim Demaille, 2013/04/04