View Single Post
  #5  
Old 06-17-2003, 09:25 AM
krich
Hill Giant
 
Join Date: May 2003
Location: The Great Northwest
Posts: 150
Default

Trump,

I just realized that if I increment/decrement the variable comment, I can support nested comments, so change the following lines from:

Code:
if (buffer[i] == '\n') line_num++; 
if (buffer[i] == '/' && buffer[i+1] == '*') { comment = 1; }  
if ((strrchr(charIn,buffer[i]) || quote) && !comment) {   
       temp[p] = buffer[i]; 
       p++; 
} 
if (buffer[i] == '/' && buffer[i-1] == '*') { comment = 0; }   
if (buffer[i] == '\"') {
to:

Code:
if (buffer[i] == '\n') line_num++; 
if (buffer[i] == '/' && buffer[i+1] == '*') { comment++; }  //MODIFY THIS LINE 
if ((strrchr(charIn,buffer[i]) || quote) && !comment) {
       temp[p] = buffer[i]; 
       p++; 
} 
if (buffer[i] == '/' && buffer[i-1] == '*') { comment--; }  //MODIFY THIS LINE 
if (buffer[i] == '\"') {
Again, its in void Parser::LoadScript(int npcid, const char *zone) around line 990 or so.

Regards,

krich
Reply With Quote