/ Check-in [6195af49]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix to token destructors in Lemon. This does not impact SQLite. Ticket #2175. (CVS 3753)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6195af49828bf04b61d24f116339780d3eb926a1
User & Date: drh 2007-03-29 20:13:53
Context
2007-03-29
20:19
Assume any return code from fcntl() other than -1 is success. Formerly we only assumed that 0 was success. Ticket #2173. (CVS 3754) check-in: 8d0073c0 user: drh tags: trunk
20:13
Fix to token destructors in Lemon. This does not impact SQLite. Ticket #2175. (CVS 3753) check-in: 6195af49 user: drh tags: trunk
18:46
Add the sqlite3_clear_bindings() API to the loadable extension interface. Ticket #2135. (CVS 3752) check-in: 3111b43e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/lemon.c.

  3192   3192     char *cp, *xp;
  3193   3193     int i;
  3194   3194     char lhsused = 0;    /* True if the LHS element has been used */
  3195   3195     char used[MAXRHS];   /* True for each RHS element which is used */
  3196   3196   
  3197   3197     for(i=0; i<rp->nrhs; i++) used[i] = 0;
  3198   3198     lhsused = 0;
         3199  +
         3200  +  if( rp->code==0 ){
         3201  +    rp->code = "\n";
         3202  +    rp->line = rp->ruleline;
         3203  +  }
  3199   3204   
  3200   3205     append_str(0,0,0,0);
  3201         -  for(cp=(rp->code?rp->code:""); *cp; cp++){
         3206  +  for(cp=rp->code; *cp; cp++){
  3202   3207       if( isalpha(*cp) && (cp==rp->code || (!isalnum(cp[-1]) && cp[-1]!='_')) ){
  3203   3208         char saved;
  3204   3209         for(xp= &cp[1]; isalnum(*xp) || *xp=='_'; xp++);
  3205   3210         saved = *xp;
  3206   3211         *xp = 0;
  3207   3212         if( rp->lhsalias && strcmp(cp,rp->lhsalias)==0 ){
  3208   3213           append_str("yygotominor.yy%d",0,rp->lhs->dtnum,0);