Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 212282
Collapse All | Expand All

(-)tool/mksqlite3c.tcl.dist (-9 / +2 lines)
Lines 116-133 Link Here
116
}
116
}
117
set available_hdr(sqliteInt.h) 0
117
set available_hdr(sqliteInt.h) 0
118
118
119
# 78 stars used for comment formatting.
120
set s78 \
121
{*****************************************************************************}
122
123
# Insert a comment into the code
119
# Insert a comment into the code
124
#
120
#
125
proc section_comment {text} {
121
proc section_comment {text} {
126
  global out s78
122
  global out
127
  set n [string length $text]
123
  puts $out "/* $text */"
128
  set nstar [expr {60 - $n}]
129
  set stars [string range $s78 0 $nstar]
130
  puts $out "/************** $text $stars/"
131
}
124
}
132
125
133
# Read the source file named $filename and write it into the
126
# Read the source file named $filename and write it into the
(-)tool/mksqlite3internalh.tcl.dist (-9 / +2 lines)
Lines 74-91 Link Here
74
  set available_hdr($hdr) 1
74
  set available_hdr($hdr) 1
75
}
75
}
76
76
77
# 78 stars used for comment formatting.
78
set s78 \
79
{*****************************************************************************}
80
81
# Insert a comment into the code
77
# Insert a comment into the code
82
#
78
#
83
proc section_comment {text} {
79
proc section_comment {text} {
84
  global out s78
80
  global out
85
  set n [string length $text]
81
  puts $out "/* $text */"
86
  set nstar [expr {60 - $n}]
87
  set stars [string range $s78 0 $nstar]
88
  puts $out "/************** $text $stars/"
89
}
82
}
90
83
91
# Read the source file named $filename and write it into the
84
# Read the source file named $filename and write it into the
(-)tool/spaceanal.tcl.dist (-3 / +1 lines)
Lines 464-472 Link Here
464
  # Output the sub-report title, nicely decorated with * characters.
464
  # Output the sub-report title, nicely decorated with * characters.
465
  #
465
  #
466
  puts ""
466
  puts ""
467
  set len [string length $title]
467
  puts "*** $title ***"
468
  set stars [string repeat * [expr 65-$len]]
469
  puts "*** $title $stars"
470
  puts ""
468
  puts ""
471
469
472
  # Calculate statistics and store the results in TCL variables, as follows:
470
  # Calculate statistics and store the results in TCL variables, as follows:
(-)./src/select.c.dist (-7 / +7 lines)
Lines 4128-4134 void sqlite3PrintExprList(ExprList *pLis Link Here
4128
  }
4128
  }
