Branch: Tag:

1996-10-29

1996-10-29 21:39:44 by Per Hedbor <ph@opera.com>

Fix for 8bit-character support and infinite loop in lex.c

Rev: src/language.yacc:1.2
Rev: src/lex.c:1.4
Rev: src/macros.h:1.2
Rev: src/pike_types.c:1.3

385:   {    struct inputstate *next;    int fd; -  char *data; +  unsigned char *data;    INT32 buflen;    INT32 pos;    int dont_free_data;
611:   #define READAHEAD 8192   static int file_getc()   { -  char buf[READAHEAD]; +  unsigned char buf[READAHEAD];    int got;    do {    got=read(istate->fd, buf, READAHEAD);
1083:    {    do{    SKIPTO('*'); +  if(LOOK()==MY_EOF) +  { +  yyerror("Unexpected end of file while skipping comment."); +  return; +  }    }while(!GOBBLE('/'));    }    continue;
1507:    if(GOBBLE('=')) return F_MULT_EQ;    return '*';    +  case (unsigned)('·'&0xff): +  if(GOBBLE('=')) return F_MULT_EQ; +  return F_MULT; +     case '%':    if(GOBBLE('=')) return F_MOD_EQ;    return '%';
1516:    {    do{    SKIPTO('*'); -  }while(!GOBBLE('/')); +  if(LOOK()==MY_EOF) +  { +  yyerror("Unexpected end of file while skipping comment."); +  return 0; +  } +  } while(!GOBBLE('/'));    continue;    }else if(GOBBLE('/'))    {    SKIPUPTO('\n');    continue;    } -  +  /* Fallthrough */ +  case ((unsigned)('÷'&0xff)):    if(GOBBLE('=')) return F_DIV_EQ;    return '/';   
1550:    return '>';       case '!': +  case 0xac: /* ('¬') */    if(GOBBLE('=')) return F_NE;    return F_NOT;