A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

JavaScript - Stikked
From Sludgy Gibbon, 13 Years ago, written in JavaScript.
This paste is a reply to Codemirror test from Gracious Treeshrew - view diff
Embed
  1. // Demo code (the actual new parser character stream implementation)
  2.  
  3. function StringStream(string) {
  4.   this.pos = 0;
  5.   this.string = string;
  6. }
  7.  
  8. StringStream.prototype = {
  9.   done: function() {return this.pos >= this.string.length;},
  10.   peek: function() {return this.string.charAt(this.pos);},
  11.   next: function() {
  12.     if (this.pos < this.string.length)
  13.       return this.string.charAt(this.pos++);
  14.   },
  15.   eat: function(match) {
  16.     var ch = this.string.charAt(this.pos);
  17.     if (typeof match == "string") var ok = ch == match;
  18.     else var ok = ch && match.test ? match.test(ch) : match(ch);
  19.     if (ok) {this.pos++; return ch;}
  20.   },
  21.   eatWhile: function(match) {
  22.     var start = this.pos;
  23.     while (this.eat(match));
  24.     if (this.pos > start) return this.string.slice(start, this.pos);
  25.   },
  26.   backUp: function(n) {this.pos -= n;},
  27.   column: function() {return this.pos;},
  28.   eatSpace: function() {
  29.     var start = this.pos;
  30.     while (/\s/.test(this.string.charAt(this.pos))) this.pos++;
  31.     return this.pos - start;
  32.   },
  33.   match: function(pattern, consume, caseInsensitive) {
  34.     if (typeof pattern == "string") {
  35.       function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
  36.       if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
  37.         if (consume !== false) this.pos += str.length;
  38.         return true;
  39.       }
  40.     }
  41.     else {
  42.       var match = this.string.slice(this.pos).match(pattern);
  43.       if (match && consume !== false) this.pos += match[0].length;
  44.       return match;
  45.     }
  46.   }
  47. };
  48.