diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-05-11 14:53:15 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-05-11 14:53:15 +0300 |
commit | 3ac8984c62b6a89e86e18376b75e32f0a60bfe9f (patch) | |
tree | dfd5c36afbc764d88919a6925e2edcc43187bbe9 | |
parent | 4ab78d60892f19f1cae1e85771a396b50eb591c6 (diff) | |
download | egawk-3ac8984c62b6a89e86e18376b75e32f0a60bfe9f.tar.gz egawk-3ac8984c62b6a89e86e18376b75e32f0a60bfe9f.tar.bz2 egawk-3ac8984c62b6a89e86e18376b75e32f0a60bfe9f.zip |
Change Node_hardregex to Node_typedregex.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | awk.h | 6 | ||||
-rw-r--r-- | awkgram.c | 14 | ||||
-rw-r--r-- | awkgram.y | 8 | ||||
-rw-r--r-- | builtin.c | 10 | ||||
-rw-r--r-- | eval.c | 4 | ||||
-rw-r--r-- | profile.c | 28 | ||||
-rw-r--r-- | re.c | 4 |
8 files changed, 42 insertions, 37 deletions
@@ -1,3 +1,8 @@ +2015-05-11 Arnold D. Robbins <arnold@skeeve.com> + + * awk.h, awkgram.y, builtin.c, eval.c profile.c, re.c: + Change Node_hardregex to Node_typedregex everywhere. + 2015-05-05 Arnold D. Robbins <arnold@skeeve.com> * awkgram.y (yylex): Yet Another Fix for parsing bracket @@ -277,7 +277,7 @@ typedef enum nodevals { Node_val, /* node is a value - type in flags */ Node_regex, /* a regexp, text, compiled, flags, etc */ Node_dynregex, /* a dynamic regexp */ - Node_hardregex, /* like Node_regex, but is a real type */ + Node_typedregex, /* like Node_regex, but is a real type */ /* symbol table values */ Node_var, /* scalar variable, lnode is value */ @@ -1765,7 +1765,7 @@ dupnode(NODE *n) static inline NODE * force_string(NODE *s) { - if (s->type == Node_hardregex) + if (s->type == Node_typedregex) return s->re_exp; if ((s->flags & STRCUR) != 0 @@ -1790,7 +1790,7 @@ unref(NODE *r) static inline NODE * force_number(NODE *n) { - if (n->type == Node_hardregex) + if (n->type == Node_typedregex) return Nnull_string; return (n->flags & NUMCUR) != 0 ? n : str2number(n); @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-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 @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.4" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -2268,7 +2268,7 @@ yyreduce: len = strlen(re); exp = make_str_node(re, len, ALREADY_MALLOCED); - n = make_regnode(Node_hardregex, exp); + n = make_regnode(Node_typedregex, exp); if (n == NULL) { unref(exp); YYABORT; @@ -3101,7 +3101,7 @@ regular_print: case 80: #line 1225 "awkgram.y" /* yacc.c:1646 */ { - assert((yyvsp[0])->memory->type == Node_hardregex); + assert((yyvsp[0])->memory->type == Node_typedregex); (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } @@ -3428,7 +3428,7 @@ regular_print: _("regular expression on left of `~' or `!~' operator")); assert((yyvsp[0])->opcode == Op_push_re - && (yyvsp[0])->memory->type == Node_hardregex); + && (yyvsp[0])->memory->type == Node_typedregex); /* RHS is @/.../ */ (yyvsp[-1])->memory = (yyvsp[0])->memory; bcfree((yyvsp[0])); @@ -7279,7 +7279,7 @@ make_regnode(int type, NODE *exp) n->type = type; n->re_cnt = 1; - if (type == Node_regex || type == Node_hardregex) { + if (type == Node_regex || type == Node_typedregex) { n->re_reg = make_regexp(exp->stptr, exp->stlen, false, true, false); if (n->re_reg == NULL) { freenode(n); @@ -510,7 +510,7 @@ hard_regexp len = strlen(re); exp = make_str_node(re, len, ALREADY_MALLOCED); - n = make_regnode(Node_hardregex, exp); + n = make_regnode(Node_typedregex, exp); if (n == NULL) { unref(exp); YYABORT; @@ -1223,7 +1223,7 @@ case_value } | hard_regexp { - assert($1->memory->type == Node_hardregex); + assert($1->memory->type == Node_typedregex); $1->opcode = Op_push_re; $$ = $1; } @@ -1438,7 +1438,7 @@ exp _("regular expression on left of `~' or `!~' operator")); assert($3->opcode == Op_push_re - && $3->memory->type == Node_hardregex); + && $3->memory->type == Node_typedregex); /* RHS is @/.../ */ $2->memory = $3->memory; bcfree($3); @@ -4859,7 +4859,7 @@ make_regnode(int type, NODE *exp) n->type = type; n->re_cnt = 1; - if (type == Node_regex || type == Node_hardregex) { + if (type == Node_regex || type == Node_typedregex) { n->re_reg = make_regexp(exp->stptr, exp->stlen, false, true, false); if (n->re_reg == NULL) { freenode(n); @@ -3145,7 +3145,7 @@ call_sub(const char *name, int nargs) * push replace * push $0 */ - if (regex->type != Node_hardregex) + if (regex->type != Node_typedregex) regex = make_regnode(Node_regex, regex); PUSH(regex); PUSH(replace); @@ -3170,7 +3170,7 @@ call_sub(const char *name, int nargs) * nargs++ * } */ - if (regex->type != Node_hardregex) + if (regex->type != Node_typedregex) regex = make_regnode(Node_regex, regex); PUSH(regex); PUSH(replace); @@ -3208,7 +3208,7 @@ call_match(int nargs) /* Don't need to pop the string just to push it back ... */ - if (regex->type != Node_hardregex) + if (regex->type != Node_typedregex) regex = make_regnode(Node_regex, regex); PUSH(regex); @@ -3237,7 +3237,7 @@ call_split_func(const char *name, int nargs) if (nargs >= 3) { regex = POP_STRING(); - if (regex->type != Node_hardregex) + if (regex->type != Node_typedregex) regex = make_regnode(Node_regex, regex); } else { if (name[0] == 's') { @@ -3879,7 +3879,7 @@ do_typeof(int nargs) case Node_var_array: res = "array"; break; - case Node_hardregex: + case Node_typedregex: res = "regexp"; break; case Node_val: @@ -234,7 +234,7 @@ static const char *const nodetypes[] = { "Node_val", "Node_regex", "Node_dynregex", - "Node_hardregex", + "Node_typedregex", "Node_var", "Node_var_array", "Node_var_new", @@ -1363,7 +1363,7 @@ setup_frame(INSTRUCTION *pc) r->var_value = m; break; - case Node_hardregex: + case Node_typedregex: r->type = Node_var; r->var_value = m; break; @@ -32,8 +32,8 @@ static void parenthesize(int type, NODE *left, NODE *right); static char *pp_list(int nargs, const char *paren, const char *delim); static char *pp_group3(const char *s1, const char *s2, const char *s3); static char *pp_concat(int nargs); -static char *pp_string_or_hard_regex(const char *in_str, size_t len, int delim, bool hard_regex); -static char *pp_hard_regex(const char *in_str, size_t len, int delim); +static char *pp_string_or_strong_regex(const char *in_str, size_t len, int delim, bool strong_regex); +static char *pp_strong_regex(const char *in_str, size_t len, int delim); static bool is_binary(int type); static bool is_scalar(int type); static int prec_level(int type); @@ -626,7 +626,7 @@ cleanup: break; case Op_push_re: - if (pc->memory->type != Node_regex && pc->memory->type != Node_hardregex) + if (pc->memory->type != Node_regex && pc->memory->type != Node_typedregex) break; /* else fall through */ @@ -636,7 +636,7 @@ cleanup: if (pc->memory->type == Node_regex) str = pp_string(re->stptr, re->stlen, '/'); else - str = pp_hard_regex(re->stptr, re->stlen, '/'); + str = pp_strong_regex(re->stptr, re->stlen, '/'); pp_push(pc->opcode, str, CAN_FREE); } break; @@ -658,9 +658,9 @@ cleanup: txt = t2->pp_str; str = pp_group3(txt, op2str(pc->opcode), restr); pp_free(t2); - } else if (m->type == Node_hardregex) { + } else if (m->type == Node_typedregex) { NODE *re = m->re_exp; - restr = pp_hard_regex(re->stptr, re->stlen, '/'); + restr = pp_strong_regex(re->stptr, re->stlen, '/'); str = pp_group3(txt, op2str(pc->opcode), restr); efree(restr); } else { @@ -1338,21 +1338,21 @@ parenthesize(int type, NODE *left, NODE *right) char * pp_string(const char *in_str, size_t len, int delim) { - return pp_string_or_hard_regex(in_str, len, delim, false); + return pp_string_or_strong_regex(in_str, len, delim, false); } -/* pp_hard_regex --- pretty format a hard regex constant */ +/* pp_strong_regex --- pretty format a hard regex constant */ static char * -pp_hard_regex(const char *in_str, size_t len, int delim) +pp_strong_regex(const char *in_str, size_t len, int delim) { - return pp_string_or_hard_regex(in_str, len, delim, true); + return pp_string_or_strong_regex(in_str, len, delim, true); } -/* pp_string_or_hard_regex --- pretty format a string, regex, or hard regex constant */ +/* pp_string_or_strong_regex --- pretty format a string, regex, or hard regex constant */ char * -pp_string_or_hard_regex(const char *in_str, size_t len, int delim, bool hard_regex) +pp_string_or_strong_regex(const char *in_str, size_t len, int delim, bool strong_regex) { static char str_escapes[] = "\a\b\f\n\r\t\v\\"; static char str_printables[] = "abfnrtv\\"; @@ -1386,12 +1386,12 @@ pp_string_or_hard_regex(const char *in_str, size_t len, int delim, bool hard_reg } ofre -= (l) /* initial size; 3 for delim + terminating null, 1 for @ */ - osiz = len + 3 + 1 + (hard_regex == true); + osiz = len + 3 + 1 + (strong_regex == true); emalloc(obuf, char *, osiz, "pp_string"); obufout = obuf; ofre = osiz - 1; - if (hard_regex) + if (strong_regex) *obufout++ = '@'; *obufout++ = delim; @@ -351,11 +351,11 @@ re_update(NODE *t) /* regex was compiled with settings matching IGNORECASE */ if ((t->re_flags & CONSTANT) != 0) { /* it's a constant, so just return it as is */ - assert(t->type == Node_regex || t->type == Node_hardregex); + assert(t->type == Node_regex || t->type == Node_typedregex); return t->re_reg; } t1 = t->re_exp; - if (t1->type == Node_hardregex) { + if (t1->type == Node_typedregex) { assert((t1->re_flags & CONSTANT) != 0); return t1->re_reg; } |