Mercurial > hg > CbC > old > device
changeset 863:e253ffedf947
recursive macro fix ( at last )
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 31 Mar 2014 19:12:09 +0900 |
parents | 68cbc637f486 |
children | 98b6273204bc |
files | mc-macro.c test/macro.c |
diffstat | 2 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-macro.c Mon Mar 31 18:40:27 2014 +0900 +++ b/mc-macro.c Mon Mar 31 19:12:09 2014 +0900 @@ -1130,6 +1130,19 @@ extern int check_recurse(char *macro,int history) { + int len; + char *name = macro; + while(1) { + NMTBL *nptrm = get_name(name,&len,NONDEF); + if (!nptrm) break; + nptrm = name_space_search(nptrm,MACRO); + if (!nptrm) break; + if (nptrm->dsp) + name = scaddr(nptrm->dsp); + else break; + if ( nameeq(macro,name) ) return 1; + } + for(;history;history = cadr(history)) { if (macro==scaddr(history)) { // fprintf(stderr,"check_recurse: %s %s = ",macro,scaddr(history));