Browse Source

Replace identifier by func not only after '=', but also '{'

Extension to commit
61e48f984 ("Start replacing identifiers by func only after the first '='", 2021-06-18)
pre-master-46
Holger Vogt 5 years ago
parent
commit
87a9d87f7d
  1. 13
      src/frontend/inpcom.c

13
src/frontend/inpcom.c

@ -7110,8 +7110,17 @@ static char *inp_functionalise_identifier(char *curr_line, char *identifier)
size_t len = strlen(identifier);
char *p, *str = curr_line;
/* Start replacing identifier by func only after the first '=' */
char* estr = strchr(curr_line, '=');
/* Start replacing identifier by func only after the first '=' or '{' */
char* estr1 = strchr(curr_line, '=');
char* estr2 = strchr(curr_line, '{');
char* estr;
if (estr1 && estr2)
estr = (estr1 < estr2) ? estr1 : estr2;
else if (estr1)
estr = estr1;
else
estr = estr2;
for (p = estr; (p = search_identifier(p, identifier, str)) != NULL;)
if (p[len] != '(') {

Loading…
Cancel
Save