Changeset cc94b0a in git for Singular/febase.inc
- Timestamp:
- Mar 31, 1998, 11:00:50 AM (26 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- bc82d60fa171675a0c23a3e2051318500187aa39
- Parents:
- c9ea817ef59b4d9f8adaa507840ddb8ff4d4a945
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/febase.inc
rc9ea817 rcc94b0a 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: febase.inc,v 1. 4 1998-03-02 15:22:48Singular Exp $ */4 /* $Id: febase.inc,v 1.5 1998-03-31 09:00:42 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: handling of 'voices' 7 7 */ 8 9 extern int noeof; 10 int blocklineno; // to get the lineno of the block start from scanner 8 #include <ctype.h> 9 10 int yy_noeof=0; // the scanner "state" 11 int yy_blocklineno; // to get the lineno of the block start from scanner 11 12 Voice *currentVoice = NULL; 12 FILE *feFilePending; /*temp. storage for grammar.y */13 FILE *feFilePending; /*temp. storage for grammar.y */ 13 14 14 15 static char * BT_name[]={"BT_none","BT_break","BT_proc","BT_example", … … 153 154 case BT_if: 154 155 case BT_else: 155 yylineno = blocklineno;156 yylineno = yy_blocklineno; 156 157 break; 157 158 case BT_break: 158 yylineno = blocklineno-1;159 yylineno = yy_blocklineno-1; 159 160 break; 160 161 //case BT_file: … … 320 321 else 321 322 { 322 currentVoice->prev->ifsw= BI_stdin;323 currentVoice->prev->ifsw=0; 323 324 } 324 325 if ((currentVoice->sw == BI_file) … … 432 433 { 433 434 // try to read from the buffer: 434 b[1] = '\0';435 // b[1] = '\0'; 435 436 if ((currentVoice->buffer!=NULL) 436 437 && (currentVoice->buffer[currentVoice->fptr]!='\0')) 437 438 { 438 439 NewBuff: 439 b[0]=currentVoice->buffer[currentVoice->fptr]; 440 int i=0; 441 int startfptr=currentVoice->fptr; 442 l--; 443 loop 444 { 445 char c= 446 b[i]=currentVoice->buffer[currentVoice->fptr]; 447 i++; 448 if ((c<' ') 449 || (c==';') 450 //|| (c=='(') 451 || (c==')') 452 || (c=='}') 453 || (c=='"') 454 || (c=='$')) break; 455 if (i>=l) break; 456 currentVoice->fptr++; 457 if(currentVoice->buffer[currentVoice->fptr]=='\0') break; 458 } 459 //b[0]=currentVoice->buffer[currentVoice->fptr]; 460 b[i]='\0'; 461 //b[1]='\0'; 440 462 if (currentVoice->sw==BI_buffer) 441 463 { 442 if (currentVoice->fptr==0) 464 //if (currentVoice->fptr==0) 465 if (startfptr==0) 443 466 { 444 467 char *anf=currentVoice->buffer; … … 453 476 FreeL((ADDRESS)s); 454 477 } 455 else if (/*(currentVoice->fptr>0) &&*/ 456 (currentVoice->buffer[currentVoice->fptr-1]=='\n')) 478 //else if (/*(currentVoice->fptr>0) &&*/ 479 //(currentVoice->buffer[currentVoice->fptr-1]=='\n')) 480 else if (/*(startfptr>0) &&*/ 481 (currentVoice->buffer[startfptr-1]=='\n')) 457 482 { 458 char *anf=currentVoice->buffer+currentVoice->fptr; 483 //char *anf=currentVoice->buffer+currentVoice->fptr; 484 char *anf=currentVoice->buffer+startfptr; 459 485 char *ss=strchr(anf,'\n'); 460 486 int len; … … 470 496 } 471 497 currentVoice->fptr++; 472 return 1; 498 return i; 499 //return 1; 473 500 } 474 501 // no buffer there or e-o-buffer or eoln: … … 514 541 /* else if (s==NULL) */ 515 542 { 516 switch( noeof)543 switch(yy_noeof) 517 544 { 518 545 case 0:
Note: See TracChangeset
for help on using the changeset viewer.