Changeset e9ad8a6 in git for Singular/scanner.l
- Timestamp:
- Jun 2, 1998, 5:30:06 PM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 3e51af9f276f204e3b6cfcf1258c17b8f270f019
- Parents:
- 98aa53fd19f83e591c2dccae346010e080a9f7bc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/scanner.l
r98aa53 re9ad8a6 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 /* $Id: scanner.l,v 1.1 2 1998-04-07 08:30:32Singular Exp $ */5 /* $Id: scanner.l,v 1.13 1998-06-02 15:30:04 Singular Exp $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 28 28 static char * dupyytext() 29 29 { 30 //int i = strlen((char *)yytext);31 //if (i>0) yytext[i-1] = '\0';32 30 if (yyleng>0) yytext[yyleng-1] = '\0'; 33 31 return mstrdup((char *)yytext); … … 40 38 if (i>0) 41 39 { 42 yytext[i-1] = '\0'; 43 strcpy( rc, (char *)yytext ); 40 strncpy( rc, (char *)yytext, i-1 ); 44 41 } 45 42 else 43 { 46 44 i++; 45 } 47 46 rc[i-1] = '\n'; 48 47 rc[i] = '\n'; … … 93 92 \/\/[^\n]* { } 94 93 ^#![^\n]* { } 94 "/*" { 95 yy_noeof=noeof_comment; 96 loop 97 { 98 register int c; 99 while ( (c = yyinput()) != '*' && c != EOF ); 100 if ( c == '*' ) 101 { 102 while ( (c = yyinput()) == '*' ); 103 if ( c == '/' ) break; /* found the end */ 104 } 105 else 106 { 107 break; 108 } 109 } 110 yy_noeof=0; 111 } 95 112 pause[ \t\n]*[\.;] { fePause(); } 96 113 while { blocknest = 0; yy_noeof = noeof_brace; BEGIN(brace); … … 254 271 } 255 272 \$ { 256 #ifdef HAVE_TCL 257 if (tclmode) 258 PrintTCL('Q',0,NULL); 259 else 260 #endif 261 { if (BVERBOSE(0)) printf("\n$Bye.\n"); } 262 #ifndef macintosh 263 #ifdef HAVE_FEREAD 264 #ifdef HAVE_ATEXIT 265 fe_reset_input_mode(); 266 #else 267 fe_reset_input_mode(0,NULL); 268 #endif 269 #else 270 #ifdef HAVE_READLINE 271 fe_reset_input_mode(); 272 #endif 273 #endif 274 #endif 275 #ifdef sun 276 #ifndef __svr4__ 277 _cleanup(); 278 _exit(0); 279 #endif 280 #endif 281 exit(0); 273 m2_end(-1); 282 274 } 283 275 (quit|exit)[ \t\n]*[\.;]? { 284 #ifdef HAVE_TCL285 if (tclmode)286 PrintTCL('Q',0,NULL);287 else288 #endif289 276 #ifdef MM_STAT 290 277 mmStat(-500); 291 #endif292 { if (BVERBOSE(0)) printf("\nAuf Wiedersehen.\n"); }293 #ifndef macintosh294 #ifdef HAVE_FEREAD295 #ifdef HAVE_ATEXIT296 fe_reset_input_mode();297 #else298 fe_reset_input_mode(0,NULL);299 #endif300 #else301 #ifdef HAVE_READLINE302 fe_reset_input_mode();303 #endif304 #endif305 278 #endif 306 279 #ifdef MDEBUG … … 309 282 #endif 310 283 #endif 311 #ifdef sun 312 #ifndef __svr4__ 313 _cleanup(); 314 _exit(0); 315 #endif 316 #endif 317 exit(0); 284 m2_end(0); 318 285 } 319 286
Note: See TracChangeset
for help on using the changeset viewer.