Changeset 6be769 in git


Ignore:
Timestamp:
May 9, 1998, 4:34:33 PM (25 years ago)
Author:
Kai Krüger <krueger@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
7cdf52894508b5af568db20ad09389a32ccca531
Parents:
4d6a4d8ac279c490518dc0c8d688532d047ca93a
Message:
Changes for help-section of procedures


git-svn-id: file:///usr/local/Singular/svn/trunk@1672 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/iplib.cc

    r4d6a4d r6be769  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iplib.cc,v 1.23 1998-05-05 13:46:37 krueger Exp $ */
     4/* $Id: iplib.cc,v 1.24 1998-05-09 14:34:29 krueger Exp $ */
    55/*
    66* ABSTRACT: interpreter: LIB and help
     
    140140  if(part==0)
    141141  { // load help string
    142     procbuflen = pi->data.s.body_start - pi->data.s.proc_start;
     142    long head = pi->data.s.def_end - pi->data.s.proc_start;
     143    procbuflen = pi->data.s.help_end - pi->data.s.help_start;
    143144    //Print("Help=%ld-%ld=%d\n", pi->data.s.body_start,
    144145    //    pi->data.s.proc_start, procbuflen);
    145     s = (char *)AllocL(procbuflen);
    146     myfread(s, procbuflen, 1, fp);
    147     s[procbuflen] = '\0';
     146    s = (char *)AllocL(procbuflen+head+2);
     147    myfread(s, head, 1, fp);
     148    s[head] = '\n';
     149    fseek(fp, pi->data.s.help_start, SEEK_SET);
     150    myfread(s+head+1, procbuflen, 1, fp);
     151    s[procbuflen+head+1] = '\n';
     152    s[procbuflen+head+2] = '\0';
    148153    return(s);
    149154  }
     
    718723  pi->data.s.proc_start = pos;
    719724  pi->data.s.help_start = 0L;
     725  pi->data.s.help_end   = 0L;
    720726  pi->data.s.body_start = 0L;
    721727  pi->data.s.body_end   = 0L;
  • Singular/libparse.l

    r4d6a4d r6be769  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: libparse.l,v 1.20 1998-05-07 08:20:32 krueger Exp $ */
     5/* $Id: libparse.l,v 1.21 1998-05-09 14:34:31 krueger Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    133133     if ( mode == LOAD_LIB) pi->data.s.def_end = p;
    134134#  define SET_HELP_START(mode, pi, p) \
    135      if ( mode == LOAD_LIB) pi->data.s.help_start = p; \
     135     if ( mode == LOAD_LIB) pi->data.s.help_start = p;
     136
     137#  define SET_HELP_END(mode, pi, p) \
     138     if ( mode == LOAD_LIB) pi->data.s.help_end = p;
    136139
    137140#  define SET_BODY_START(mode, pi, l, p) \
     
    289292                  printf("// PROCEDURE '%s' status: %s, ", proc,
    290293                      p_static ? "local" : "global");
    291                   printf("starting at line %d,%d: (%d).\n",
    292                       yylplineno, current_pos(0), brace1);
     294                  printf("starting at line %d,%d: definition end: %d (%d).\n",
     295                      yylplineno, current_pos(0), pi->data.s.def_end, brace1);
    293296               }
    294297#endif
     
    491494<poldhelp>{escbrack} { }
    492495<poldhelp>"{" {
     496                SET_HELP_END(mode, pi, current_pos(0));
    493497                brace1++; BEGIN(pbody);
    494                 if(lpverbose)
     498                if(lpverbose) {
     499                   printf("//     HELP from %d to %d\n",
     500                       pi->data.s.help_start, pi->data.s.help_end);
    495501                   printf("//     BODY at line %d,%d (%d)\n", yylplineno,
    496502                       current_pos(0), brace1);
     503                }
    497504#if YYLPDEBUG > 1
    498505                printf("BEGIN(pbody){=%d, (=%d, [=%d\n", brace1, brace2, brace3);
     
    514521<phelp>"{" {
    515522             brace1++; BEGIN(pbody);
    516              if(lpverbose)
     523             if(lpverbose) {
     524                printf("//     HELP from %d to %d\n",
     525                    pi->data.s.help_start, pi->data.s.help_end);
    517526                printf("//     BODY at line %d,%d (%d)\n", yylplineno,
    518527                    current_pos(0), brace1);
     528             }
    519529#if YYLPDEBUG > 1
    520530             printf("BEGIN(pbody){=%d, (=%d, [=%d\n", brace1, brace2, brace3);
     
    596606                           copy_string(mode);
    597607                           last_cmd = LP_NONE;
     608                           if(old_state==phelp)
     609                              SET_HELP_END(mode, pi, current_pos(0));
    598610                           BEGIN(old_state); /* printf("%s", yytext); */
    599611                         }
     
    759771  lib_style_types lib_style;
    760772  main_init(argc, argv);
     773  if(yyin == NULL) {
     774    printf("No library found to parse.\n");
     775    exit(1);
     776  }
     777 
    761778  if(lpverbose)printf("Verbose level=%d\n", lpverbose);
    762779  if(check)printf("Reporting most possible annomalies.\n");
  • Singular/subexpr.h

    r4d6a4d r6be769  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: subexpr.h,v 1.5 1998-03-06 11:50:38 krueger Exp $ */
     6/* $Id: subexpr.h,v 1.6 1998-05-09 14:34:32 krueger Exp $ */
    77/*
    88* ABSTRACT: handling of leftv
     
    9494  long   def_end;          // position where proc header is ending
    9595  long   help_start;       // position where help is starting
     96  long   help_end;         // position where help is starting
    9697  long   body_start;       // position where proc-body is starting
    9798  long   body_end;         // position where proc-body is ending
  • Singular/utils.cc

    r4d6a4d r6be769  
    1717
    1818  while((c=getopt(argc, argv, "d:sf:"))>=0) {
    19    
    2019    switch(c)
    2120      {
    2221      case 'd':
    2322        lpverbose = 1;
    24         sscanf(optarg, "%d", &lpverbose);
     23        if(isdigit(argv[optind-1][0])) sscanf(optarg, "%d", &lpverbose);
     24        else optind--;
    2525        break;
    2626      case 'f': file = argv[optind-1];
    27         //      printf("opening:%d %s\n", optind, file);
    2827        break;
    2928      case 's':
     
    3231      case -1 : printf("no such option:%s\n", argv[optind]);
    3332        break;
    34       default: printf("no such option.%x, %s\n", c&0xff, argv[optind]);
     33      default: printf("no such option.%x, %c %s\n", c&0xff, c, argv[optind]);
    3534      }
    3635  }
    37 
    38   if(file!=NULL)
     36  if(file!=NULL) {
    3937    yylpin = fopen( file, "rb" );
    40   else
    41     yylpin = stdin;
     38    printf("Checking library '%s'\n", file);
     39  } else {
     40    while(argc>optind && yylpin==NULL) {
     41      yylpin = fopen( argv[optind], "rb" );
     42      if(yylpin!=NULL) printf("Checking library '%s'\n", argv[optind]);
     43      else optind++;
     44    }
     45  }
    4246}
    4347
     
    101105    pi->data.s.body_end = pi->data.s.proc_end;
    102106
     107  if(lpverbose) printf("//     ");
    103108  printf( "%c %-15s  %20s ", pi->is_static ? 'l' : 'g', pi->libname,
    104109          pi->procname);
  • Singular/utils.h

    r4d6a4d r6be769  
    2121  long   def_end;          // position where proc header is ending
    2222  long   help_start;       // position where help is starting
     23  long   help_end;         // position where help is starting
    2324  long   body_start;       // position where proc-body is starting
    2425  long   body_end;         // position where proc-body is ending
Note: See TracChangeset for help on using the changeset viewer.