From 3e4a253ba9b9ee9ccb79e712846a41fb9221f757 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 10 Apr 2010 13:35:59 +0200 Subject: [PATCH] formatting changes. * tests/calc.at: Formatting changes. (cherry picked from commit c499231de45a4a30aadbc17db4ceafd74c44b9c4) --- ChangeLog | 5 +++++ tests/calc.at | 16 +++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f96716b3..d245ad6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-04-13 Akim Demaille + + formatting changes. + * tests/calc.at: Formatting changes. + 2010-04-13 Akim Demaille lalr1.cc: remove useless forward declaration. diff --git a/tests/calc.at b/tests/calc.at index d28b04a9..6735e85a 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -123,7 +123,7 @@ int } ]AT_LOCATION_IF([ - AT_LOC.first_column = AT_LOC.last_column; + AT_LOC.first_column = AT_LOC.last_column; AT_LOC.first_line = AT_LOC.last_line; ])[ @@ -158,7 +158,8 @@ AT_DATA_GRAMMAR([calc.y], ]$4 AT_SKEL_CC_IF( [%define global_tokens_and_yystype])[ -%code requires { +%code requires +{ /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } @@ -169,7 +170,8 @@ typedef int semantic_value; semantic_value ival; }; -%code provides { +%code provides +{ #include /* The input. */ extern FILE *input;]AT_SKEL_CC_IF([[ @@ -182,7 +184,8 @@ extern FILE *input;]AT_SKEL_CC_IF([[ #define last_column end.column]])[ } -%code { +%code +{ #include #include #if HAVE_UNISTD_H @@ -272,6 +275,7 @@ AT_NAME_PREFIX::parser::error (const location& l, const std::string& m) std::cerr << AT_LOCATION_IF([l << ": " << ])m << std::endl; } +/* A C++ yyparse that simulates the C signature. */ int yyparse (AT_PARAM_IF([semantic_value *result, int *count])) { @@ -282,7 +286,8 @@ yyparse (AT_PARAM_IF([semantic_value *result, int *count])) return parser.parse (); } ], -[static void +[/* A C error reporting function. */ +static void yyerror (AT_YYERROR_ARG_LOC_IF([YYLTYPE *llocp, ]) AT_PARAM_IF([semantic_value *result, int *count, ]) const char *s) @@ -315,6 +320,7 @@ power (int base, int exponent) } +/* A C main function. */ int main (int argc, const char **argv) { -- 2.45.2