pike.git / lib / modules / Parser.pmod / Pike.pmod

version» Context lines:

pike.git/lib/modules/Parser.pmod/Pike.pmod:1:   //   // This file needs to support old pikes that e.g. don't understand   // "#pike". Some of them fail when they see an unknown cpp directive.   //   // #pike __REAL_VERSION__   // - // $Id: Pike.pmod,v 1.18 2002/03/20 16:59:01 nilsson Exp $ + // $Id: Pike.pmod,v 1.19 2002/04/02 16:29:46 nilsson Exp $      inherit "C.pmod";      #define UNKNOWN_TOKEN \    throw( ({sprintf("Unknown pike token: %O\n",data[pos..pos+20]) }) )      static mapping(string : int) backquoteops =   (["/":1,    "%":1,    "*":1,
pike.git/lib/modules/Parser.pmod/Pike.pmod:38:    data += "\n\0"; // End sentinel.       if(state && state->in_token) {    switch(state->remains[0..1]) {       case "/*":    pos = search(data, "*/");    if(pos==-1) {    state->in_token = 1;    state->remains += data[..sizeof(data)-2]; -  return ({}); +  return ret;    }    ret += ({ state->remains + data[..pos] });    m_delete(state, "remains");    pos+=2;    break;       case "#\"":    int q,s;    pos=-1;    while(1) {    q = search(data,"\"",pos+1);    s = search(data,"\\",pos+1);       if( q==-1 ||    (s==sizeof(data)-2 && s<q) ) {    state->in_token = 1;    state->remains += data[..sizeof(data)-2]; -  return ({}); +  return ret;    }       if(s==-1 || s>q) {    pos = q+1;    break;    }       pos=s+1;    }    ret += ({ state->remains + data[..pos-1] });
pike.git/lib/modules/Parser.pmod/Pike.pmod:99:    int q,s;    while(1) {    q = search(data,"\"",pos+1);    s = search(data,"\\",pos+1);       if( q==-1 ||    (s==sizeof(data)-2 && s<q) ) {    if(state) {    state->in_token = 1;    state->remains = data[pos-1..sizeof(data)-2]; -  return ({}); +  return ret;    }    error("Failed to find end of multiline string.\n");    }       if(s==-1 || s>q) {    pos = q+1;    break;    }       pos=s+1;