Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.42
 
1.43
 
MAIN:ragge:20061230081805
 
cpp.c
_>860860 expmac(struct recur *rp)
 861861 {
 862862         struct symtab *nl;
<>863 -        int c, noexp = 0;
  863+        int c, noexp = 0, orgexp;
864864         usch *och, *stksv;
 865865         extern int yyleng;
 866866 
     
 !
880880                 case EXPAND: noexp--; break;
 881881 
 882882                 case IDENT:
<> 883+#if 1
  884+                        /*
  885+                         * Handle argument concatenation here.
  886+                         * If an identifier is found and directly
  887+                         * thereafter EXPAND or NOEXP then push the
  888+                         * identifier back on the input stream and
  889+                         * call yylex() again.
  890+                         * Be careful to keep the noexp balance.
  891+Om:
  892+- vi fått en till IDENT: peta tillbaks EXPAND först som vi fått.
  893+- annars: Gör ingenting.
  894+                         */
  895+                        och = stringbuf;
  896+                        savstr((usch *)yytext);
  897+                        savch('\0');
  898+                        DDPRINT(("id: str %s\n", och));
  899+                        while ((c = yylex()) == EXPAND || c == NOEXP) {
  900+                                if (c == EXPAND)
  901+                                        noexp--;
  902+                                else
  903+                                        noexp++;
  904+                        }
  905+                        orgexp = noexp;
  906+                        if (c == IDENT) {
  907+                                while (0 < orgexp)
  908+                                        cunput(NOEXP), orgexp--;
  909+                        }
  910+                        unpstr(yytext);
  911+                        unpstr(och);
  912+                        stringbuf = och;
  913+                        if (c == IDENT) {
  914+                                orgexp = noexp;
  915+                                while (0 < orgexp)
  916+                                        cunput(EXPAND), orgexp--;
  917+                                continue; /* New longer identifier */
  918+                        }
  919+                        yylex(); /* XXX reget last identifier */
  920+#else
883921                         /* workaround if an arg will be concatenated */
 884922                         och = stringbuf;
 885923                         savstr((usch *)yytext);
     
 !
916954                                         cunput(EXPAND);
 917955                                         unpstr(och);
 918956                                         yylex();
<> 957+printf("CURID: '%s'\n", yytext);
919958                                 }
 920959                         } else {
 921960                                 DDPRINT(("ofunnet expand got (%d)\n", c));
     
 !
935974                                     yytext));
 936975                         }
 937976                         stringbuf = och;
<> 977+#endif
938978 
 939979                         if ((nl = lookup((usch *)yytext, FIND)) == NULL)
 940980                                 goto def;
     
 !
952992                                         goto def;
 953993                                 break;
 954994                         }
<> 995+printf("noexp1 %d nl->namep %s\n", noexp, nl->namep);
955996 if (noexp > 1) goto def;
 956997 //                      if (noexp != 1)
 957998 //                              error("bad noexp %d", noexp);
     
 !
9941035                         break;
 9951036                 }
 9961037         }
<> 1038+printf("noexp2 %d\n", noexp);
<_9971039         DPRINT(("return from expmac\n"));
 9981040 }
 9991041 
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-03 04:13 +0200