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.24 2002/12/18 20:23:29 nilsson Exp $ + // $Id: Pike.pmod,v 1.25 2003/01/22 15:12:51 nilsson Exp $      //! This module parses and tokanizes Pike source code.      inherit "C.pmod";      #define UNKNOWN_TOKEN \    throw( ({sprintf("Unknown pike token: %O\n",data[pos..pos+20]) }) )      static mapping(string : int) backquoteops =   (["/":1,
pike.git/lib/modules/Parser.pmod/Pike.pmod:48:    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 ret;    } -  ret += ({ state->remains + data[..pos] }); +  ret += ({ state->remains + data[..pos+1] });    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);
pike.git/lib/modules/Parser.pmod/Pike.pmod:106:    if(data[pos]=='\"') {    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]; +  state->remains = data[pos-1..sizeof(data)-3];    return ret;    }    error("Failed to find end of multiline string.\n");    }       if(s==-1 || s>q) {    pos = q+1;    break;    }   
pike.git/lib/modules/Parser.pmod/Pike.pmod:263:    switch(data[pos..pos+1])    {    case "//":    pos=search(data,"\n",pos);    break;       case "/*":    pos=search(data,"*/",pos);    if(pos==-1) {    if(state) { -  state->remains = data[start..sizeof(data)-2]; +  state->remains = data[start..sizeof(data)-3];    state->in_token = 1;    return ret;    }    error("Failed to find end of comment.\n");    }    pos+=2;    break;       case "<<": case ">>":    if(data[pos+2]=='=') pos++;