X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/1092d69c344c8b21773a3191c43da4c9190bd421..c5dbd909d0fcdacb46d4d601ebcadfc0f680cd56:/data/c.m4 diff --git a/data/c.m4 b/data/c.m4 index 2a57e7c3..f145c737 100644 --- a/data/c.m4 +++ b/data/c.m4 @@ -2,7 +2,7 @@ # C M4 Macros for Bison. -# Copyright (C) 2002, 2004-2012 Free Software Foundation, Inc. +# Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -480,10 +480,8 @@ m4_if(b4_skeleton, ["yacc.c"], b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl m4_ifset([b4_parse_param], [, b4_parse_param]))[ { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); ]b4_locations_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); @@ -503,11 +501,11 @@ b4_locations_if([, yylocationp])[]b4_user_args[); m4_define([b4_value_type_define], [[/* Value type. */ #if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED -]m4_ifdef([b4_stype], +]m4_ifdef([b4_union_members], [[typedef union ]b4_union_name[ ]b4_api_PREFIX[STYPE; union ]b4_union_name[ { -]b4_user_stype[ +]b4_user_union_members[ }; # define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]], [m4_if(b4_tag_seen_flag, 0, @@ -633,25 +631,25 @@ __attribute__((__unused__)) int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { - res += fprintf (yyo, "%d", yylocp->first_line); + res += YYFPRINTF (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) - res += fprintf (yyo, ".%d", yylocp->first_column); + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { - res += fprintf (yyo, "-%d", yylocp->last_line); + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); if (0 <= end_col) - res += fprintf (yyo, ".%d", end_col); + res += YYFPRINTF (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) - res += fprintf (yyo, "-%d", end_col); + res += YYFPRINTF (yyo, "-%d", end_col); } return res; } -# define YY_LOCATION_PRINT(File, Loc) \ +# define YY_LOCATION_PRINT(File, Loc) \ yy_location_print_ (File, &(Loc)) # else