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:22:49 nilsson Exp $ + // $Id: Pike.pmod,v 1.25 2002/12/20 18:03:11 grubba 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]) }) ) +  error(sprintf("Unknown pike token: %O\n",data[pos..pos+20]))      static mapping(string : int) backquoteops =   (["/":1,    "%":1,    "*":1,    "*=":2,    "&":1,    "|":1,    "^":1,    "~":1,
pike.git/lib/modules/Parser.pmod/Pike.pmod:221:    data[pos+1]>='0' && data[pos+1]<='9' )    {    pos++;    while(data[pos]>='0' && data[pos]<='9') pos++;    }    break;       default:    UNKNOWN_TOKEN;    -  case '`': +  case '`':    {    int bqstart = pos;    while(data[pos]=='`')    ++pos; -  if (pos - bqstart > 3) // max. three ``` +  if (pos - bqstart > 3) // max. three ``` { +  pos = bqstart;    UNKNOWN_TOKEN; -  +  }    int chars = backquoteops[data[pos..pos+2]]    || backquoteops[data[pos..pos+1]]    || backquoteops[data[pos..pos]];    if (chars)    pos += chars; -  else +  else { +  pos = bqstart;    UNKNOWN_TOKEN;    } -  +  }    break;       case '/':    case '{': case '}':    case '[': case ']':    case '(': case ')':    case ';':    case ',':    case '*': case '%':    case '?': case ':':