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.20 2002/06/07 14:17:38 nilsson Exp $ + // $Id: Pike.pmod,v 1.21 2002/06/28 17:30:19 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,    "%":1,    "*":1,    "*=":2,
pike.git/lib/modules/Parser.pmod/Pike.pmod:22:    "~":1,    "+=":2, "+":1,    "<<":2, "<=":2, "<":1,    ">>":2, ">=":2, ">":1,    "!=":2, "!":1,    "==":2, "=":1,    "()":2,    "->=":3, "->":2, "-":1,    "[]=":3, "[]":2 ]);    + //! Splits the @[data] string into an array of tokens. An additional + //! element with a newline will be added to the resulting array of + //! tokens. If the optional argument @[state] is provided the split + //! function is able to pause and resume splitting inside #"" and + //! /**/ tokens. The @[state] argument should be an initially empty + //! mapping, in which split will store its state between successive + //! calls.   array(string) split(string data, void|mapping state)   { -  int start; +     int line=1;    array(string) ret=({});    int pos;    data += "\n\0"; // End sentinel.       if(state && state->in_token) {    switch(state->remains[0..1]) {       case "/*":    pos = search(data, "*/");