=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/parse/lex.c,v retrieving revision 1.21 retrieving revision 1.26 diff -u -p -r1.21 -r1.26 --- OpenXM_contrib2/asir2000/parse/lex.c 2002/09/09 23:52:45 1.21 +++ OpenXM_contrib2/asir2000/parse/lex.c 2003/08/21 08:05:02 1.26 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/parse/lex.c,v 1.20 2002/09/09 12:23:51 kondoh Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/parse/lex.c,v 1.25 2003/05/30 00:47:24 noro Exp $ */ #include #include "ca.h" @@ -277,7 +277,7 @@ int yylex() } if ( floatingpoint ) { Ungetc(c); REALLOC_NBUF nbuf[i] = 0; -#if PARI +#if defined(PARI) if ( !bigfloat ) { dbl = (double)atof(nbuf+DLENGTH); MKReal(dbl,real); r = (Obj)real; @@ -299,12 +299,29 @@ int yylex() } yylvalp->p = (pointer)r; return ( FORMULA ); - } else if ( isalpha(c) ) { - i = 0; - tbuf[i++] = c; + } else if ( isalpha(c) || c == ':' ) { + if ( c == ':' ) { + c1 = Getc(); + if ( c1 != ':' ) { + Ungetc(c1); + return c; + } + c1 = Getc(); + if ( !isalpha(c1) ) { + Ungetc(c1); + return COLONCOLON; + } + i = 0; + tbuf[i++] = ':'; + tbuf[i++] = ':'; + tbuf[i++] = c1; + } else { + i = 0; + tbuf[i++] = c; + } while ( 1 ) { c = Getc(); - if ( isalpha(c)||isdigit(c)||(c=='_') ) { + if ( isalpha(c)||isdigit(c)||(c=='_')||(c=='.') ) { REALLOC_TBUF tbuf[i++] = c; } else break; @@ -427,7 +444,7 @@ void purge_stdin() w_purge_stdin(); #elif defined(sparc) || defined(__alpha) || defined(__SVR4) || defined(mips) || defined(VISUAL) || defined(_IBMR2) stdin->_ptr = stdin->_base; stdin->_cnt = 0; -#elif (defined(__MACH__) && defined(__ppc__)) || defined(__CYGWIN__) +#elif (defined(__MACH__) && defined(__ppc__)) || defined(__CYGWIN__) || defined(__FreeBSD__) stdin->_r = 0; stdin->_p = stdin->_bf._base; #else --->FIXIT