[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, feature/fix-ns-memleak, updated. gawk-4.
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, feature/fix-ns-memleak, updated. gawk-4.1.0-3606-ga6ece4a |
Date: |
Sun, 20 Jan 2019 15:17:51 -0500 (EST) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, feature/fix-ns-memleak has been updated
via a6ece4a82072150e4b269b5698bb8caf14075bcb (commit)
from 0efefad3d8ff61355002b828c13a531e15f55978 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=a6ece4a82072150e4b269b5698bb8caf14075bcb
commit a6ece4a82072150e4b269b5698bb8caf14075bcb
Author: Arnold D. Robbins <address@hidden>
Date: Sun Jan 20 22:17:24 2019 +0200
Restore passing tests in namespace code.
diff --git a/ChangeLog b/ChangeLog
index 1962519..7b0b371 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2019-01-20 Arnold D. Robbins <address@hidden>
+
+ Restore functionality.
+
+ * awkgram.y (qualify_name): Remove `is_var' param, always check
+ for all upper case. Adjust all calls.
+ (Grammar): Do qualify_name for function calls also.
+
2019-01-19 Arnold D. Robbins <address@hidden>
Continue fixing memory leaks.
diff --git a/awkgram.c b/awkgram.c
index 5bfabe3..0ec3a89 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.2.1. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation,
Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015 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
@@ -40,14 +40,11 @@
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
-/* Undocumented macros, especially those whose name start with YY_,
- are private implementation details. Do not rely on them. */
-
/* Identify Bison output. */
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.2.1"
+#define YYBISON_VERSION "3.0.4"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -64,8 +61,8 @@
-/* First part of user prologue. */
-#line 26 "awkgram.y" /* yacc.c:338 */
+/* Copy the first part of user declarations. */
+#line 26 "awkgram.y" /* yacc.c:339 */
#ifdef GAWKDEBUG
#define YYDEBUG 12
@@ -104,7 +101,7 @@ static char *tokexpand(void);
static NODE *set_profile_text(NODE *n, const char *str, size_t len);
static int check_qualified_special(char *token);
static bool is_all_upper(const char *name);
-static char *qualify_name(const char *name, size_t len, bool is_var);
+static char *qualify_name(const char *name, size_t len);
static INSTRUCTION *trailing_comment;
static INSTRUCTION *outer_comment;
static INSTRUCTION *interblock_comment;
@@ -230,16 +227,13 @@ extern double fmod(double x, double y);
#define YYSTYPE INSTRUCTION *
-#line 234 "awkgram.c" /* yacc.c:338 */
+#line 231 "awkgram.c" /* yacc.c:339 */
+
# ifndef YY_NULLPTR
-# if defined __cplusplus
-# if 201103L <= __cplusplus
-# define YY_NULLPTR nullptr
-# else
-# define YY_NULLPTR 0
-# endif
+# if defined __cplusplus && 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
# else
-# define YY_NULLPTR ((void*)0)
+# define YY_NULLPTR 0
# endif
# endif
@@ -389,7 +383,9 @@ int yyparse (void);
+/* Copy the second part of user declarations. */
+#line 389 "awkgram.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -410,13 +406,13 @@ typedef signed char yytype_int8;
#ifdef YYTYPE_UINT16
typedef YYTYPE_UINT16 yytype_uint16;
#else
-typedef unsigned short yytype_uint16;
+typedef unsigned short int yytype_uint16;
#endif
#ifdef YYTYPE_INT16
typedef YYTYPE_INT16 yytype_int16;
#else
-typedef short yytype_int16;
+typedef short int yytype_int16;
#endif
#ifndef YYSIZE_T
@@ -428,7 +424,7 @@ typedef short yytype_int16;
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
-# define YYSIZE_T unsigned
+# define YYSIZE_T unsigned int
# endif
#endif
@@ -464,6 +460,15 @@ typedef short yytype_int16;
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
#endif
+#if !defined _Noreturn \
+ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+# endif
+#endif
+
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E))
@@ -471,7 +476,7 @@ typedef short yytype_int16;
# define YYUSE(E) /* empty */
#endif
-#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 +
__GNUC_MINOR__
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
@@ -639,7 +644,7 @@ union yyalloc
#define YYMAXUTOK 310
#define YYTRANSLATE(YYX) \
- ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
as returned by yylex, without out-of-bounds checking. */
@@ -701,9 +706,9 @@ static const yytype_uint16 yyrline[] =
1781, 1783, 1785, 1787, 1789, 1803, 1808, 1813, 1838, 1844,
1846, 1848, 1850, 1852, 1854, 1859, 1863, 1895, 1903, 1909,
1915, 1928, 1929, 1930, 1935, 1940, 1944, 1948, 1963, 1984,
- 1989, 2026, 2070, 2071, 2077, 2078, 2083, 2085, 2092, 2109,
- 2126, 2128, 2135, 2140, 2180, 2190, 2202, 2211, 2215, 2220,
- 2224, 2228, 2232, 2237, 2238, 2242, 2246, 2250
+ 1989, 2026, 2078, 2079, 2085, 2086, 2091, 2093, 2100, 2117,
+ 2134, 2136, 2143, 2148, 2188, 2198, 2210, 2219, 2223, 2228,
+ 2232, 2236, 2240, 2245, 2246, 2250, 2254, 2258
};
#endif
@@ -1293,37 +1298,37 @@ do {
\
} while (0)
-/*-----------------------------------.
-| Print this symbol's value on YYO. |
-`-----------------------------------*/
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT. |
+`----------------------------------------*/
static void
-yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const
yyvaluep)
{
- FILE *yyoutput = yyo;
- YYUSE (yyoutput);
+ FILE *yyo = yyoutput;
+ YYUSE (yyo);
if (!yyvaluep)
return;
# ifdef YYPRINT
if (yytype < YYNTOKENS)
- YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# endif
YYUSE (yytype);
}
-/*---------------------------.
-| Print this symbol on YYO. |
-`---------------------------*/
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
static void
-yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
{
- YYFPRINTF (yyo, "%s %s (",
+ YYFPRINTF (yyoutput, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
- yy_symbol_value_print (yyo, yytype, yyvaluep);
- YYFPRINTF (yyo, ")");
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+ YYFPRINTF (yyoutput, ")");
}
/*------------------------------------------------------------------.
@@ -1357,7 +1362,7 @@ do {
\
static void
yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
{
- unsigned long yylno = yyrline[yyrule];
+ unsigned long int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
@@ -1490,7 +1495,7 @@ yytnamerr (char *yyres, const char *yystr)
if (! yyres)
return yystrlen (yystr);
- return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
+ return yystpcpy (yyres, yystr) - yyres;
}
# endif
@@ -1583,7 +1588,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
case N: \
yyformat = S; \
break
- default: /* Avoid compiler warnings. */
YYCASE_(0, YY_("syntax error"));
YYCASE_(1, YY_("syntax error, unexpected %s"));
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
@@ -1732,12 +1736,12 @@ yyparse (void)
yyssp++;
yysetstate:
- *yyssp = (yytype_int16) yystate;
+ *yyssp = yystate;
if (yyss + yystacksize - 1 <= yyssp)
{
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
+ YYSIZE_T yysize = yyssp - yyss + 1;
#ifdef yyoverflow
{
@@ -1755,6 +1759,7 @@ yyparse (void)
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
+
yyss = yyss1;
yyvs = yyvs1;
}
@@ -1788,7 +1793,7 @@ yyparse (void)
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long) yystacksize));
+ (unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
@@ -1899,22 +1904,22 @@ yyreduce:
switch (yyn)
{
case 2:
-#line 232 "awkgram.y" /* yacc.c:1645 */
+#line 232 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 1905 "awkgram.c" /* yacc.c:1645 */
+#line 1910 "awkgram.c" /* yacc.c:1646 */
break;
case 3:
-#line 234 "awkgram.y" /* yacc.c:1645 */
+#line 234 "awkgram.y" /* yacc.c:1646 */
{
rule = 0;
yyerrok;
}
-#line 1914 "awkgram.c" /* yacc.c:1645 */
+#line 1919 "awkgram.c" /* yacc.c:1646 */
break;
case 4:
-#line 239 "awkgram.y" /* yacc.c:1645 */
+#line 239 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0]) != NULL) {
if ((yyvsp[-1]) == NULL)
@@ -1924,19 +1929,19 @@ yyreduce:
}
(yyval) = (yyvsp[-1]);
}
-#line 1928 "awkgram.c" /* yacc.c:1645 */
+#line 1933 "awkgram.c" /* yacc.c:1646 */
break;
case 5:
-#line 249 "awkgram.y" /* yacc.c:1645 */
+#line 249 "awkgram.y" /* yacc.c:1646 */
{
next_sourcefile();
}
-#line 1936 "awkgram.c" /* yacc.c:1645 */
+#line 1941 "awkgram.c" /* yacc.c:1646 */
break;
case 6:
-#line 253 "awkgram.y" /* yacc.c:1645 */
+#line 253 "awkgram.y" /* yacc.c:1646 */
{
rule = 0;
/*
@@ -1945,11 +1950,11 @@ yyreduce:
*/
/* yyerrok; */
}
-#line 1949 "awkgram.c" /* yacc.c:1645 */
+#line 1954 "awkgram.c" /* yacc.c:1646 */
break;
case 7:
-#line 265 "awkgram.y" /* yacc.c:1645 */
+#line 265 "awkgram.y" /* yacc.c:1646 */
{
(void) append_rule((yyvsp[-1]), (yyvsp[0]));
if (pending_comment != NULL) {
@@ -1957,11 +1962,11 @@ yyreduce:
pending_comment = NULL;
}
}
-#line 1961 "awkgram.c" /* yacc.c:1645 */
+#line 1966 "awkgram.c" /* yacc.c:1646 */
break;
case 8:
-#line 273 "awkgram.y" /* yacc.c:1645 */
+#line 273 "awkgram.y" /* yacc.c:1646 */
{
if (rule != Rule) {
msg(_("%s blocks must have an action part"),
ruletab[rule]);
@@ -1975,11 +1980,11 @@ yyreduce:
(void) append_rule((yyvsp[-1]), NULL);
}
}
-#line 1979 "awkgram.c" /* yacc.c:1645 */
+#line 1984 "awkgram.c" /* yacc.c:1646 */
break;
case 9:
-#line 287 "awkgram.y" /* yacc.c:1645 */
+#line 287 "awkgram.y" /* yacc.c:1646 */
{
in_function = false;
(void) mk_function((yyvsp[-1]), (yyvsp[0]));
@@ -1990,11 +1995,11 @@ yyreduce:
}
yyerrok;
}
-#line 1994 "awkgram.c" /* yacc.c:1645 */
+#line 1999 "awkgram.c" /* yacc.c:1646 */
break;
case 10:
-#line 298 "awkgram.y" /* yacc.c:1645 */
+#line 298 "awkgram.y" /* yacc.c:1646 */
{
want_source = false;
at_seen = false;
@@ -2004,11 +2009,11 @@ yyreduce:
}
yyerrok;
}
-#line 2008 "awkgram.c" /* yacc.c:1645 */
+#line 2013 "awkgram.c" /* yacc.c:1646 */
break;
case 11:
-#line 308 "awkgram.y" /* yacc.c:1645 */
+#line 308 "awkgram.y" /* yacc.c:1646 */
{
want_source = false;
at_seen = false;
@@ -2018,11 +2023,11 @@ yyreduce:
}
yyerrok;
}
-#line 2022 "awkgram.c" /* yacc.c:1645 */
+#line 2027 "awkgram.c" /* yacc.c:1646 */
break;
case 12:
-#line 318 "awkgram.y" /* yacc.c:1645 */
+#line 318 "awkgram.y" /* yacc.c:1646 */
{
want_source = false;
at_seen = false;
@@ -2032,11 +2037,11 @@ yyreduce:
yyerrok;
}
-#line 2036 "awkgram.c" /* yacc.c:1645 */
+#line 2041 "awkgram.c" /* yacc.c:1646 */
break;
case 13:
-#line 331 "awkgram.y" /* yacc.c:1645 */
+#line 331 "awkgram.y" /* yacc.c:1646 */
{
void *srcfile = NULL;
@@ -2046,23 +2051,23 @@ yyreduce:
bcfree((yyvsp[0]));
(yyval) = (INSTRUCTION *) srcfile;
}
-#line 2050 "awkgram.c" /* yacc.c:1645 */
+#line 2055 "awkgram.c" /* yacc.c:1646 */
break;
case 14:
-#line 341 "awkgram.y" /* yacc.c:1645 */
+#line 341 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2056 "awkgram.c" /* yacc.c:1645 */
+#line 2061 "awkgram.c" /* yacc.c:1646 */
break;
case 15:
-#line 343 "awkgram.y" /* yacc.c:1645 */
+#line 343 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2062 "awkgram.c" /* yacc.c:1645 */
+#line 2067 "awkgram.c" /* yacc.c:1646 */
break;
case 16:
-#line 348 "awkgram.y" /* yacc.c:1645 */
+#line 348 "awkgram.y" /* yacc.c:1646 */
{
void *srcfile;
@@ -2072,58 +2077,58 @@ yyreduce:
bcfree((yyvsp[0]));
(yyval) = (INSTRUCTION *) srcfile;
}
-#line 2076 "awkgram.c" /* yacc.c:1645 */
+#line 2081 "awkgram.c" /* yacc.c:1646 */
break;
case 17:
-#line 358 "awkgram.y" /* yacc.c:1645 */
+#line 358 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2082 "awkgram.c" /* yacc.c:1645 */
+#line 2087 "awkgram.c" /* yacc.c:1646 */
break;
case 18:
-#line 360 "awkgram.y" /* yacc.c:1645 */
+#line 360 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2088 "awkgram.c" /* yacc.c:1645 */
+#line 2093 "awkgram.c" /* yacc.c:1646 */
break;
case 19:
-#line 365 "awkgram.y" /* yacc.c:1645 */
+#line 365 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2094 "awkgram.c" /* yacc.c:1645 */
+#line 2099 "awkgram.c" /* yacc.c:1646 */
break;
case 20:
-#line 367 "awkgram.y" /* yacc.c:1645 */
+#line 367 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2100 "awkgram.c" /* yacc.c:1645 */
+#line 2105 "awkgram.c" /* yacc.c:1646 */
break;
case 21:
-#line 369 "awkgram.y" /* yacc.c:1645 */
+#line 369 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2106 "awkgram.c" /* yacc.c:1645 */
+#line 2111 "awkgram.c" /* yacc.c:1646 */
break;
case 22:
-#line 374 "awkgram.y" /* yacc.c:1645 */
+#line 374 "awkgram.y" /* yacc.c:1646 */
{
rule = Rule;
(yyval) = NULL;
}
-#line 2115 "awkgram.c" /* yacc.c:1645 */
+#line 2120 "awkgram.c" /* yacc.c:1646 */
break;
case 23:
-#line 379 "awkgram.y" /* yacc.c:1645 */
+#line 379 "awkgram.y" /* yacc.c:1646 */
{
rule = Rule;
}
-#line 2123 "awkgram.c" /* yacc.c:1645 */
+#line 2128 "awkgram.c" /* yacc.c:1646 */
break;
case 24:
-#line 384 "awkgram.y" /* yacc.c:1645 */
+#line 384 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *tp;
@@ -2153,11 +2158,11 @@ yyreduce:
(yyval) = list_append(list_merge((yyvsp[-2]),
(yyvsp[0])), tp);
rule = Rule;
}
-#line 2157 "awkgram.c" /* yacc.c:1645 */
+#line 2162 "awkgram.c" /* yacc.c:1646 */
break;
case 25:
-#line 414 "awkgram.y" /* yacc.c:1645 */
+#line 414 "awkgram.y" /* yacc.c:1646 */
{
static int begin_seen = 0;
@@ -2169,11 +2174,11 @@ yyreduce:
(yyvsp[0])->source_file = source;
(yyval) = (yyvsp[0]);
}
-#line 2173 "awkgram.c" /* yacc.c:1645 */
+#line 2178 "awkgram.c" /* yacc.c:1646 */
break;
case 26:
-#line 426 "awkgram.y" /* yacc.c:1645 */
+#line 426 "awkgram.y" /* yacc.c:1646 */
{
static int end_seen = 0;
@@ -2185,31 +2190,31 @@ yyreduce:
(yyvsp[0])->source_file = source;
(yyval) = (yyvsp[0]);
}
-#line 2189 "awkgram.c" /* yacc.c:1645 */
+#line 2194 "awkgram.c" /* yacc.c:1646 */
break;
case 27:
-#line 438 "awkgram.y" /* yacc.c:1645 */
+#line 438 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->in_rule = rule = BEGINFILE;
(yyvsp[0])->source_file = source;
(yyval) = (yyvsp[0]);
}
-#line 2199 "awkgram.c" /* yacc.c:1645 */
+#line 2204 "awkgram.c" /* yacc.c:1646 */
break;
case 28:
-#line 444 "awkgram.y" /* yacc.c:1645 */
+#line 444 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->in_rule = rule = ENDFILE;
(yyvsp[0])->source_file = source;
(yyval) = (yyvsp[0]);
}
-#line 2209 "awkgram.c" /* yacc.c:1645 */
+#line 2214 "awkgram.c" /* yacc.c:1646 */
break;
case 29:
-#line 453 "awkgram.y" /* yacc.c:1645 */
+#line 453 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = make_braced_statements((yyvsp[-4]),
(yyvsp[-3]), (yyvsp[-2]));
@@ -2224,14 +2229,14 @@ yyreduce:
(yyval) = ip;
}
-#line 2228 "awkgram.c" /* yacc.c:1645 */
+#line 2233 "awkgram.c" /* yacc.c:1646 */
break;
case 30:
-#line 471 "awkgram.y" /* yacc.c:1645 */
+#line 471 "awkgram.y" /* yacc.c:1646 */
{
const char *name = (yyvsp[0])->lextok;
- char *qname = qualify_name(name, strlen(name), false);
+ char *qname = qualify_name(name, strlen(name));
if (qname != name) {
efree((void *)name);
@@ -2239,14 +2244,14 @@ yyreduce:
}
(yyval) = (yyvsp[0]);
}
-#line 2243 "awkgram.c" /* yacc.c:1645 */
+#line 2248 "awkgram.c" /* yacc.c:1646 */
break;
case 31:
-#line 482 "awkgram.y" /* yacc.c:1645 */
+#line 482 "awkgram.y" /* yacc.c:1646 */
{
const char *name = (yyvsp[0])->lextok;
- char *qname = qualify_name(name, strlen(name), false);
+ char *qname = qualify_name(name, strlen(name));
if (qname != name) {
efree((void *)name);
@@ -2254,36 +2259,36 @@ yyreduce:
}
(yyval) = (yyvsp[0]);
}
-#line 2258 "awkgram.c" /* yacc.c:1645 */
+#line 2263 "awkgram.c" /* yacc.c:1646 */
break;
case 32:
-#line 493 "awkgram.y" /* yacc.c:1645 */
+#line 493 "awkgram.y" /* yacc.c:1646 */
{
yyerror(_("`%s' is a built-in function, it cannot be
redefined"),
tokstart);
YYABORT;
}
-#line 2268 "awkgram.c" /* yacc.c:1645 */
+#line 2273 "awkgram.c" /* yacc.c:1646 */
break;
case 33:
-#line 499 "awkgram.y" /* yacc.c:1645 */
+#line 499 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = (yyvsp[0]);
at_seen = false;
}
-#line 2277 "awkgram.c" /* yacc.c:1645 */
+#line 2282 "awkgram.c" /* yacc.c:1646 */
break;
case 36:
-#line 511 "awkgram.y" /* yacc.c:1645 */
+#line 511 "awkgram.y" /* yacc.c:1646 */
{ want_param_names = FUNC_HEADER; }
-#line 2283 "awkgram.c" /* yacc.c:1645 */
+#line 2288 "awkgram.c" /* yacc.c:1646 */
break;
case 37:
-#line 512 "awkgram.y" /* yacc.c:1645 */
+#line 512 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *func_comment = NULL;
// Merge any comments found in the parameter list with those
@@ -2309,17 +2314,17 @@ yyreduce:
(yyval) = (yyvsp[-6]);
want_param_names = FUNC_BODY;
}
-#line 2313 "awkgram.c" /* yacc.c:1645 */
+#line 2318 "awkgram.c" /* yacc.c:1646 */
break;
case 38:
-#line 545 "awkgram.y" /* yacc.c:1645 */
+#line 545 "awkgram.y" /* yacc.c:1646 */
{ want_regexp = true; }
-#line 2319 "awkgram.c" /* yacc.c:1645 */
+#line 2324 "awkgram.c" /* yacc.c:1646 */
break;
case 39:
-#line 547 "awkgram.y" /* yacc.c:1645 */
+#line 547 "awkgram.y" /* yacc.c:1646 */
{
NODE *n, *exp;
char *re;
@@ -2348,11 +2353,11 @@ yyreduce:
(yyval)->opcode = Op_match_rec;
(yyval)->memory = n;
}
-#line 2352 "awkgram.c" /* yacc.c:1645 */
+#line 2357 "awkgram.c" /* yacc.c:1646 */
break;
case 40:
-#line 579 "awkgram.y" /* yacc.c:1645 */
+#line 579 "awkgram.y" /* yacc.c:1646 */
{
char *re;
size_t len;
@@ -2365,23 +2370,23 @@ yyreduce:
(yyval)->opcode = Op_push_re;
(yyval)->memory = make_typed_regex(re, len);
}
-#line 2369 "awkgram.c" /* yacc.c:1645 */
+#line 2374 "awkgram.c" /* yacc.c:1646 */
break;
case 41:
-#line 594 "awkgram.y" /* yacc.c:1645 */
+#line 594 "awkgram.y" /* yacc.c:1646 */
{ bcfree((yyvsp[0])); }
-#line 2375 "awkgram.c" /* yacc.c:1645 */
+#line 2380 "awkgram.c" /* yacc.c:1646 */
break;
case 43:
-#line 600 "awkgram.y" /* yacc.c:1645 */
+#line 600 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2381 "awkgram.c" /* yacc.c:1645 */
+#line 2386 "awkgram.c" /* yacc.c:1646 */
break;
case 44:
-#line 602 "awkgram.y" /* yacc.c:1645 */
+#line 602 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0]) == NULL) {
(yyval) = (yyvsp[-1]);
@@ -2401,29 +2406,29 @@ yyreduce:
yyerrok;
}
-#line 2405 "awkgram.c" /* yacc.c:1645 */
+#line 2410 "awkgram.c" /* yacc.c:1646 */
break;
case 45:
-#line 622 "awkgram.y" /* yacc.c:1645 */
+#line 622 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2411 "awkgram.c" /* yacc.c:1645 */
+#line 2416 "awkgram.c" /* yacc.c:1646 */
break;
case 46:
-#line 626 "awkgram.y" /* yacc.c:1645 */
+#line 626 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2417 "awkgram.c" /* yacc.c:1645 */
+#line 2422 "awkgram.c" /* yacc.c:1646 */
break;
case 47:
-#line 627 "awkgram.y" /* yacc.c:1645 */
+#line 627 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2423 "awkgram.c" /* yacc.c:1645 */
+#line 2428 "awkgram.c" /* yacc.c:1646 */
break;
case 48:
-#line 632 "awkgram.y" /* yacc.c:1645 */
+#line 632 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0]) != NULL) {
INSTRUCTION *ip;
@@ -2434,31 +2439,31 @@ yyreduce:
} else
(yyval) = NULL;
}
-#line 2438 "awkgram.c" /* yacc.c:1645 */
+#line 2443 "awkgram.c" /* yacc.c:1646 */
break;
case 49:
-#line 643 "awkgram.y" /* yacc.c:1645 */
+#line 643 "awkgram.y" /* yacc.c:1646 */
{
trailing_comment = (yyvsp[0]); // NULL or comment
(yyval) = make_braced_statements((yyvsp[-2]), (yyvsp[-1]),
(yyvsp[0]));
}
-#line 2447 "awkgram.c" /* yacc.c:1645 */
+#line 2452 "awkgram.c" /* yacc.c:1646 */
break;
case 50:
-#line 648 "awkgram.y" /* yacc.c:1645 */
+#line 648 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]),
instruction(Op_exec_count));
else
(yyval) = (yyvsp[0]);
}
-#line 2458 "awkgram.c" /* yacc.c:1645 */
+#line 2463 "awkgram.c" /* yacc.c:1646 */
break;
case 51:
-#line 655 "awkgram.y" /* yacc.c:1645 */
+#line 655 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2566,11 +2571,11 @@ yyreduce:
break_allowed--;
fix_break_continue(ip, tbreak, NULL);
}
-#line 2570 "awkgram.c" /* yacc.c:1645 */
+#line 2575 "awkgram.c" /* yacc.c:1646 */
break;
case 52:
-#line 763 "awkgram.y" /* yacc.c:1645 */
+#line 763 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2621,11 +2626,11 @@ yyreduce:
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
}
-#line 2625 "awkgram.c" /* yacc.c:1645 */
+#line 2630 "awkgram.c" /* yacc.c:1646 */
break;
case 53:
-#line 814 "awkgram.y" /* yacc.c:1645 */
+#line 814 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2675,11 +2680,11 @@ yyreduce:
/* else
$1 and $4 are NULLs */
}
-#line 2679 "awkgram.c" /* yacc.c:1645 */
+#line 2684 "awkgram.c" /* yacc.c:1646 */
break;
case 54:
-#line 864 "awkgram.y" /* yacc.c:1645 */
+#line 864 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip;
char *var_name = (yyvsp[-5])->lextok;
@@ -2805,11 +2810,11 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
-#line 2809 "awkgram.c" /* yacc.c:1645 */
+#line 2814 "awkgram.c" /* yacc.c:1646 */
break;
case 55:
-#line 990 "awkgram.y" /* yacc.c:1645 */
+#line 990 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-7]) != NULL) {
merge_comments((yyvsp[-7]), NULL);
@@ -2830,11 +2835,11 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
-#line 2834 "awkgram.c" /* yacc.c:1645 */
+#line 2839 "awkgram.c" /* yacc.c:1646 */
break;
case 56:
-#line 1011 "awkgram.y" /* yacc.c:1645 */
+#line 1011 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-6]) != NULL) {
merge_comments((yyvsp[-6]), NULL);
@@ -2855,22 +2860,22 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
-#line 2859 "awkgram.c" /* yacc.c:1645 */
+#line 2864 "awkgram.c" /* yacc.c:1646 */
break;
case 57:
-#line 1032 "awkgram.y" /* yacc.c:1645 */
+#line 1032 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]),
instruction(Op_exec_count));
else
(yyval) = (yyvsp[0]);
}
-#line 2870 "awkgram.c" /* yacc.c:1645 */
+#line 2875 "awkgram.c" /* yacc.c:1646 */
break;
case 58:
-#line 1042 "awkgram.y" /* yacc.c:1645 */
+#line 1042 "awkgram.y" /* yacc.c:1646 */
{
if (! break_allowed)
error_ln((yyvsp[-1])->source_line,
@@ -2880,11 +2885,11 @@ regular_loop:
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyval), (yyvsp[0]));
}
-#line 2884 "awkgram.c" /* yacc.c:1645 */
+#line 2889 "awkgram.c" /* yacc.c:1646 */
break;
case 59:
-#line 1052 "awkgram.y" /* yacc.c:1645 */
+#line 1052 "awkgram.y" /* yacc.c:1646 */
{
if (! continue_allowed)
error_ln((yyvsp[-1])->source_line,
@@ -2894,11 +2899,11 @@ regular_loop:
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyval), (yyvsp[0]));
}
-#line 2898 "awkgram.c" /* yacc.c:1645 */
+#line 2903 "awkgram.c" /* yacc.c:1646 */
break;
case 60:
-#line 1062 "awkgram.y" /* yacc.c:1645 */
+#line 1062 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2909,11 +2914,11 @@ regular_loop:
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyval), (yyvsp[0]));
}
-#line 2913 "awkgram.c" /* yacc.c:1645 */
+#line 2918 "awkgram.c" /* yacc.c:1646 */
break;
case 61:
-#line 1073 "awkgram.y" /* yacc.c:1645 */
+#line 1073 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
@@ -2926,11 +2931,11 @@ regular_loop:
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyval), (yyvsp[0]));
}
-#line 2930 "awkgram.c" /* yacc.c:1645 */
+#line 2935 "awkgram.c" /* yacc.c:1646 */
break;
case 62:
-#line 1086 "awkgram.y" /* yacc.c:1645 */
+#line 1086 "awkgram.y" /* yacc.c:1646 */
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2947,20 +2952,20 @@ regular_loop:
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyval), (yyvsp[0]));
}
-#line 2951 "awkgram.c" /* yacc.c:1645 */
+#line 2956 "awkgram.c" /* yacc.c:1646 */
break;
case 63:
-#line 1103 "awkgram.y" /* yacc.c:1645 */
+#line 1103 "awkgram.y" /* yacc.c:1646 */
{
if (! in_function)
yyerror(_("`return' used outside function context"));
}
-#line 2960 "awkgram.c" /* yacc.c:1645 */
+#line 2965 "awkgram.c" /* yacc.c:1646 */
break;
case 64:
-#line 1106 "awkgram.y" /* yacc.c:1645 */
+#line 1106 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) == NULL) {
(yyval) = list_create((yyvsp[-3]));
@@ -2971,28 +2976,28 @@ regular_loop:
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyval), (yyvsp[0]));
}
-#line 2975 "awkgram.c" /* yacc.c:1645 */
+#line 2980 "awkgram.c" /* yacc.c:1646 */
break;
case 65:
-#line 1117 "awkgram.y" /* yacc.c:1645 */
+#line 1117 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyvsp[-1]), (yyvsp[0]));
else
(yyval) = (yyvsp[-1]);
}
-#line 2986 "awkgram.c" /* yacc.c:1645 */
+#line 2991 "awkgram.c" /* yacc.c:1646 */
break;
case 66:
-#line 1134 "awkgram.y" /* yacc.c:1645 */
+#line 1134 "awkgram.y" /* yacc.c:1646 */
{ in_print = true; in_parens = 0; }
-#line 2992 "awkgram.c" /* yacc.c:1645 */
+#line 2997 "awkgram.c" /* yacc.c:1646 */
break;
case 67:
-#line 1135 "awkgram.y" /* yacc.c:1645 */
+#line 1135 "awkgram.y" /* yacc.c:1646 */
{
/*
* Optimization: plain `print' has no expression list, so $3 is
null.
@@ -3089,17 +3094,17 @@ regular_print:
}
}
}
-#line 3093 "awkgram.c" /* yacc.c:1645 */
+#line 3098 "awkgram.c" /* yacc.c:1646 */
break;
case 68:
-#line 1232 "awkgram.y" /* yacc.c:1645 */
+#line 1232 "awkgram.y" /* yacc.c:1646 */
{ sub_counter = 0; }
-#line 3099 "awkgram.c" /* yacc.c:1645 */
+#line 3104 "awkgram.c" /* yacc.c:1646 */
break;
case 69:
-#line 1233 "awkgram.y" /* yacc.c:1645 */
+#line 1233 "awkgram.y" /* yacc.c:1646 */
{
char *arr = (yyvsp[-2])->lextok;
@@ -3132,11 +3137,11 @@ regular_print:
(yyval) = list_append(list_append((yyvsp[0]),
(yyvsp[-2])), (yyvsp[-3]));
}
}
-#line 3136 "awkgram.c" /* yacc.c:1645 */
+#line 3141 "awkgram.c" /* yacc.c:1646 */
break;
case 70:
-#line 1270 "awkgram.y" /* yacc.c:1645 */
+#line 1270 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
char *arr = (yyvsp[-1])->lextok;
@@ -3162,54 +3167,54 @@ regular_print:
fatal(_("`delete' is not allowed with
FUNCTAB"));
}
}
-#line 3166 "awkgram.c" /* yacc.c:1645 */
+#line 3171 "awkgram.c" /* yacc.c:1646 */
break;
case 71:
-#line 1296 "awkgram.y" /* yacc.c:1645 */
+#line 1296 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = optimize_assignment((yyvsp[0]));
}
-#line 3174 "awkgram.c" /* yacc.c:1645 */
+#line 3179 "awkgram.c" /* yacc.c:1646 */
break;
case 72:
-#line 1303 "awkgram.y" /* yacc.c:1645 */
+#line 1303 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3180 "awkgram.c" /* yacc.c:1645 */
+#line 3185 "awkgram.c" /* yacc.c:1646 */
break;
case 73:
-#line 1305 "awkgram.y" /* yacc.c:1645 */
+#line 1305 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3186 "awkgram.c" /* yacc.c:1645 */
+#line 3191 "awkgram.c" /* yacc.c:1646 */
break;
case 74:
-#line 1310 "awkgram.y" /* yacc.c:1645 */
+#line 1310 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3192 "awkgram.c" /* yacc.c:1645 */
+#line 3197 "awkgram.c" /* yacc.c:1646 */
break;
case 75:
-#line 1312 "awkgram.y" /* yacc.c:1645 */
+#line 1312 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) == NULL)
(yyval) = list_create((yyvsp[0]));
else
(yyval) = list_prepend((yyvsp[-1]), (yyvsp[0]));
}
-#line 3203 "awkgram.c" /* yacc.c:1645 */
+#line 3208 "awkgram.c" /* yacc.c:1646 */
break;
case 76:
-#line 1319 "awkgram.y" /* yacc.c:1645 */
+#line 1319 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3209 "awkgram.c" /* yacc.c:1645 */
+#line 3214 "awkgram.c" /* yacc.c:1646 */
break;
case 77:
-#line 1324 "awkgram.y" /* yacc.c:1645 */
+#line 1324 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -3222,11 +3227,11 @@ regular_print:
bcfree((yyvsp[-2]));
(yyval) = (yyvsp[-4]);
}
-#line 3226 "awkgram.c" /* yacc.c:1645 */
+#line 3231 "awkgram.c" /* yacc.c:1646 */
break;
case 78:
-#line 1337 "awkgram.y" /* yacc.c:1645 */
+#line 1337 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -3238,17 +3243,17 @@ regular_print:
(yyvsp[-3])->comment = (yyvsp[-1]);
(yyval) = (yyvsp[-3]);
}
-#line 3242 "awkgram.c" /* yacc.c:1645 */
+#line 3247 "awkgram.c" /* yacc.c:1646 */
break;
case 79:
-#line 1352 "awkgram.y" /* yacc.c:1645 */
+#line 1352 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3248 "awkgram.c" /* yacc.c:1645 */
+#line 3253 "awkgram.c" /* yacc.c:1646 */
break;
case 80:
-#line 1354 "awkgram.y" /* yacc.c:1645 */
+#line 1354 "awkgram.y" /* yacc.c:1646 */
{
NODE *n = (yyvsp[0])->memory;
(void) force_number(n);
@@ -3256,28 +3261,28 @@ regular_print:
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3260 "awkgram.c" /* yacc.c:1645 */
+#line 3265 "awkgram.c" /* yacc.c:1646 */
break;
case 81:
-#line 1362 "awkgram.y" /* yacc.c:1645 */
+#line 1362 "awkgram.y" /* yacc.c:1646 */
{
NODE *n = (yyvsp[0])->lasti->memory;
bcfree((yyvsp[-1]));
add_sign_to_num(n, '+');
(yyval) = (yyvsp[0]);
}
-#line 3271 "awkgram.c" /* yacc.c:1645 */
+#line 3276 "awkgram.c" /* yacc.c:1646 */
break;
case 82:
-#line 1369 "awkgram.y" /* yacc.c:1645 */
+#line 1369 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3277 "awkgram.c" /* yacc.c:1645 */
+#line 3282 "awkgram.c" /* yacc.c:1646 */
break;
case 83:
-#line 1371 "awkgram.y" /* yacc.c:1645 */
+#line 1371 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->memory->type == Node_regex)
(yyvsp[0])->opcode = Op_push_re;
@@ -3285,57 +3290,57 @@ regular_print:
(yyvsp[0])->opcode = Op_push;
(yyval) = (yyvsp[0]);
}
-#line 3289 "awkgram.c" /* yacc.c:1645 */
+#line 3294 "awkgram.c" /* yacc.c:1646 */
break;
case 84:
-#line 1379 "awkgram.y" /* yacc.c:1645 */
+#line 1379 "awkgram.y" /* yacc.c:1646 */
{
assert(((yyvsp[0])->memory->flags & REGEX) == REGEX);
(yyvsp[0])->opcode = Op_push_re;
(yyval) = (yyvsp[0]);
}
-#line 3299 "awkgram.c" /* yacc.c:1645 */
+#line 3304 "awkgram.c" /* yacc.c:1646 */
break;
case 85:
-#line 1388 "awkgram.y" /* yacc.c:1645 */
+#line 1388 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3305 "awkgram.c" /* yacc.c:1645 */
+#line 3310 "awkgram.c" /* yacc.c:1646 */
break;
case 86:
-#line 1390 "awkgram.y" /* yacc.c:1645 */
+#line 1390 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3311 "awkgram.c" /* yacc.c:1645 */
+#line 3316 "awkgram.c" /* yacc.c:1646 */
break;
case 88:
-#line 1400 "awkgram.y" /* yacc.c:1645 */
+#line 1400 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = (yyvsp[-1]);
}
-#line 3319 "awkgram.c" /* yacc.c:1645 */
+#line 3324 "awkgram.c" /* yacc.c:1646 */
break;
case 89:
-#line 1407 "awkgram.y" /* yacc.c:1645 */
+#line 1407 "awkgram.y" /* yacc.c:1646 */
{
in_print = false;
in_parens = 0;
(yyval) = NULL;
}
-#line 3329 "awkgram.c" /* yacc.c:1645 */
+#line 3334 "awkgram.c" /* yacc.c:1646 */
break;
case 90:
-#line 1412 "awkgram.y" /* yacc.c:1645 */
+#line 1412 "awkgram.y" /* yacc.c:1646 */
{ in_print = false; in_parens = 0; }
-#line 3335 "awkgram.c" /* yacc.c:1645 */
+#line 3340 "awkgram.c" /* yacc.c:1646 */
break;
case 91:
-#line 1413 "awkgram.y" /* yacc.c:1645 */
+#line 1413 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->redir_type == redirect_twoway
&& (yyvsp[0])->lasti->opcode == Op_K_getline_redir
@@ -3345,21 +3350,21 @@ regular_print:
lintwarn(_("concatenation as I/O `>' redirection target
is ambiguous"));
(yyval) = list_prepend((yyvsp[0]), (yyvsp[-2]));
}
-#line 3349 "awkgram.c" /* yacc.c:1645 */
+#line 3354 "awkgram.c" /* yacc.c:1646 */
break;
case 92:
-#line 1426 "awkgram.y" /* yacc.c:1645 */
+#line 1426 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) != NULL)
(yyvsp[-5])->comment = (yyvsp[-1]);
(yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]),
NULL, NULL);
}
-#line 3359 "awkgram.c" /* yacc.c:1645 */
+#line 3364 "awkgram.c" /* yacc.c:1646 */
break;
case 93:
-#line 1433 "awkgram.y" /* yacc.c:1645 */
+#line 1433 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-4]) != NULL)
(yyvsp[-8])->comment = (yyvsp[-4]);
@@ -3367,19 +3372,19 @@ regular_print:
(yyvsp[-2])->comment = (yyvsp[-1]);
(yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]),
(yyvsp[-2]), (yyvsp[0]));
}
-#line 3371 "awkgram.c" /* yacc.c:1645 */
+#line 3376 "awkgram.c" /* yacc.c:1646 */
break;
case 94:
-#line 1444 "awkgram.y" /* yacc.c:1645 */
+#line 1444 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = (yyvsp[0]);
}
-#line 3379 "awkgram.c" /* yacc.c:1645 */
+#line 3384 "awkgram.c" /* yacc.c:1646 */
break;
case 95:
-#line 1448 "awkgram.y" /* yacc.c:1645 */
+#line 1448 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) != NULL && (yyvsp[0]) != NULL) {
if ((yyvsp[-1])->memory->comment_type == EOL_COMMENT) {
@@ -3397,59 +3402,59 @@ regular_print:
} else
(yyval) = NULL;
}
-#line 3401 "awkgram.c" /* yacc.c:1645 */
+#line 3406 "awkgram.c" /* yacc.c:1646 */
break;
case 96:
-#line 1469 "awkgram.y" /* yacc.c:1645 */
+#line 1469 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3407 "awkgram.c" /* yacc.c:1645 */
+#line 3412 "awkgram.c" /* yacc.c:1646 */
break;
case 97:
-#line 1471 "awkgram.y" /* yacc.c:1645 */
+#line 1471 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3413 "awkgram.c" /* yacc.c:1645 */
+#line 3418 "awkgram.c" /* yacc.c:1646 */
break;
case 98:
-#line 1476 "awkgram.y" /* yacc.c:1645 */
+#line 1476 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3419 "awkgram.c" /* yacc.c:1645 */
+#line 3424 "awkgram.c" /* yacc.c:1646 */
break;
case 99:
-#line 1478 "awkgram.y" /* yacc.c:1645 */
+#line 1478 "awkgram.y" /* yacc.c:1646 */
{
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3428 "awkgram.c" /* yacc.c:1645 */
+#line 3433 "awkgram.c" /* yacc.c:1646 */
break;
case 100:
-#line 1486 "awkgram.y" /* yacc.c:1645 */
+#line 1486 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3434 "awkgram.c" /* yacc.c:1645 */
+#line 3439 "awkgram.c" /* yacc.c:1646 */
break;
case 101:
-#line 1488 "awkgram.y" /* yacc.c:1645 */
+#line 1488 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3440 "awkgram.c" /* yacc.c:1645 */
+#line 3445 "awkgram.c" /* yacc.c:1646 */
break;
case 102:
-#line 1493 "awkgram.y" /* yacc.c:1645 */
+#line 1493 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->param_count = 0;
(yyval) = list_create((yyvsp[0]));
}
-#line 3449 "awkgram.c" /* yacc.c:1645 */
+#line 3454 "awkgram.c" /* yacc.c:1646 */
break;
case 103:
-#line 1498 "awkgram.y" /* yacc.c:1645 */
+#line 1498 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2]) != NULL && (yyvsp[0]) != NULL) {
(yyvsp[0])->param_count =
(yyvsp[-2])->lasti->param_count + 1;
@@ -3466,76 +3471,76 @@ regular_print:
} else
(yyval) = NULL;
}
-#line 3470 "awkgram.c" /* yacc.c:1645 */
+#line 3475 "awkgram.c" /* yacc.c:1646 */
break;
case 104:
-#line 1515 "awkgram.y" /* yacc.c:1645 */
+#line 1515 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3476 "awkgram.c" /* yacc.c:1645 */
+#line 3481 "awkgram.c" /* yacc.c:1646 */
break;
case 105:
-#line 1517 "awkgram.y" /* yacc.c:1645 */
+#line 1517 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3482 "awkgram.c" /* yacc.c:1645 */
+#line 3487 "awkgram.c" /* yacc.c:1646 */
break;
case 106:
-#line 1519 "awkgram.y" /* yacc.c:1645 */
+#line 1519 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-2]); }
-#line 3488 "awkgram.c" /* yacc.c:1645 */
+#line 3493 "awkgram.c" /* yacc.c:1646 */
break;
case 107:
-#line 1525 "awkgram.y" /* yacc.c:1645 */
+#line 1525 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3494 "awkgram.c" /* yacc.c:1645 */
+#line 3499 "awkgram.c" /* yacc.c:1646 */
break;
case 108:
-#line 1527 "awkgram.y" /* yacc.c:1645 */
+#line 1527 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3500 "awkgram.c" /* yacc.c:1645 */
+#line 3505 "awkgram.c" /* yacc.c:1646 */
break;
case 109:
-#line 1532 "awkgram.y" /* yacc.c:1645 */
+#line 1532 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3506 "awkgram.c" /* yacc.c:1645 */
+#line 3511 "awkgram.c" /* yacc.c:1646 */
break;
case 110:
-#line 1534 "awkgram.y" /* yacc.c:1645 */
+#line 1534 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3512 "awkgram.c" /* yacc.c:1645 */
+#line 3517 "awkgram.c" /* yacc.c:1646 */
break;
case 111:
-#line 1539 "awkgram.y" /* yacc.c:1645 */
+#line 1539 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3518 "awkgram.c" /* yacc.c:1645 */
+#line 3523 "awkgram.c" /* yacc.c:1646 */
break;
case 112:
-#line 1541 "awkgram.y" /* yacc.c:1645 */
+#line 1541 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) != NULL)
(yyvsp[-2])->lasti->comment = (yyvsp[-1]);
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3529 "awkgram.c" /* yacc.c:1645 */
+#line 3534 "awkgram.c" /* yacc.c:1646 */
break;
case 113:
-#line 1548 "awkgram.y" /* yacc.c:1645 */
+#line 1548 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3535 "awkgram.c" /* yacc.c:1645 */
+#line 3540 "awkgram.c" /* yacc.c:1646 */
break;
case 114:
-#line 1550 "awkgram.y" /* yacc.c:1645 */
+#line 1550 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3543,66 +3548,66 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3547 "awkgram.c" /* yacc.c:1645 */
+#line 3552 "awkgram.c" /* yacc.c:1646 */
break;
case 115:
-#line 1558 "awkgram.y" /* yacc.c:1645 */
+#line 1558 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3556 "awkgram.c" /* yacc.c:1645 */
+#line 3561 "awkgram.c" /* yacc.c:1646 */
break;
case 116:
-#line 1563 "awkgram.y" /* yacc.c:1645 */
+#line 1563 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
if ((yyvsp[-1]) != NULL)
(yyvsp[-2])->lasti->comment = (yyvsp[-1]);
(yyval) = (yyvsp[-2]);
}
-#line 3567 "awkgram.c" /* yacc.c:1645 */
+#line 3572 "awkgram.c" /* yacc.c:1646 */
break;
case 117:
-#line 1573 "awkgram.y" /* yacc.c:1645 */
+#line 1573 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3573 "awkgram.c" /* yacc.c:1645 */
+#line 3578 "awkgram.c" /* yacc.c:1646 */
break;
case 118:
-#line 1575 "awkgram.y" /* yacc.c:1645 */
+#line 1575 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3579 "awkgram.c" /* yacc.c:1645 */
+#line 3584 "awkgram.c" /* yacc.c:1646 */
break;
case 119:
-#line 1580 "awkgram.y" /* yacc.c:1645 */
+#line 1580 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3585 "awkgram.c" /* yacc.c:1645 */
+#line 3590 "awkgram.c" /* yacc.c:1646 */
break;
case 120:
-#line 1582 "awkgram.y" /* yacc.c:1645 */
+#line 1582 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) != NULL)
(yyvsp[-2])->lasti->comment = (yyvsp[-1]);
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3596 "awkgram.c" /* yacc.c:1645 */
+#line 3601 "awkgram.c" /* yacc.c:1646 */
break;
case 121:
-#line 1589 "awkgram.y" /* yacc.c:1645 */
+#line 1589 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3602 "awkgram.c" /* yacc.c:1645 */
+#line 3607 "awkgram.c" /* yacc.c:1646 */
break;
case 122:
-#line 1591 "awkgram.y" /* yacc.c:1645 */
+#line 1591 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3610,74 +3615,74 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3614 "awkgram.c" /* yacc.c:1645 */
+#line 3619 "awkgram.c" /* yacc.c:1646 */
break;
case 123:
-#line 1599 "awkgram.y" /* yacc.c:1645 */
+#line 1599 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3623 "awkgram.c" /* yacc.c:1645 */
+#line 3628 "awkgram.c" /* yacc.c:1646 */
break;
case 124:
-#line 1604 "awkgram.y" /* yacc.c:1645 */
+#line 1604 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
if ((yyvsp[-1]) != NULL)
(yyvsp[-2])->comment = (yyvsp[-1]);
(yyval) = (yyvsp[-2]);
}
-#line 3634 "awkgram.c" /* yacc.c:1645 */
+#line 3639 "awkgram.c" /* yacc.c:1646 */
break;
case 125:
-#line 1613 "awkgram.y" /* yacc.c:1645 */
+#line 1613 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3640 "awkgram.c" /* yacc.c:1645 */
+#line 3645 "awkgram.c" /* yacc.c:1646 */
break;
case 126:
-#line 1614 "awkgram.y" /* yacc.c:1645 */
+#line 1614 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = list_create((yyvsp[0])); }
-#line 3646 "awkgram.c" /* yacc.c:1645 */
+#line 3651 "awkgram.c" /* yacc.c:1646 */
break;
case 127:
-#line 1620 "awkgram.y" /* yacc.c:1645 */
+#line 1620 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec)
lintwarn_ln((yyvsp[-1])->source_line,
_("regular expression on right of assignment"));
(yyval) = mk_assignment((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1]));
}
-#line 3657 "awkgram.c" /* yacc.c:1645 */
+#line 3662 "awkgram.c" /* yacc.c:1646 */
break;
case 128:
-#line 1627 "awkgram.y" /* yacc.c:1645 */
+#line 1627 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_assignment((yyvsp[-2]), list_create((yyvsp[0])),
(yyvsp[-1]));
}
-#line 3665 "awkgram.c" /* yacc.c:1645 */
+#line 3670 "awkgram.c" /* yacc.c:1646 */
break;
case 129:
-#line 1631 "awkgram.y" /* yacc.c:1645 */
+#line 1631 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3671 "awkgram.c" /* yacc.c:1645 */
+#line 3676 "awkgram.c" /* yacc.c:1646 */
break;
case 130:
-#line 1633 "awkgram.y" /* yacc.c:1645 */
+#line 1633 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3677 "awkgram.c" /* yacc.c:1645 */
+#line 3682 "awkgram.c" /* yacc.c:1646 */
break;
case 131:
-#line 1635 "awkgram.y" /* yacc.c:1645 */
+#line 1635 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3690,11 +3695,11 @@ regular_print:
bcfree((yyvsp[0]));
(yyval) = list_append((yyvsp[-2]), (yyvsp[-1]));
}
-#line 3694 "awkgram.c" /* yacc.c:1645 */
+#line 3699 "awkgram.c" /* yacc.c:1646 */
break;
case 132:
-#line 1648 "awkgram.y" /* yacc.c:1645 */
+#line 1648 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3711,11 +3716,11 @@ regular_print:
(yyval) = list_append(list_merge((yyvsp[-2]),
(yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3715 "awkgram.c" /* yacc.c:1645 */
+#line 3720 "awkgram.c" /* yacc.c:1646 */
break;
case 133:
-#line 1665 "awkgram.y" /* yacc.c:1645 */
+#line 1665 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old)
warning_ln((yyvsp[-1])->source_line,
@@ -3725,91 +3730,91 @@ regular_print:
(yyvsp[-1])->expr_count = 1;
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])),
(yyvsp[-1]));
}
-#line 3729 "awkgram.c" /* yacc.c:1645 */
+#line 3734 "awkgram.c" /* yacc.c:1646 */
break;
case 134:
-#line 1675 "awkgram.y" /* yacc.c:1645 */
+#line 1675 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec)
lintwarn_ln((yyvsp[-1])->source_line,
_("regular expression on right of comparison"));
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])),
(yyvsp[-1]));
}
-#line 3740 "awkgram.c" /* yacc.c:1645 */
+#line 3745 "awkgram.c" /* yacc.c:1646 */
break;
case 135:
-#line 1682 "awkgram.y" /* yacc.c:1645 */
+#line 1682 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]),
(yyvsp[-1]), (yyvsp[0])); }
-#line 3746 "awkgram.c" /* yacc.c:1645 */
+#line 3751 "awkgram.c" /* yacc.c:1646 */
break;
case 136:
-#line 1684 "awkgram.y" /* yacc.c:1645 */
+#line 1684 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3752 "awkgram.c" /* yacc.c:1645 */
+#line 3757 "awkgram.c" /* yacc.c:1646 */
break;
case 137:
-#line 1689 "awkgram.y" /* yacc.c:1645 */
+#line 1689 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3758 "awkgram.c" /* yacc.c:1645 */
+#line 3763 "awkgram.c" /* yacc.c:1646 */
break;
case 138:
-#line 1691 "awkgram.y" /* yacc.c:1645 */
+#line 1691 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3764 "awkgram.c" /* yacc.c:1645 */
+#line 3769 "awkgram.c" /* yacc.c:1646 */
break;
case 139:
-#line 1693 "awkgram.y" /* yacc.c:1645 */
+#line 1693 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[0]);
}
-#line 3773 "awkgram.c" /* yacc.c:1645 */
+#line 3778 "awkgram.c" /* yacc.c:1646 */
break;
case 140:
-#line 1701 "awkgram.y" /* yacc.c:1645 */
+#line 1701 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3779 "awkgram.c" /* yacc.c:1645 */
+#line 3784 "awkgram.c" /* yacc.c:1646 */
break;
case 141:
-#line 1703 "awkgram.y" /* yacc.c:1645 */
+#line 1703 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3785 "awkgram.c" /* yacc.c:1645 */
+#line 3790 "awkgram.c" /* yacc.c:1646 */
break;
case 142:
-#line 1708 "awkgram.y" /* yacc.c:1645 */
+#line 1708 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3791 "awkgram.c" /* yacc.c:1645 */
+#line 3796 "awkgram.c" /* yacc.c:1646 */
break;
case 143:
-#line 1710 "awkgram.y" /* yacc.c:1645 */
+#line 1710 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3797 "awkgram.c" /* yacc.c:1645 */
+#line 3802 "awkgram.c" /* yacc.c:1646 */
break;
case 144:
-#line 1715 "awkgram.y" /* yacc.c:1645 */
+#line 1715 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3803 "awkgram.c" /* yacc.c:1645 */
+#line 3808 "awkgram.c" /* yacc.c:1646 */
break;
case 145:
-#line 1717 "awkgram.y" /* yacc.c:1645 */
+#line 1717 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3809 "awkgram.c" /* yacc.c:1645 */
+#line 3814 "awkgram.c" /* yacc.c:1646 */
break;
case 146:
-#line 1719 "awkgram.y" /* yacc.c:1645 */
+#line 1719 "awkgram.y" /* yacc.c:1646 */
{
int count = 2;
bool is_simple_var = false;
@@ -3863,47 +3868,47 @@ regular_print:
max_args = count;
}
}
-#line 3867 "awkgram.c" /* yacc.c:1645 */
+#line 3872 "awkgram.c" /* yacc.c:1646 */
break;
case 148:
-#line 1778 "awkgram.y" /* yacc.c:1645 */
+#line 1778 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3873 "awkgram.c" /* yacc.c:1645 */
+#line 3878 "awkgram.c" /* yacc.c:1646 */
break;
case 149:
-#line 1780 "awkgram.y" /* yacc.c:1645 */
+#line 1780 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3879 "awkgram.c" /* yacc.c:1645 */
+#line 3884 "awkgram.c" /* yacc.c:1646 */
break;
case 150:
-#line 1782 "awkgram.y" /* yacc.c:1645 */
+#line 1782 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3885 "awkgram.c" /* yacc.c:1645 */
+#line 3890 "awkgram.c" /* yacc.c:1646 */
break;
case 151:
-#line 1784 "awkgram.y" /* yacc.c:1645 */
+#line 1784 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3891 "awkgram.c" /* yacc.c:1645 */
+#line 3896 "awkgram.c" /* yacc.c:1646 */
break;
case 152:
-#line 1786 "awkgram.y" /* yacc.c:1645 */
+#line 1786 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3897 "awkgram.c" /* yacc.c:1645 */
+#line 3902 "awkgram.c" /* yacc.c:1646 */
break;
case 153:
-#line 1788 "awkgram.y" /* yacc.c:1645 */
+#line 1788 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3903 "awkgram.c" /* yacc.c:1645 */
+#line 3908 "awkgram.c" /* yacc.c:1646 */
break;
case 154:
-#line 1790 "awkgram.y" /* yacc.c:1645 */
+#line 1790 "awkgram.y" /* yacc.c:1646 */
{
/*
* In BEGINFILE/ENDFILE, allow `getline [var] < file'
@@ -3917,29 +3922,29 @@ regular_print:
_("non-redirected `getline' undefined inside
END action"));
(yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]),
redirect_input);
}
-#line 3921 "awkgram.c" /* yacc.c:1645 */
+#line 3926 "awkgram.c" /* yacc.c:1646 */
break;
case 155:
-#line 1804 "awkgram.y" /* yacc.c:1645 */
+#line 1804 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postincrement;
(yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3930 "awkgram.c" /* yacc.c:1645 */
+#line 3935 "awkgram.c" /* yacc.c:1646 */
break;
case 156:
-#line 1809 "awkgram.y" /* yacc.c:1645 */
+#line 1809 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postdecrement;
(yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3939 "awkgram.c" /* yacc.c:1645 */
+#line 3944 "awkgram.c" /* yacc.c:1646 */
break;
case 157:
-#line 1814 "awkgram.y" /* yacc.c:1645 */
+#line 1814 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old) {
warning_ln((yyvsp[-1])->source_line,
@@ -3959,64 +3964,64 @@ regular_print:
(yyval) = list_append(list_merge(t, (yyvsp[0])),
(yyvsp[-1]));
}
}
-#line 3963 "awkgram.c" /* yacc.c:1645 */
+#line 3968 "awkgram.c" /* yacc.c:1646 */
break;
case 158:
-#line 1839 "awkgram.y" /* yacc.c:1645 */
+#line 1839 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]),
(yyvsp[-2])->redir_type);
bcfree((yyvsp[-2]));
}
-#line 3972 "awkgram.c" /* yacc.c:1645 */
+#line 3977 "awkgram.c" /* yacc.c:1646 */
break;
case 159:
-#line 1845 "awkgram.y" /* yacc.c:1645 */
+#line 1845 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3978 "awkgram.c" /* yacc.c:1645 */
+#line 3983 "awkgram.c" /* yacc.c:1646 */
break;
case 160:
-#line 1847 "awkgram.y" /* yacc.c:1645 */
+#line 1847 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3984 "awkgram.c" /* yacc.c:1645 */
+#line 3989 "awkgram.c" /* yacc.c:1646 */
break;
case 161:
-#line 1849 "awkgram.y" /* yacc.c:1645 */
+#line 1849 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3990 "awkgram.c" /* yacc.c:1645 */
+#line 3995 "awkgram.c" /* yacc.c:1646 */
break;
case 162:
-#line 1851 "awkgram.y" /* yacc.c:1645 */
+#line 1851 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3996 "awkgram.c" /* yacc.c:1645 */
+#line 4001 "awkgram.c" /* yacc.c:1646 */
break;
case 163:
-#line 1853 "awkgram.y" /* yacc.c:1645 */
+#line 1853 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 4002 "awkgram.c" /* yacc.c:1645 */
+#line 4007 "awkgram.c" /* yacc.c:1646 */
break;
case 164:
-#line 1855 "awkgram.y" /* yacc.c:1645 */
+#line 1855 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 4008 "awkgram.c" /* yacc.c:1645 */
+#line 4013 "awkgram.c" /* yacc.c:1646 */
break;
case 165:
-#line 1860 "awkgram.y" /* yacc.c:1645 */
+#line 1860 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 4016 "awkgram.c" /* yacc.c:1645 */
+#line 4021 "awkgram.c" /* yacc.c:1646 */
break;
case 166:
-#line 1864 "awkgram.y" /* yacc.c:1645 */
+#line 1864 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->opcode == Op_match_rec) {
(yyvsp[0])->opcode = Op_nomatch;
@@ -4048,11 +4053,11 @@ regular_print:
}
}
}
-#line 4052 "awkgram.c" /* yacc.c:1645 */
+#line 4057 "awkgram.c" /* yacc.c:1646 */
break;
case 167:
-#line 1896 "awkgram.y" /* yacc.c:1645 */
+#line 1896 "awkgram.y" /* yacc.c:1646 */
{
// Always include. Allows us to lint warn on
// print "foo" > "bar" 1
@@ -4060,31 +4065,31 @@ regular_print:
// print "foo" > ("bar" 1)
(yyval) = list_append((yyvsp[-1]), bcalloc(Op_parens, 1,
sourceline));
}
-#line 4064 "awkgram.c" /* yacc.c:1645 */
+#line 4069 "awkgram.c" /* yacc.c:1646 */
break;
case 168:
-#line 1904 "awkgram.y" /* yacc.c:1645 */
+#line 1904 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 4074 "awkgram.c" /* yacc.c:1645 */
+#line 4079 "awkgram.c" /* yacc.c:1646 */
break;
case 169:
-#line 1910 "awkgram.y" /* yacc.c:1645 */
+#line 1910 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 4084 "awkgram.c" /* yacc.c:1645 */
+#line 4089 "awkgram.c" /* yacc.c:1646 */
break;
case 170:
-#line 1916 "awkgram.y" /* yacc.c:1645 */
+#line 1916 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
@@ -4097,45 +4102,45 @@ regular_print:
if ((yyval) == NULL)
YYABORT;
}
-#line 4101 "awkgram.c" /* yacc.c:1645 */
+#line 4106 "awkgram.c" /* yacc.c:1646 */
break;
case 173:
-#line 1931 "awkgram.y" /* yacc.c:1645 */
+#line 1931 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[-1])->opcode = Op_preincrement;
(yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 4110 "awkgram.c" /* yacc.c:1645 */
+#line 4115 "awkgram.c" /* yacc.c:1646 */
break;
case 174:
-#line 1936 "awkgram.y" /* yacc.c:1645 */
+#line 1936 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[-1])->opcode = Op_predecrement;
(yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 4119 "awkgram.c" /* yacc.c:1645 */
+#line 4124 "awkgram.c" /* yacc.c:1646 */
break;
case 175:
-#line 1941 "awkgram.y" /* yacc.c:1645 */
+#line 1941 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 4127 "awkgram.c" /* yacc.c:1645 */
+#line 4132 "awkgram.c" /* yacc.c:1646 */
break;
case 176:
-#line 1945 "awkgram.y" /* yacc.c:1645 */
+#line 1945 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 4135 "awkgram.c" /* yacc.c:1645 */
+#line 4140 "awkgram.c" /* yacc.c:1646 */
break;
case 177:
-#line 1949 "awkgram.y" /* yacc.c:1645 */
+#line 1949 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
&& ((yyvsp[0])->lasti->memory->flags & STRING) == 0
@@ -4150,11 +4155,11 @@ regular_print:
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 4154 "awkgram.c" /* yacc.c:1645 */
+#line 4159 "awkgram.c" /* yacc.c:1646 */
break;
case 178:
-#line 1964 "awkgram.y" /* yacc.c:1645 */
+#line 1964 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
&& ((yyvsp[0])->lasti->memory->flags & STRING) == 0
@@ -4172,20 +4177,20 @@ regular_print:
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 4176 "awkgram.c" /* yacc.c:1645 */
+#line 4181 "awkgram.c" /* yacc.c:1646 */
break;
case 179:
-#line 1985 "awkgram.y" /* yacc.c:1645 */
+#line 1985 "awkgram.y" /* yacc.c:1646 */
{
func_use((yyvsp[0])->lasti->func_name, FUNC_USE);
(yyval) = (yyvsp[0]);
}
-#line 4185 "awkgram.c" /* yacc.c:1645 */
+#line 4190 "awkgram.c" /* yacc.c:1646 */
break;
case 180:
-#line 1990 "awkgram.y" /* yacc.c:1645 */
+#line 1990 "awkgram.y" /* yacc.c:1646 */
{
/* indirect function call */
INSTRUCTION *f, *t;
@@ -4219,11 +4224,11 @@ regular_print:
(yyval) = list_prepend((yyvsp[0]), t);
at_seen = false;
}
-#line 4223 "awkgram.c" /* yacc.c:1645 */
+#line 4228 "awkgram.c" /* yacc.c:1646 */
break;
case 181:
-#line 2027 "awkgram.y" /* yacc.c:1645 */
+#line 2027 "awkgram.y" /* yacc.c:1646 */
{
NODE *n;
#if 0
@@ -4239,6 +4244,14 @@ regular_print:
efree((void *) (yyvsp[-3])->func_name);
(yyvsp[-3])->func_name = buf;
}
+#else
+ char *name = (yyvsp[-3])->func_name;
+ char *qname = qualify_name(name, strlen(name));
+
+ if (qname != name) {
+ efree((char *) name);
+ (yyvsp[-3])->func_name = qname;
+ }
#endif
if (! at_seen) {
@@ -4263,49 +4276,49 @@ regular_print:
(yyval) = list_append(t, (yyvsp[-3]));
}
}
-#line 4267 "awkgram.c" /* yacc.c:1645 */
+#line 4280 "awkgram.c" /* yacc.c:1646 */
break;
case 182:
-#line 2070 "awkgram.y" /* yacc.c:1645 */
+#line 2078 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 4273 "awkgram.c" /* yacc.c:1645 */
+#line 4286 "awkgram.c" /* yacc.c:1646 */
break;
case 183:
-#line 2072 "awkgram.y" /* yacc.c:1645 */
+#line 2080 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 4279 "awkgram.c" /* yacc.c:1645 */
+#line 4292 "awkgram.c" /* yacc.c:1646 */
break;
case 184:
-#line 2077 "awkgram.y" /* yacc.c:1645 */
+#line 2085 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 4285 "awkgram.c" /* yacc.c:1645 */
+#line 4298 "awkgram.c" /* yacc.c:1646 */
break;
case 185:
-#line 2079 "awkgram.y" /* yacc.c:1645 */
+#line 2087 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 4291 "awkgram.c" /* yacc.c:1645 */
+#line 4304 "awkgram.c" /* yacc.c:1646 */
break;
case 186:
-#line 2084 "awkgram.y" /* yacc.c:1645 */
+#line 2092 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 4297 "awkgram.c" /* yacc.c:1645 */
+#line 4310 "awkgram.c" /* yacc.c:1646 */
break;
case 187:
-#line 2086 "awkgram.y" /* yacc.c:1645 */
+#line 2094 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 4305 "awkgram.c" /* yacc.c:1645 */
+#line 4318 "awkgram.c" /* yacc.c:1646 */
break;
case 188:
-#line 2093 "awkgram.y" /* yacc.c:1645 */
+#line 2101 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated
expressions */
@@ -4319,11 +4332,11 @@ regular_print:
sub_counter++; /* count # of dimensions */
(yyval) = (yyvsp[0]);
}
-#line 4323 "awkgram.c" /* yacc.c:1645 */
+#line 4336 "awkgram.c" /* yacc.c:1646 */
break;
case 189:
-#line 2110 "awkgram.y" /* yacc.c:1645 */
+#line 2118 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *t = (yyvsp[-1]);
if ((yyvsp[-1]) == NULL) {
@@ -4337,31 +4350,31 @@ regular_print:
(yyvsp[0])->sub_count = count_expressions(&t, false);
(yyval) = list_append(t, (yyvsp[0]));
}
-#line 4341 "awkgram.c" /* yacc.c:1645 */
+#line 4354 "awkgram.c" /* yacc.c:1646 */
break;
case 190:
-#line 2127 "awkgram.y" /* yacc.c:1645 */
+#line 2135 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 4347 "awkgram.c" /* yacc.c:1645 */
+#line 4360 "awkgram.c" /* yacc.c:1646 */
break;
case 191:
-#line 2129 "awkgram.y" /* yacc.c:1645 */
+#line 2137 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 4355 "awkgram.c" /* yacc.c:1645 */
+#line 4368 "awkgram.c" /* yacc.c:1646 */
break;
case 192:
-#line 2136 "awkgram.y" /* yacc.c:1645 */
+#line 2144 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 4361 "awkgram.c" /* yacc.c:1645 */
+#line 4374 "awkgram.c" /* yacc.c:1646 */
break;
case 193:
-#line 2141 "awkgram.y" /* yacc.c:1645 */
+#line 2149 "awkgram.y" /* yacc.c:1646 */
{
#if 0
// FIXME: Code here and at function call
@@ -4389,7 +4402,7 @@ regular_print:
}
#else
const char *name = (yyvsp[0])->lextok;
- char *qname = qualify_name(name, strlen(name), true);
+ char *qname = qualify_name(name, strlen(name));
if (qname != name) {
efree((void *)name);
@@ -4401,22 +4414,22 @@ regular_print:
(yyvsp[0])->memory = variable((yyvsp[0])->source_line,
(yyvsp[0])->lextok, Node_var_new);
(yyval) = list_create((yyvsp[0]));
}
-#line 4405 "awkgram.c" /* yacc.c:1645 */
+#line 4418 "awkgram.c" /* yacc.c:1646 */
break;
case 194:
-#line 2181 "awkgram.y" /* yacc.c:1645 */
+#line 2189 "awkgram.y" /* yacc.c:1646 */
{
char *arr = (yyvsp[-1])->lextok;
(yyvsp[-1])->memory = variable((yyvsp[-1])->source_line, arr,
Node_var_new);
(yyvsp[-1])->opcode = Op_push_array;
(yyval) = list_prepend((yyvsp[0]), (yyvsp[-1]));
}
-#line 4416 "awkgram.c" /* yacc.c:1645 */
+#line 4429 "awkgram.c" /* yacc.c:1646 */
break;
case 195:
-#line 2191 "awkgram.y" /* yacc.c:1645 */
+#line 2199 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->nexti;
if (ip->opcode == Op_push
@@ -4428,85 +4441,85 @@ regular_print:
} else
(yyval) = (yyvsp[0]);
}
-#line 4432 "awkgram.c" /* yacc.c:1645 */
+#line 4445 "awkgram.c" /* yacc.c:1646 */
break;
case 196:
-#line 2203 "awkgram.y" /* yacc.c:1645 */
+#line 2211 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
if ((yyvsp[0]) != NULL)
mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 4442 "awkgram.c" /* yacc.c:1645 */
+#line 4455 "awkgram.c" /* yacc.c:1646 */
break;
case 197:
-#line 2212 "awkgram.y" /* yacc.c:1645 */
+#line 2220 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postincrement;
}
-#line 4450 "awkgram.c" /* yacc.c:1645 */
+#line 4463 "awkgram.c" /* yacc.c:1646 */
break;
case 198:
-#line 2216 "awkgram.y" /* yacc.c:1645 */
+#line 2224 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postdecrement;
}
-#line 4458 "awkgram.c" /* yacc.c:1645 */
+#line 4471 "awkgram.c" /* yacc.c:1646 */
break;
case 199:
-#line 2220 "awkgram.y" /* yacc.c:1645 */
+#line 2228 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 4464 "awkgram.c" /* yacc.c:1645 */
+#line 4477 "awkgram.c" /* yacc.c:1646 */
break;
case 200:
-#line 2224 "awkgram.y" /* yacc.c:1645 */
+#line 2232 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 4470 "awkgram.c" /* yacc.c:1645 */
+#line 4483 "awkgram.c" /* yacc.c:1646 */
break;
case 201:
-#line 2228 "awkgram.y" /* yacc.c:1645 */
+#line 2236 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); yyerrok; }
-#line 4476 "awkgram.c" /* yacc.c:1645 */
+#line 4489 "awkgram.c" /* yacc.c:1646 */
break;
case 202:
-#line 2232 "awkgram.y" /* yacc.c:1645 */
+#line 2240 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4482 "awkgram.c" /* yacc.c:1645 */
+#line 4495 "awkgram.c" /* yacc.c:1646 */
break;
case 203:
-#line 2237 "awkgram.y" /* yacc.c:1645 */
+#line 2245 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 4488 "awkgram.c" /* yacc.c:1645 */
+#line 4501 "awkgram.c" /* yacc.c:1646 */
break;
case 205:
-#line 2242 "awkgram.y" /* yacc.c:1645 */
+#line 2250 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4494 "awkgram.c" /* yacc.c:1645 */
+#line 4507 "awkgram.c" /* yacc.c:1646 */
break;
case 206:
-#line 2246 "awkgram.y" /* yacc.c:1645 */
+#line 2254 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); yyerrok; }
-#line 4500 "awkgram.c" /* yacc.c:1645 */
+#line 4513 "awkgram.c" /* yacc.c:1646 */
break;
case 207:
-#line 2250 "awkgram.y" /* yacc.c:1645 */
+#line 2258 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); yyerrok; }
-#line 4506 "awkgram.c" /* yacc.c:1645 */
+#line 4519 "awkgram.c" /* yacc.c:1646 */
break;
-#line 4510 "awkgram.c" /* yacc.c:1645 */
+#line 4523 "awkgram.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4531,13 +4544,14 @@ regular_print:
/* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
- {
- const int yylhs = yyr1[yyn] - YYNTOKENS;
- const int yyi = yypgoto[yylhs] + *yyssp;
- yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
- ? yytable[yyi]
- : yydefgoto[yylhs]);
- }
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTOKENS];
goto yynewstate;
@@ -4733,7 +4747,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 2252 "awkgram.y" /* yacc.c:1903 */
+#line 2260 "awkgram.y" /* yacc.c:1906 */
struct token {
@@ -9373,7 +9387,7 @@ set_namespace(INSTRUCTION *ns, INSTRUCTION *comment)
static bool
is_all_upper(const char *name)
{
- for (; *name != '\0'; name ++) {
+ for (; *name != '\0'; name++) {
switch (*name) {
case 'A': case 'B': case 'C': case 'D': case 'E':
case 'F': case 'G': case 'H': case 'I': case 'J':
@@ -9393,18 +9407,16 @@ is_all_upper(const char *name)
/* qualify_name --- put name into namespace */
static char *
-qualify_name(const char *name, size_t len, bool is_var)
+qualify_name(const char *name, size_t len)
{
if (strchr(name, ':') != NULL) // already qualified
return (char *) name;
- bool case_ok = is_var ? ! is_all_upper(name) : true;
-
- if (current_namespace != awk_namespace && case_ok) {
- size_t len = strlen(current_namespace) + 2 + strlen(name) + 1;
+ if (current_namespace != awk_namespace && ! is_all_upper(name)) {
+ size_t length = strlen(current_namespace) + 2 + len + 1;
char *buf;
- emalloc(buf, char *, len, "simple_variable");
+ emalloc(buf, char *, length, "qualify_name");
sprintf(buf, "%s::%s", current_namespace, name);
return buf;
diff --git a/awkgram.y b/awkgram.y
index 284c16e..85f3e01 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -61,7 +61,7 @@ static char *tokexpand(void);
static NODE *set_profile_text(NODE *n, const char *str, size_t len);
static int check_qualified_special(char *token);
static bool is_all_upper(const char *name);
-static char *qualify_name(const char *name, size_t len, bool is_var);
+static char *qualify_name(const char *name, size_t len);
static INSTRUCTION *trailing_comment;
static INSTRUCTION *outer_comment;
static INSTRUCTION *interblock_comment;
@@ -470,7 +470,7 @@ func_name
: NAME
{
const char *name = $1->lextok;
- char *qname = qualify_name(name, strlen(name), false);
+ char *qname = qualify_name(name, strlen(name));
if (qname != name) {
efree((void *)name);
@@ -481,7 +481,7 @@ func_name
| FUNC_CALL
{
const char *name = $1->lextok;
- char *qname = qualify_name(name, strlen(name), false);
+ char *qname = qualify_name(name, strlen(name));
if (qname != name) {
efree((void *)name);
@@ -2039,6 +2039,14 @@ direct_func_call
efree((void *) $1->func_name);
$1->func_name = buf;
}
+#else
+ char *name = $1->func_name;
+ char *qname = qualify_name(name, strlen(name));
+
+ if (qname != name) {
+ efree((char *) name);
+ $1->func_name = qname;
+ }
#endif
if (! at_seen) {
@@ -2165,7 +2173,7 @@ simple_variable
}
#else
const char *name = $1->lextok;
- char *qname = qualify_name(name, strlen(name), true);
+ char *qname = qualify_name(name, strlen(name));
if (qname != name) {
efree((void *)name);
@@ -6888,7 +6896,7 @@ set_namespace(INSTRUCTION *ns, INSTRUCTION *comment)
static bool
is_all_upper(const char *name)
{
- for (; *name != '\0'; name ++) {
+ for (; *name != '\0'; name++) {
switch (*name) {
case 'A': case 'B': case 'C': case 'D': case 'E':
case 'F': case 'G': case 'H': case 'I': case 'J':
@@ -6908,18 +6916,16 @@ is_all_upper(const char *name)
/* qualify_name --- put name into namespace */
static char *
-qualify_name(const char *name, size_t len, bool is_var)
+qualify_name(const char *name, size_t len)
{
if (strchr(name, ':') != NULL) // already qualified
return (char *) name;
- bool case_ok = is_var ? ! is_all_upper(name) : true;
-
- if (current_namespace != awk_namespace && case_ok) {
- size_t len = strlen(current_namespace) + 2 + strlen(name) + 1;
+ if (current_namespace != awk_namespace && ! is_all_upper(name)) {
+ size_t length = strlen(current_namespace) + 2 + len + 1;
char *buf;
- emalloc(buf, char *, len, "simple_variable");
+ emalloc(buf, char *, length, "qualify_name");
sprintf(buf, "%s::%s", current_namespace, name);
return buf;
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 8 +
awkgram.c | 932 +++++++++++++++++++++++++++++++-------------------------------
awkgram.y | 28 +-
3 files changed, 497 insertions(+), 471 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, feature/fix-ns-memleak, updated. gawk-4.1.0-3606-ga6ece4a,
Arnold Robbins <=