Index: mttroot/mtt/bin/trans/mtt_m2p ================================================================== --- mttroot/mtt/bin/trans/mtt_m2p +++ mttroot/mtt/bin/trans/mtt_m2p @@ -13,10 +13,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.23 1998/11/18 14:38:01 peterg +## Now convert ALL globals to VAR .. the last one isn't repeated now +## ## Revision 1.22 1998/11/17 17:39:45 peterg ## Put _smx include at end of list (?????) ## ## Revision 1.21 1998/11/17 17:26:11 peterg ## Put sign.p first @@ -188,11 +191,11 @@ space="[ $tab]*" spaces="[ $tab][ $tab]*" non_space="[^ ]*" # Body -grep -v '^[ ]*function' < $Sys_rep.m | sed "s/^$space%/#/" | sed "s/\(;$space\)%/\1#/" |\ +grep -v '^[ ]*function' < $Sys_rep.m | sed "s/^$space%/#/" | sed "s/\([;)]$space\)%/\1#/" |\ awk -F# '{printf("%s",$1) if (NF>1) printf("{* %s *}", $2) printf("\n") }' |\ sed "s/$space\[\($non_space\)\]$spaces=$spaces\($fun_name\)(\([a-zA-Z0-9,]*\))/\2(\1,\3)/" |\ @@ -227,12 +230,12 @@ { if ($1=="global") doing_globals = 1 else{ if (doing_globals==1){ - if (match($1,";")==0){ - global[++i]=$1; + global[++i]=$1; + if (match($0,";")==0){ } else{ doing_globals = 0 doing_header = 1 } @@ -240,11 +243,11 @@ else { if (doing_header==1){ if (rep=="ode2odes"){ printf("VAR \n"); - for (k=1;k<=i;k++) printf(" %s,\n",global[k]) + for (k=1;k