pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:1269:    if(INDEX_PCHARP(data,pos)=='\n')    {    this->current_line++;    if( emit )PUTNL();    }    pos++;    }    return pos + 2;   }    - static ptrdiff_t find_end_of_string2( struct cpp *this, const PCHARP data, -  ptrdiff_t len, ptrdiff_t pos) - { -  while(1) -  { -  if(pos>=len) -  { -  cpp_error(this,"End of file in string."); -  break; -  } -  switch(INDEX_PCHARP(data,pos++)) -  { -  case '\n': -  this->current_line++; -  PUTNL(); -  continue; -  case '"': return pos; -  case '\\': -  if(INDEX_PCHARP(data,pos)=='\n') { -  this->current_line++; -  PUTNL(); -  } -  else if ((INDEX_PCHARP(data,pos) == '\r') && (INDEX_PCHARP(data,pos+1) == '\n')) { -  this->current_line++; -  pos++; -  PUTNL(); -  } -  pos++; -  } -  } -  return pos; - } -  -  +    static ptrdiff_t find_end_of_string( struct cpp *this, const PCHARP data, -  ptrdiff_t len, ptrdiff_t pos) +  ptrdiff_t len, ptrdiff_t pos, +  int flags)   {    while(1)    {    if(pos>=len)    {    cpp_error(this,"End of file in string.");    break;    }    switch(INDEX_PCHARP(data,pos++))    {    case '\n': -  +  if (flags & CPP_END_AT_NEWLINE) {    cpp_error(this,"Newline in string."); -  +  }    this->current_line++;    PUTNL();    break;    case '"': return pos;    case '\\':    if(INDEX_PCHARP(data,pos)=='\n') {    this->current_line++;    PUTNL();    }    else if ((INDEX_PCHARP(data,pos) == '\r') && (INDEX_PCHARP(data,pos+1) == '\n')) {
pike.git/src/cpp.cmod:1401:    this->current_line = start_line;    cpp_error(this, "End of file while looking for end parenthesis.");    this->current_line = save_line;    return pos;    }       switch(INDEX_PCHARP(data,pos++))    {    case '\n': PUTNL(); this->current_line++; break;    case '\'': pos=find_end_of_char(this,data,len,pos); break; -  case '"': pos=find_end_of_string(this,data,len,pos); break; +  case '"': pos=find_end_of_string(this,data,len,pos,CPP_END_AT_NEWLINE); break;    case '(': pos=find_end_parenthesis(this, data, len, pos); break;    case '{': pos=find_end_brace(this, data, len, pos); break;    case ')': return pos;    case '/':    if (INDEX_PCHARP(data,pos) == '*') {    pos = find_end_of_comment(this,data,len,pos+1,0);    } else if (INDEX_PCHARP(data,pos) == '/') {    pos = find_end_of_line(this,data,len,pos+1,0);    }    }
pike.git/src/cpp.cmod:1438:    this->current_line = start_line;    cpp_error(this, "End of file while looking for end brace.");    this->current_line = save_line;    return pos;    }       switch(INDEX_PCHARP(data,pos++))    {    case '\n': PUTNL(); this->current_line++; break;    case '\'': pos=find_end_of_char(this,data,len,pos); break; -  case '"': pos=find_end_of_string(this,data,len,pos); break; +  case '"': pos=find_end_of_string(this,data,len,pos,CPP_END_AT_NEWLINE); break;    case '{': pos=find_end_brace(this, data, len, pos); break;    case '}': return pos;    case '/':    if (INDEX_PCHARP(data,pos) == '*') {    pos=find_end_of_comment(this,data,len,pos,0);    } else if (INDEX_PCHARP(data,pos) == '/') {    pos=find_end_of_line(this,data,len,pos,0);    }    }    }
pike.git/src/cpp.cmod:1980:   #define PUSH_STRING0(X,Y,Z) add_quoted_string( X,Y,0,Z)   #define PUSH_STRING_SHIFT(X,Y,Z,A) add_quoted_string(X,Y,Z,A)   #define WC_ISSPACE wide_isspace   #define WC_ISIDCHAR wide_isidchar   /*    * Generic macros    */      #define CHECK_WORD(X,LEN) (begins_with(X,ADD_PCHARP(data,pos),(LEN),len-pos,1))   #define GOBBLE_WORD(X) (CHECK_WORD(X,NELEM(X)) ? (pos+=NELEM(X)),1 : 0) - #define FIND_END_OF_STRING() (pos=find_end_of_string(this,data,len,pos)) - #define FIND_END_OF_STRING2() (pos=find_end_of_string2(this,data,len,pos)) + #define FIND_END_OF_STRING() (pos=find_end_of_string(this,data,len,pos,CPP_END_AT_NEWLINE)) + #define FIND_END_OF_STRING2() (pos=find_end_of_string(this,data,len,pos,0))   #define FIND_END_OF_CHAR() (pos=find_end_of_char(this,data,len,pos))   #define FIND_EOL_PRETEND() (pos=find_end_of_line(this,data,len,pos,0))   #define FIND_EOL() (pos=find_end_of_line(this,data,len,pos,1))   #define SKIPCOMMENT_INC_LINES() (pos=find_end_of_comment(this,data,len,pos,0))   #define SKIPCOMMENT() (pos=find_end_of_comment(this,data,len,pos,1))   #define FIND_EOS() (pos=find_eos(this,data,len,pos))      /* Skips horizontal whitespace and newlines. */   #define SKIPWHITE() (pos=skipwhite(this,data,pos))