diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-06-23 12:45:16 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-06-23 12:45:16 +0300 |
commit | 5ea4224acd6effc77359d42436de4804b86f1112 (patch) | |
tree | 9d4936e21342b71fd43de7cac311822677caad98 /awkgram.y | |
parent | 231cb5df34699fd98001e2e124d73da5d2f795f9 (diff) | |
parent | 44e29458a6355ad64e8d89676a441b224ce76cbc (diff) | |
download | egawk-5ea4224acd6effc77359d42436de4804b86f1112.tar.gz egawk-5ea4224acd6effc77359d42436de4804b86f1112.tar.bz2 egawk-5ea4224acd6effc77359d42436de4804b86f1112.zip |
Merge branch 'master' into feature/fix-comments
Diffstat (limited to 'awkgram.y')
-rw-r--r-- | awkgram.y | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -1755,7 +1755,12 @@ non_post_simp_exp } } | '(' exp r_paren - { $$ = $2; } + { + if (do_pretty_print) + $$ = list_append($2, bcalloc(Op_parens, 1, sourceline)); + else + $$ = $2; + } | LEX_BUILTIN '(' opt_fcall_expression_list r_paren { $$ = snode($3, $1); @@ -2410,8 +2415,7 @@ yyerror(const char *m, ...) count = strlen(mesg) + 1; if (lexptr != NULL) count += (lexeme - thisline) + 2; - emalloc(buf, char *, count+1, "yyerror"); - memset(buf, 0, count+1); + ezalloc(buf, char *, count+1, "yyerror"); bp = buf; @@ -2630,8 +2634,7 @@ do_add_srcfile(enum srctype stype, char *src, char *path, SRCFILE *thisfile) { SRCFILE *s; - emalloc(s, SRCFILE *, sizeof(SRCFILE), "do_add_srcfile"); - memset(s, 0, sizeof(SRCFILE)); + ezalloc(s, SRCFILE *, sizeof(SRCFILE), "do_add_srcfile"); s->src = estrdup(src, strlen(src)); s->fullpath = path; s->stype = stype; @@ -4910,8 +4913,7 @@ func_use(const char *name, enum defref how) /* not in the table, fall through to allocate a new one */ - emalloc(fp, struct fdesc *, sizeof(struct fdesc), "func_use"); - memset(fp, '\0', sizeof(struct fdesc)); + ezalloc(fp, struct fdesc *, sizeof(struct fdesc), "func_use"); emalloc(fp->name, char *, len + 1, "func_use"); strcpy(fp->name, name); fp->next = ftable[ind]; @@ -5929,7 +5931,7 @@ add_lint(INSTRUCTION *list, LINTTYPE linttype) // closest to the opcode if that opcode doesn't have one if (ip->source_line != 0) line = ip->source_line; - } + } if (do_lint) { /* compile-time warning */ if (isnoeffect(ip->opcode)) { |