"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "symbol.c" between
gawk-5.0.1.tar.xz and gawk-5.1.0.tar.xz

About: GNU awk - pattern scanning and processing language.

symbol.c  (gawk-5.0.1.tar.xz):symbol.c  (gawk-5.1.0.tar.xz)
/* /*
* symbol.c - routines for symbol table management and code allocation * symbol.c - routines for symbol table management and code allocation
*/ */
/* /*
* Copyright (C) 1986, 1988, 1989, 1991-2015, 2017, 2018, 2019, * Copyright (C) 1986, 1988, 1989, 1991-2015, 2017-2020,
* the Free Software Foundation, Inc. * the Free Software Foundation, Inc.
* *
* This file is part of GAWK, the GNU implementation of the * This file is part of GAWK, the GNU implementation of the
* AWK Programming Language. * AWK Programming Language.
* *
* GAWK is free software; you can redistribute it and/or modify * GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
skipping to change at line 304 skipping to change at line 304
/* install --- install a global name or function parameter in the symbol table * / /* install --- install a global name or function parameter in the symbol table * /
static NODE * static NODE *
install(const char *name, NODE *parm, NODETYPE type) install(const char *name, NODE *parm, NODETYPE type)
{ {
NODE *r; NODE *r;
NODE *table; NODE *table;
NODE *n_name; NODE *n_name;
NODE *prev; NODE *prev;
n_name = make_string(name, strlen(name)); if (strncmp(name, "awk::", 5) == 0)
n_name = make_string(name + 5, strlen(name) - 5);
else
n_name = make_string(name, strlen(name));
table = symbol_table; table = symbol_table;
if (type == Node_param_list) { if (type == Node_param_list) {
table = param_table; table = param_table;
} else if ( type == Node_func } else if ( type == Node_func
|| type == Node_ext_func || type == Node_ext_func
|| type == Node_builtin_func) { || type == Node_builtin_func) {
table = func_table; table = func_table;
} else if (installing_specials) { } else if (installing_specials) {
skipping to change at line 679 skipping to change at line 682
/* loop over each param in function i */ /* loop over each param in function i */
for (j = 0; j < f->param_cnt; j++) { for (j = 0; j < f->param_cnt; j++) {
/* compare to function names */ /* compare to function names */
/* use a fake node to avoid malloc/free of make_string */ /* use a fake node to avoid malloc/free of make_string */
n.stptr = f->fparms[j].param; n.stptr = f->fparms[j].param;
n.stlen = strlen(f->fparms[j].param); n.stlen = strlen(f->fparms[j].param);
if (in_array(func_table, & n)) { if (in_array(func_table, & n)) {
error( error(
_("function `%s': can't use function `%s' as a parameter name"), _("function `%s': cannot use function `%s' as a parameter name"),
list[i]->stptr, list[i]->stptr,
f->fparms[j].param); f->fparms[j].param);
result = false; result = false;
} }
} }
} }
efree(list); efree(list);
return result; return result;
} }
skipping to change at line 809 skipping to change at line 812
/* pop_context --- switch to previous execution context. */ /* pop_context --- switch to previous execution context. */
void void
pop_context() pop_context()
{ {
AWK_CONTEXT *ctxt; AWK_CONTEXT *ctxt;
assert(curr_ctxt != NULL); assert(curr_ctxt != NULL);
if (curr_ctxt->prev == NULL) if (curr_ctxt->prev == NULL)
fatal(_("can not pop main context")); fatal(_("cannot pop main context"));
ctxt = curr_ctxt->prev; ctxt = curr_ctxt->prev;
/* restore source and sourceline */ /* restore source and sourceline */
sourceline = ctxt->sourceline; sourceline = ctxt->sourceline;
source = ctxt->source; source = ctxt->source;
set_context(ctxt); set_context(ctxt);
ctxt_level--; ctxt_level--;
} }
/* in_main_context --- are we in the main context ? */ /* in_main_context --- are we in the main context ? */
 End of changes. 4 change blocks. 
4 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)