4129
}
4129
}
4130
void sqlite3PrintSelect(Select *p, int indent){
4130
void sqlite3PrintSelect(Select *p, int indent){
4131
  sqlite3DebugPrintf("%*sSELECT(%p) ", indent, "", p);
4131
  sqlite3DebugPrintf("SELECT(%p) ", p);
4132
  sqlite3PrintExprList(p->pEList);
4132
  sqlite3PrintExprList(p->pEList);
4133
  sqlite3DebugPrintf("\n");
4133
  sqlite3DebugPrintf("\n");
4134
  if( p->pSrc ){
4134
  if( p->pSrc ){
Lines 4137-4148 void sqlite3PrintSelect(Select *p, int i Link Here
4137
    zPrefix = "FROM";
4137
    zPrefix = "FROM";
4138
    for(i=0; i<p->pSrc->nSrc; i++){
4138
    for(i=0; i<p->pSrc->nSrc; i++){
4139
      struct SrcList_item *pItem = &p->pSrc->a[i];
4139
      struct SrcList_item *pItem = &p->pSrc->a[i];
4140
      sqlite3DebugPrintf("%*s ", indent+6, zPrefix);
4140
      sqlite3DebugPrintf("%s ", zPrefix);
4141
      zPrefix = "";
4141
      zPrefix = "";
4142
      if( pItem->pSelect ){
4142
      if( pItem->pSelect ){
4143
        sqlite3DebugPrintf("(\n");
4143
        sqlite3DebugPrintf("(\n");
4144
        sqlite3PrintSelect(pItem->pSelect, indent+10);
4144
        sqlite3PrintSelect(pItem->pSelect, indent+10);
4145
        sqlite3DebugPrintf("%*s)", indent+8, "");
4145
        sqlite3DebugPrintf(")");
4146
      }else if( pItem->zName ){
4146
      }else if( pItem->zName ){
4147
        sqlite3DebugPrintf("%s", pItem->zName);
4147
        sqlite3DebugPrintf("%s", pItem->zName);
4148
      }
4148
      }
Lines 4159-4180 void sqlite3PrintSelect(Select *p, int i Link Here
4159
    }
4159
    }
4160
  }
4160
  }
4161
  if( p->pWhere ){
4161
  if( p->pWhere ){
4162
    sqlite3DebugPrintf("%*s WHERE ", indent, "");
4162
    sqlite3DebugPrintf(" WHERE ");
4163
    sqlite3PrintExpr(p->pWhere);
4163
    sqlite3PrintExpr(p->pWhere);
4164
    sqlite3DebugPrintf("\n");
4164
    sqlite3DebugPrintf("\n");
4165
  }
4165
  }
4166
  if( p->pGroupBy ){
4166
  if( p->pGroupBy ){
4167
    sqlite3DebugPrintf("%*s GROUP BY ", indent, "");
4167
    sqlite3DebugPrintf(" GROUP BY ");
4168
    sqlite3PrintExprList(p->pGroupBy);
4168
    sqlite3PrintExprList(p->pGroupBy);
4169
    sqlite3DebugPrintf("\n");
4169
    sqlite3DebugPrintf("\n");
4170
  }
4170
  }
4171
  if( p->pHaving ){
4171
  if( p->pHaving ){
4172
    sqlite3DebugPrintf("%*s HAVING ", indent, "");
4172
    sqlite3DebugPrintf(" HAVING ");
4173
    sqlite3PrintExpr(p->pHaving);
4173
    sqlite3PrintExpr(p->pHaving);
4174
    sqlite3DebugPrintf("\n");
4174
    sqlite3DebugPrintf("\n");
4175
  }
4175
  }
4176
  if( p->pOrderBy ){
4176
  if( p->pOrderBy ){
4177
    sqlite3DebugPrintf("%*s ORDER BY ", indent, "");
4177
    sqlite3DebugPrintf(" ORDER BY ");
4178
    sqlite3PrintExprList(p->pOrderBy);
4178
    sqlite3PrintExprList(p->pOrderBy);
4179
    sqlite3DebugPrintf("\n");
4179
    sqlite3DebugPrintf("\n");
4180
  }
4180
  }
(-)./src/shell.c.dist (-1 / +1 lines)
Lines 548-554 static int callback(void *pArg, int nArg Link Here
548
      }
548
      }
549
      if( p->cnt++>0 ) fprintf(p->out,"\n");
549
      if( p->cnt++>0 ) fprintf(p->out,"\n");
550
      for(i=0; i<nArg; i++){
550
      for(i=0; i<nArg; i++){
551
        fprintf(p->out,"%*s = %s\n", w, azCol[i],
551
        fprintf(p->out,"%s = %s\n", azCol[i],
552
                azArg[i] ? azArg[i] : p->nullvalue);
552
                azArg[i] ? azArg[i] : p->nullvalue);
553
      }
553
      }
554
      break;
554
      break;
(-)./tool/lemon.c.dist (-22 / +14 lines)
Lines 1667-1677 FILE *err; Link Here
1667
  }
1667
  }
1668
  spcnt += k;
1668
  spcnt += k;
1669
  for(; argv[i]; i++) fprintf(err," %s",argv[i]);
1669
  for(; argv[i]; i++) fprintf(err," %s",argv[i]);
1670
  if( spcnt<20 ){
1671
    fprintf(err,"\n%*s^-- here\n",spcnt,"");
1672
  }else{
1673
    fprintf(err,"\n%*shere --^\n",spcnt-7,"");
1674
  }
1675
}
1670
}
1676
1671
1677
/*
1672
/*
Lines 1913-1930 void OptPrint(){ Link Here
1913
        break;
1908
        break;
1914
      case OPT_INT:
1909
      case OPT_INT:
1915
      case OPT_FINT:
1910
      case OPT_FINT:
1916
        fprintf(errstream,"  %s=<integer>%*s  %s\n",op[i].label,
1911
        fprintf(errstream,"  %s=<integer> %s\n",op[i].label,op[i].message);
1917
          (int)(max-lemonStrlen(op[i].label)-9),"",op[i].message);
1918
        break;
1912
        break;
1919
      case OPT_DBL:
1913
      case OPT_DBL:
1920
      case OPT_FDBL:
1914
      case OPT_FDBL:
1921
        fprintf(errstream,"  %s=<real>%*s  %s\n",op[i].label,
1915
        fprintf(errstream,"  %s=<real> %s\n",op[i].label,op[i].message);
1922
          (int)(max-lemonStrlen(op[i].label)-6),"",op[i].message);
1923
        break;
1916
        break;
1924
      case OPT_STR:
1917
      case OPT_STR:
1925
      case OPT_FSTR:
1918
      case OPT_FSTR:
1926
        fprintf(errstream,"  %s=<string>%*s  %s\n",op[i].label,
1919
        fprintf(errstream,"  %s=<string> %s\n",op[i].label,op[i].message);
1927
          (int)(max-lemonStrlen(op[i].label)-8),"",op[i].message);
1928
        break;
1920
        break;
1929
    }
1921
    }
1930
  }
1922
  }
Lines 2866-2890 int PrintAction(struct action *ap, FILE Link Here
2866
  int result = 1;
2858
  int result = 1;
2867
  switch( ap->type ){
2859
  switch( ap->type ){
2868
    case SHIFT:
2860
    case SHIFT:
2869
      fprintf(fp,"%*s shift  %d",indent,ap->sp->name,ap->x.stp->statenum);
2861
      fprintf(fp,"%s shift  %d",ap->sp->name,ap->x.stp->statenum);
2870
      break;
2862
      break;
2871
    case REDUCE:
2863
    case REDUCE:
2872
      fprintf(fp,"%*s reduce %d",indent,ap->sp->name,ap->x.rp->index);
2864
      fprintf(fp,"%s reduce %d",ap->sp->name,ap->x.rp->index);
2873
      break;
2865
      break;
2874
    case ACCEPT:
2866
    case ACCEPT:
2875
      fprintf(fp,"%*s accept",indent,ap->sp->name);
2867
      fprintf(fp,"%s accept",ap->sp->name);
2876
      break;
2868
      break;
2877
    case ERROR:
2869
    case ERROR:
2878
      fprintf(fp,"%*s error",indent,ap->sp->name);
2870
      fprintf(fp,"%s error",ap->sp->name);
2879
      break;
2871
      break;
2880
    case SRCONFLICT:
2872
    case SRCONFLICT:
2881
    case RRCONFLICT:
2873
    case RRCONFLICT:
2882
      fprintf(fp,"%*s reduce %-3d ** Parsing conflict **",
2874
      fprintf(fp,"%s reduce %-3d ** Parsing conflict **",
2883
        indent,ap->sp->name,ap->x.rp->index);
2875
        ap->sp->name,ap->x.rp->index);
2884
      break;
2876
      break;
2885
    case SSCONFLICT:
2877
    case SSCONFLICT:
2886
      fprintf(fp,"%*s shift  %d ** Parsing conflict **", 
2878
      fprintf(fp,"%s shift  %d ** Parsing conflict **", 
2887
        indent,ap->sp->name,ap->x.stp->statenum);
2879
        ap->sp->name,ap->x.stp->statenum);
2888
      break;
2880
      break;
2889
    case SH_RESOLVED:
2881
    case SH_RESOLVED:
2890
    case RD_RESOLVED:
2882
    case RD_RESOLVED:
Lines 2916-2922 struct lemon *lemp; Link Here
2916
      char buf[20];
2908
      char buf[20];
2917
      if( cfp->dot==cfp->rp->nrhs ){
2909
      if( cfp->dot==cfp->rp->nrhs ){
2918
        sprintf(buf,"(%d)",cfp->rp->index);
2910
        sprintf(buf,"(%d)",cfp->rp->index);
2919
        fprintf(fp,"    %5s ",buf);
2911
        fprintf(fp,"    %s ",buf);
2920
      }else{
2912
      }else{
2921
        fprintf(fp,"          ");
2913
        fprintf(fp,"          ");
2922
      }
2914
      }
Lines 3817-3825 int mhflag; /* Output in makeheaders Link Here
3817
    for(i=0; i<lemp->nterminal; i++){
3809
    for(i=0; i<lemp->nterminal; i++){
3818
      struct symbol *p = lemp->symbols[i];
3810
      struct symbol *p = lemp->symbols[i];
3819
      if( p->fallback==0 ){
3811
      if( p->fallback==0 ){
3820
        fprintf(out, "    0,  /* %10s => nothing */\n", p->name);
