mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
formatting changes
* data/c.m4: Fix comments, put macros in a more natural order. Space changes (from M-x whitespace-cleanup). * src/location.c: Fix spaces. * tests/actions.at: Space changes.
This commit is contained in:
50
data/c.m4
50
data/c.m4
@@ -163,7 +163,7 @@ m4_define([b4_int_type],
|
|||||||
|
|
||||||
m4_eval([0 <= $1]), [1], [unsigned int],
|
m4_eval([0 <= $1]), [1], [unsigned int],
|
||||||
|
|
||||||
[int])])
|
[int])])
|
||||||
|
|
||||||
|
|
||||||
# b4_int_type_for(NAME)
|
# b4_int_type_for(NAME)
|
||||||
@@ -256,7 +256,7 @@ m4_define([b4_token_enums],
|
|||||||
enum ]b4_api_prefix[tokentype {
|
enum ]b4_api_prefix[tokentype {
|
||||||
]m4_map_sep([ b4_token_enum], [,
|
]m4_map_sep([ b4_token_enum], [,
|
||||||
],
|
],
|
||||||
[$@])[
|
[$@])[
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
]])])
|
]])])
|
||||||
@@ -320,7 +320,7 @@ $1 (b4_c_ansi_formals(m4_shift2($@)))[]dnl
|
|||||||
m4_define([b4_c_ansi_formals],
|
m4_define([b4_c_ansi_formals],
|
||||||
[m4_if([$#], [0], [void],
|
[m4_if([$#], [0], [void],
|
||||||
[$#$1], [1], [void],
|
[$#$1], [1], [void],
|
||||||
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
|
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
|
||||||
|
|
||||||
m4_define([b4_c_ansi_formal],
|
m4_define([b4_c_ansi_formal],
|
||||||
[$1])
|
[$1])
|
||||||
@@ -341,9 +341,9 @@ m4_define([b4_c_knr_formal_name],
|
|||||||
# Output the K&R argument declarations.
|
# Output the K&R argument declarations.
|
||||||
m4_define([b4_c_knr_formal_decls],
|
m4_define([b4_c_knr_formal_decls],
|
||||||
[m4_map_sep([b4_c_knr_formal_decl],
|
[m4_map_sep([b4_c_knr_formal_decl],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
[$@])])
|
[$@])])
|
||||||
|
|
||||||
m4_define([b4_c_knr_formal_decl],
|
m4_define([b4_c_knr_formal_decl],
|
||||||
[ $1;])
|
[ $1;])
|
||||||
@@ -355,9 +355,18 @@ m4_define([b4_c_knr_formal_decl],
|
|||||||
## ------------------------------------------------------------ ##
|
## ------------------------------------------------------------ ##
|
||||||
|
|
||||||
|
|
||||||
|
# b4_c_ansi_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
||||||
|
# ----------------------------------------------------------------
|
||||||
|
# Declare the function NAME ANSI C style.
|
||||||
|
m4_define([b4_c_ansi_function_decl],
|
||||||
|
[$2 $1 (b4_c_ansi_formals(m4_shift2($@)));[]dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# b4_c_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
# b4_c_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Declare the function NAME.
|
# Declare the function NAME in both K&R and ANSI C.
|
||||||
m4_define([b4_c_function_decl],
|
m4_define([b4_c_function_decl],
|
||||||
[#if defined __STDC__ || defined __cplusplus
|
[#if defined __STDC__ || defined __cplusplus
|
||||||
b4_c_ansi_function_decl($@)
|
b4_c_ansi_function_decl($@)
|
||||||
@@ -367,15 +376,6 @@ $2 $1 ();
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
# b4_c_ansi_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
|
||||||
# ----------------------------------------------------------------
|
|
||||||
# Declare the function NAME.
|
|
||||||
m4_define([b4_c_ansi_function_decl],
|
|
||||||
[$2 $1 (b4_c_ansi_formals(m4_shift2($@)));[]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## --------------------- ##
|
## --------------------- ##
|
||||||
## Calling C functions. ##
|
## Calling C functions. ##
|
||||||
@@ -432,9 +432,9 @@ m4_define([b4_symbol_actions],
|
|||||||
[b4_dollar_pushdef([(*yyvaluep)], [$6], [(*yylocationp)])dnl
|
[b4_dollar_pushdef([(*yyvaluep)], [$6], [(*yylocationp)])dnl
|
||||||
case $4: /* $3 */
|
case $4: /* $3 */
|
||||||
b4_syncline([$2], [$1])
|
b4_syncline([$2], [$1])
|
||||||
$5;
|
$5;
|
||||||
b4_syncline([@oline@], [@ofile@])
|
b4_syncline([@oline@], [@ofile@])
|
||||||
break;
|
break;
|
||||||
b4_dollar_popdef[]dnl
|
b4_dollar_popdef[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -471,7 +471,7 @@ b4_parse_param_use[]dnl
|
|||||||
{
|
{
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
|
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}]dnl
|
}]dnl
|
||||||
])
|
])
|
||||||
@@ -491,9 +491,9 @@ m4_define_default([b4_yy_symbol_print_generate],
|
|||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
]$1([yy_symbol_value_print],
|
]$1([yy_symbol_value_print],
|
||||||
[static void],
|
[static void],
|
||||||
[[FILE *yyoutput], [yyoutput]],
|
[[FILE *yyoutput], [yyoutput]],
|
||||||
[[int yytype], [yytype]],
|
[[int yytype], [yytype]],
|
||||||
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
|
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
|
||||||
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
||||||
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||||
{
|
{
|
||||||
@@ -514,7 +514,7 @@ b4_parse_param_use[]dnl
|
|||||||
{
|
{
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
||||||
[ default:
|
[ default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,9 +525,9 @@ b4_parse_param_use[]dnl
|
|||||||
|
|
||||||
]$1([yy_symbol_print],
|
]$1([yy_symbol_print],
|
||||||
[static void],
|
[static void],
|
||||||
[[FILE *yyoutput], [yyoutput]],
|
[[FILE *yyoutput], [yyoutput]],
|
||||||
[[int yytype], [yytype]],
|
[[int yytype], [yytype]],
|
||||||
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
|
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
|
||||||
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
||||||
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ location_print (FILE *out, location loc)
|
|||||||
quotearg_n_style (3, escape_quoting_style, loc.start.file));
|
quotearg_n_style (3, escape_quoting_style, loc.start.file));
|
||||||
if (0 <= loc.start.line)
|
if (0 <= loc.start.line)
|
||||||
{
|
{
|
||||||
res += fprintf(out, ":%d", loc.start.line);
|
res += fprintf (out, ":%d", loc.start.line);
|
||||||
if (0 <= loc.start.column)
|
if (0 <= loc.start.column)
|
||||||
res += fprintf (out, ".%d", loc.start.column);
|
res += fprintf (out, ".%d", loc.start.column);
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ location_print (FILE *out, location loc)
|
|||||||
loc.end.file));
|
loc.end.file));
|
||||||
if (0 <= loc.end.line)
|
if (0 <= loc.end.line)
|
||||||
{
|
{
|
||||||
res += fprintf(out, ":%d", loc.end.line);
|
res += fprintf (out, ":%d", loc.end.line);
|
||||||
if (0 <= end_col)
|
if (0 <= end_col)
|
||||||
res += fprintf (out, ".%d", end_col);
|
res += fprintf (out, ".%d", end_col);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ input:
|
|||||||
V(input, $$, @$, ": /* Nothing */\n");
|
V(input, $$, @$, ": /* Nothing */\n");
|
||||||
}
|
}
|
||||||
| line input /* Right recursive to load the stack so that popping at
|
| line input /* Right recursive to load the stack so that popping at
|
||||||
END can be exercised. */
|
END can be exercised. */
|
||||||
{
|
{
|
||||||
$$ = 2;
|
$$ = 2;
|
||||||
V(input, $$, @$, ": ");
|
V(input, $$, @$, ": ");
|
||||||
|
|||||||
Reference in New Issue
Block a user