Changeset e9ad8a6 in git for Singular/scanner.l


Ignore:
Timestamp:
Jun 2, 1998, 5:30:06 PM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
3e51af9f276f204e3b6cfcf1258c17b8f270f019
Parents:
98aa53fd19f83e591c2dccae346010e080a9f7bc
Message:
* hannes:introduced /* */ comments, some code cleanups


git-svn-id: file:///usr/local/Singular/svn/trunk@2016 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/scanner.l

    r98aa53 re9ad8a6  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: scanner.l,v 1.12 1998-04-07 08:30:32 Singular Exp $ */
     5/* $Id: scanner.l,v 1.13 1998-06-02 15:30:04 Singular Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    2828static char * dupyytext()
    2929{
    30   //int i = strlen((char *)yytext);
    31   //if (i>0) yytext[i-1] = '\0';
    3230  if (yyleng>0) yytext[yyleng-1] = '\0';
    3331  return mstrdup((char *)yytext);
     
    4038  if (i>0)
    4139  {
    42     yytext[i-1] = '\0';
    43     strcpy( rc, (char *)yytext );
     40    strncpy( rc, (char *)yytext, i-1 );
    4441  }
    4542  else
     43  {
    4644    i++;
     45  }
    4746  rc[i-1] = '\n';
    4847  rc[i] = '\n';
     
    9392\/\/[^\n]*               { }
    9493^#![^\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                         }
    95112pause[ \t\n]*[\.;]       { fePause(); }
    96113while                    { blocknest = 0; yy_noeof = noeof_brace; BEGIN(brace);
     
    254271                         }
    255272\$                       {
    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);
    282274                         }
    283275(quit|exit)[ \t\n]*[\.;]?  {
    284                            #ifdef HAVE_TCL
    285                              if (tclmode)
    286                                PrintTCL('Q',0,NULL);
    287                              else
    288                            #endif
    289276                           #ifdef MM_STAT
    290277                           mmStat(-500);
    291                            #endif
    292                            { if (BVERBOSE(0)) printf("\nAuf Wiedersehen.\n"); }
    293                            #ifndef macintosh
    294                              #ifdef HAVE_FEREAD
    295                                #ifdef HAVE_ATEXIT
    296                                  fe_reset_input_mode();
    297                                #else
    298                                  fe_reset_input_mode(0,NULL);
    299                                #endif
    300                              #else
    301                                #ifdef HAVE_READLINE
    302                                  fe_reset_input_mode();
    303                                #endif
    304                              #endif
    305278                           #endif
    306279                           #ifdef MDEBUG
     
    309282                             #endif
    310283                           #endif
    311                            #ifdef sun
    312                            #ifndef __svr4__
    313                            _cleanup();
    314                            _exit(0);
    315                            #endif
    316                            #endif
    317                            exit(0);
     284                           m2_end(0);
    318285                         }
    319286
Note: See TracChangeset for help on using the changeset viewer.