3812
        fprintf(out, "    0,  /* %s => nothing */\n", p->name);
3821
      }else{
3813
      }else{
3822
        fprintf(out, "  %3d,  /* %10s => %s */\n", p->fallback->index,
3814
        fprintf(out, "  %3d,  /* %s => %s */\n", p->fallback->index,
3823
          p->name, p->fallback->name);
3815
          p->name, p->fallback->name);
3824
      }
3816
      }
3825
      lineno++;
3817
      lineno++;
(-)./tool/mkkeywordhash.c.dist (-3 / +3 lines)
Lines 472-478 int main(int argc, char **argv){ Link Here
472
    memcpy(&zText[k], p->zName, p->len);
472
    memcpy(&zText[k], p->zName, p->len);
473
    k += p->len;
473
    k += p->len;
474
    if( j+p->len>70 ){
474
    if( j+p->len>70 ){
475
      printf("%*s */\n", 74-j, "");
475
      printf(" */\n");
476
      j = 0;
476
      j = 0;
477
    }
477
    }
478
    if( j==0 ){
478
    if( j==0 ){
Lines 483-489 int main(int argc, char **argv){ Link Here
483
    j += p->len;
483
    j += p->len;
484
  }
484
  }
485
  if( j>0 ){
485
  if( j>0 ){
486
    printf("%*s */\n", 74-j, "");
486
    printf(" */\n");
487
  }
487
  }
488
  printf("  static const char zText[%d] = {\n", nChar);
488
  printf("  static const char zText[%d] = {\n", nChar);
489
  zText[nChar] = 0;
489
  zText[nChar] = 0;
Lines 557-563 int main(int argc, char **argv){ Link Here
557
  for(i=j=0; i<nKeyword; i++){
557
  for(i=j=0; i<nKeyword; i++){
558
    char *zToken = aKeywordTable[i].zTokenType;
558
    char *zToken = aKeywordTable[i].zTokenType;
559
    if( j==0 ) printf("    ");
559
    if( j==0 ) printf("    ");
560
    printf("%s,%*s", zToken, (int)(14-strlen(zToken)), "");
560
    printf("%s, ", zToken);
561
    j++;
561
    j++;
562
    if( j>=5 ){
562
    if( j>=5 ){
563
      printf("\n");
563
      printf("\n");

Return to bug 212282