<commit_before><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Code Prettifier</title>
<script src="../src/prettify.js" type="text/javascript"
 onerror="alert('Error: failed to load ' + this.src)"></script>
<link rel="stylesheet" type="text/css" href="../src/prettify.css" />
<style type="text/css">
.mismatch { background: #fee; }
</style>
</head>

<body onload="prettyPrint(); setTimeout(runTests, 1000/*ms*/)" bgcolor="white">
<div id="errorReport" style="white-space: pre"></div>

<h1>Bash</h1>
<pre class="prettyprint" id="bash">#!/bin/bash

# Fibonacci numbers
# Writes an infinite series to stdout, one entry per line
function fib() {
  local a=1
  local b=1
  while true ; do
    echo $a
    local tmp=$a
    a=$(( $a + $b ))
    b=$tmp
  done
}

# output the 10th element of the series and halt
fib | head -10 | tail -1
</pre>

<h1>C</h1>

<pre class="prettyprint" id="C">
#include &lt;stdio.h&gt;

/* the n-th fibonacci number.
 */
unsigned int fib(unsigned int n) {
  unsigned int a = 1, b = 1;
  unsigned int tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}

main() {
  printf("%u", fib(10));
}
</pre>

<h1>C++</h1>
<pre class="prettyprint" id="Cpp">
#include &lt;iostream&gt;

using namespace std;

//! fibonacci numbers with gratuitous use of templates.
//! \param n an index into the fibonacci series
//! \param fib0 element 0 of the series
//! \return the nth element of the fibonacci series
template &lt;class T>
T fib(unsigned int n, const T&amp; fib0) {
  T a(fib0), b(fib0);
  while (--n &gt;= 0) {
    T tmp(a);
    a += b;
    b = tmp;
  }
  return a;
}

int main(int argc, char **argv) {
  cout &lt;&lt; fib(10, 1U);
}
</pre>

<h1>Java</h1>
<pre class="prettyprint" id="java">
package foo;

import java.util.Iterator;

/**
 * the fibonacci series implemented as an Iterable.
 */
public final class Fibonacci implements Iterable&lt;Integer> {
  /** the next and previous members of the series. */
  private int a = 1, b = 1;

  public Iterator&lt;Integer> iterator() {
    return new Iterator&lt;Integer>() {
      /** the series is infinite. */
      public boolean hasNext() { return true; }
      public Integer next() {
        int tmp = a;
        a += b;
        b = tmp;
        return a;
      }
      public void remove() { throw new UnsupportedOperationException(); }
    };
  }

  /**
   * the n&lt;sup>th&lt;/sup> element of the given series.
   * @throws NoSuchElementException if there are less than n elements in the
   *   given Iterable's {@link Iterable#iterator iterator}.
   */
  public static &lt;T>
  T nth(int n, Iterable&lt;T> iterable) {
    Iterator&lt;? extends T> it = iterable.iterator();
    while (--n > 0) {
      it.next();
    }
    return it.next();
  }

  public static void main(String[] args) {
    System.out.print(nth(10, new Fibonacci()));
  }
}
</pre>

<h1>Javascript</h1>
<pre class="prettyprint" id="javascript">
/**
 * nth element in the fibonacci series.
 * @param n >= 0
 * @return the nth element, >= 0.
 */
function fib(n) {
  var a = 1, b = 1;
  var tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}

document.write(fib(10));
</pre>

<h1>Issue 12 - Javascript Regular Expressions</h1>
<pre class="prettyprint" id="issue12">
/foo/;  // a slash starting a line treated as a regexp beginning
"foo".match(/fo+$/);
// this line comment not treated as a regular expressions
"foo /bar/".test(/"baz"/);  // test string and regexp boundaries
var division = /\b\d+\/\d+/g;  // test char sets and escaping of specials
var allSpecials = /([^\(\)\[\]\{\}\-\?\+\*\.\^\$\/]+)\\/;

// test that slash used in numeric context treated as an operator
1 / 2;
1. / x;
x / y;
(x) / y;
1 /* foo */ / 2;
1 /* foo *// 2;
1/2;
1./x;
x/y;
(x)/y;

// test split over two lines.  line comment should not fool it
1//
/2;

x++/y;
x--/y;
x[y] / z;
f() / n;

// test that slash after non postfix operator is start of regexp
log('matches = ' + /foo/.test(foo));

// test keyword preceders
return /a regexp/;
division = notreturn / not_a_regexp / 2;  // keyword suffix does not match

// & not used as prefix operator in javascript but this should still work
&/foo/;
</pre>

<h1>Perl</h1>
<pre class="prettyprint" id="perl">
#!/usr/bin/perl

use strict;
use integer;

# the nth element of the fibonacci series
# param n - an int >= 0
# return an int >= 0
sub fib($) {
  my $n = shift, $a = 1, $b = 1;
  ($a, $b) = ($a + $b, $a) until (--$n < 0);
  return $a;
}

print fib(10);
</pre>

<h1>Python</h1>
<pre class="prettyprint" id="python">
#!/usr/bin/python2.4

def fib():
  '''
  a generator that produces the elements of the fibonacci series
  '''

  a = 1
  b = 1
  while True:
    a, b = a + b, a
    yield a

def nth(series, n):
  '''
  returns the nth element of a series,
  consuming the earlier elements of the series
  '''

  for x in series:
    n = n - 1
    if n <= 0: return x

print nth(fib(), 10)
</pre>

<h1>XML</h1>
<pre class="prettyprint" id="xml">
&lt;!DOCTYPE series PUBLIC "fibonacci numbers"&gt;

&lt;series base="1" step="s(n-2) + s(n-1)">
  &lt;element i="0"&gt;1&lt;/element&gt;
  &lt;element i="1"&gt;1&lt;/element&gt;
  &lt;element i="2"&gt;2&lt;/element&gt;
  &lt;element i="3"&gt;3&lt;/element&gt;
  &lt;element i="4"&gt;5&lt;/element&gt;
  &lt;element i="5"&gt;8&lt;/element&gt;
  ...
&lt;/series&gt;
</pre>

<h1>HTML</h1>
<pre class="prettyprint" id="html">
&lt;html&gt;
  &lt;head>
    &lt;title&gt;Fibonacci number&lt;/title&gt;
  &lt;/head&gt;
  &lt;body>
    &lt;noscript&gt;
      &lt;dl&gt;
        &lt;dt&gt;Fibonacci numbers&lt;/dt&gt;
        &lt;dd&gt;1&lt;/dd&gt;
        &lt;dd&gt;1&lt;/dd&gt;
        &lt;dd&gt;2&lt;/dd&gt;
        &lt;dd&gt;3&lt;/dd&gt;
        &lt;dd&gt;5&lt;/dd&gt;
        &lt;dd&gt;8&lt;/dd&gt;
        &amp;hellip;
      &lt;/dl&gt;
    &lt;/noscript&gt;

    &lt;script type="text/javascript">&lt;!--
function fib(n) {
  var a = 1, b = 1;
  var tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}

document.writeln(fib(10));
// --&gt;
    &lt;/script>
  &lt;/body&gt;
&lt;/html&gt;
</pre>


<h1>HTML using XMP</h1>
<xmp class="prettyprint" id="htmlXmp"
><html>
  <head>
    <title>Fibonacci number</title>
  </head>
  <body>
    <noscript>
      <dl>
        <dt>Fibonacci numbers</dt>
        <dd>1</dd>
        <dd>1</dd>
        <dd>2</dd>
        <dd>3</dd>
        <dd>5</dd>
        <dd>8</dd>
        &hellip;
      </dl>
    </noscript>

    <script type="text/javascript"><!--
function fib(n) {
  var a = 1, b = 1;
  var tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}

document.writeln(fib(10));
// -->
    </script>
  </body>
</html>
</xmp>

<h1>PHP</h1>
<pre class="prettyprint" id ="PHP">
&lt;html>
  &lt;head>
    &lt;title>&lt;?= 'Fibonacci numbers' ?>&lt;/title>

    &lt;?php
      // PHP has a plethora of comment types
      /* What is a
         "plethora"? */
      function fib($n) {
        # I don't know.
        $a = 1;
        $b = 1;
        while (--$n >= 0) {
          echo "$a\n";
          $tmp = $a;
          $a += $b;
          $b = $tmp;
        }
      }
    ?>
  &lt;/head>
  &lt;body>
    &lt;? fib(10); ?>
  &lt;/body>
&lt;/html>
</pre>

<h1>Whitespace</h1>
<pre class=prettyprint id="whitespace"></pre>

<h1>Misc</h1>
<pre class=prettyprint id="misc1">// ends with line comment token
//</pre>

<h1>User submitted testcase for Bug 4</h1>
<p>
Javascript Snippets wrapped in HTML SCRIPT tags hides/destroys inner content
</p>
<pre class=prettyprint id="issue4">
&lt;script type="text/javascript"&gt;
   var savedTarget=null;                           // The target layer (effectively vidPane)
   var orgCursor=null;                             // The original mouse style so we can restore it
   var dragOK=false;                               // True if we're allowed to move the element under mouse
   var dragXoffset=0;                              // How much we've moved the element on the horozontal
   var dragYoffset=0;                              // How much we've moved the element on the verticle
   vidPaneID = document.getElementById('vidPane'); // Our movable layer
   vidPaneID.style.top='75px';                     // Starting location horozontal
   vidPaneID.style.left='75px';                    // Starting location verticle
&lt;script&gt;
</pre>
<p>The fact that the script tag was not closed properly was causing
PR_splitSourceNodes to end without emitting the script contents.</p>

<h1>Bug 8 - tabs mangled</h1>
<p>If tabs are used to indent code inside &lt;pre> IE6 and 7 won't honor them
after the script runs.

Code indented with tabs will be shown aligned to the left margin instead of
the proper indenting shown in Firefox.

I'm using Revision 20 of prettify.js, IE 6.0.29.00 in English and IE
7.0.5730.11 in Spanish.
</p>
<pre class=prettyprint id="issue8">
<b>one</b>&#9;<b>Two</b>&#9;<b>three</b>&#9;Four&#9;<b>five</b>&#9;|
Six&#9;<b>seven</b>&#9;Eight&#9;nine&#9;Ten&#9;|
<b>eleven</b>&#9;Twelve&#9;<b>thirteen</b>&#9;Fourteen&#9;fifteen&#9;|
</pre>

<h1>Bug 14a - does not recognize <code>&lt;br&gt;</code> as newline</h1>
<pre class="prettyprint" id="issue14a"
>//comment<br />int main(int argc, char **argv)
{}</pre>

<h1>Bug 14b - comments not ignored</h1>
<pre class="prettyprint" id="issue14b"
>&lt;!-- There's an <!-- BOO!! --><acronym title="tag soup">HTML</acronym> comment in my comment --&gt;
&lt;p&gt;And another one inside the end tag&lt;/p<!-- GOTCHA!! -->&gt;
</pre>


</body>

<script type="text/javascript">
/**
 * maps ids of rewritten code to the expected output.
 * For brevity, <span class="foo"> has been changed to `FOO and close span tags
 * have been changed to `END.
 */
var goldens = {
  bash: (
      '`COM#!/bin/bash`END`PLN<br>' +
      '<br>' +
      '`END`COM# Fibonacci numbers`END`PLN<br>' +
      '`END`COM# Writes an infinite series to stdout, one entry per line`END' +
          '`PLN<br>' +
      '`END`KWDfunction`END`PLN fib`END`PUN()`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; local a`END`PUN=`END`LIT1`END`PLN<br>' +
      '&nbsp; local b`END`PUN=`END`LIT1`END`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`KWDtrue`END`PLN `END`PUN;`END' +
          '`PLN `END`KWDdo`END`PLN<br>' +
      '&nbsp; &nbsp; echo $a<br>' +
      '&nbsp; &nbsp; local tmp`END`PUN=`END`PLN$a<br>' +
      '&nbsp; &nbsp; a`END`PUN=`END`PLN$`END`PUN((`END`PLN $a `END`PUN+`END' +
          '`PLN $b `END`PUN))`END`PLN<br>' +
      '&nbsp; &nbsp; b`END`PUN=`END`PLN$tmp<br>' +
      '&nbsp; `END`KWDdone`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      '`END`COM# output the 10th element of the series and halt`END`PLN<br>' +
      'fib `END`PUN|`END`PLN head `END`PUN-`END`LIT10`END`PLN `END`PUN|`END' +
          '`PLN tail `END`PUN-`END`LIT1`END'),
  C: (
      '`COM#include &lt;stdio.h&gt;`END`PLN<br>' +
      '<br>' +
      '`END`COM/* the n-th fibonacci number.<br>' +
      '&nbsp;*\/`END`PLN<br>' +
      '`END`KWDunsigned`END`PLN `END`KWDint`END`PLN fib`END`PUN(`END' +
          '`KWDunsigned`END`PLN `END`KWDint`END`PLN n`END`PUN)`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; `END`KWDunsigned`END`PLN `END`KWDint`END`PLN a `END`PUN=`END' +
          '`PLN `END`LIT1`END`PUN,`END`PLN b `END`PUN=`END`PLN `END`LIT1`END' +
          '`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDunsigned`END`PLN `END`KWDint`END`PLN tmp`END`PUN;`END' +
          '`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +
          '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; a `END`PUN+=`END`PLN b`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; `END`KWDreturn`END`PLN a`END`PUN;`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      'main`END`PUN()`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; printf`END`PUN(`END`STR"%u"`END`PUN,`END`PLN fib`END`PUN(`END' +
          '`LIT10`END`PUN));`END`PLN<br>' +
      '`END`PUN}`END'),
  Cpp: (
      '`COM#include &lt;iostream&gt;`END`PLN<br>' +
      '<br>' +
      '`END`KWDusing`END`PLN `END`KWDnamespace`END`PLN std`END`PUN;`END' +
          '`PLN<br>' +
      '<br>' +
      '`END`COM//! fibonacci numbers with gratuitous use of templates.`END' +
          '`PLN<br>' +
      '`END`COM//! \\param n an index into the fibonacci series`END`PLN<br>' +
      '`END`COM//! \\param fib0 element 0 of the series`END`PLN<br>' +
      '`END`COM//! \\return the nth element of the fibonacci series`END' +
          '`PLN<br>' +
      '`END`KWDtemplate`END`PLN `END`PUN&lt;`END`KWDclass`END`PLN T`END' +
          '`PUN&gt;`END`PLN<br>' +
      'T fib`END`PUN(`END`KWDunsigned`END`PLN `END`KWDint`END`PLN n`END' +
          '`PUN,`END`PLN `END`KWDconst`END`PLN T`END`PUN&amp;`END`PLN fib0' +
          '`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; T a`END`PUN(`END`PLNfib0`END`PUN),`END`PLN b`END`PUN(`END' +
          '`PLNfib0`END`PUN);`END`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +
          '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; T tmp`END`PUN(`END`PLNa`END`PUN);`END`PLN<br>' +
      '&nbsp; &nbsp; a `END`PUN+=`END`PLN b`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; `END`KWDreturn`END`PLN a`END`PUN;`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      '`END`KWDint`END`PLN main`END`PUN(`END`KWDint`END`PLN argc`END' +
          '`PUN,`END`PLN `END`KWDchar`END`PLN `END`PUN**`END`PLNargv`END' +
          '`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; cout `END`PUN&lt;&lt;`END`PLN fib`END`PUN(`END`LIT10`END' +
          '`PUN,`END`PLN `END`LIT1U`END`PUN);`END`PLN<br>' +
      '`END`PUN}`END'),

  java: (
      '`KWDpackage`END`PLN foo`END`PUN;`END`PLN<br>' +
      '<br>' +
      '`END`KWDimport`END`PLN java`END`PUN.`END`PLNutil`END`PUN.`END' +
          '`TYPIterator`END`PUN;`END`PLN<br>' +
      '<br>' +
      '`END`COM/**<br>' +
      '&nbsp;* the fibonacci series implemented as an Iterable.<br>' +
      '&nbsp;*\/`END`PLN<br>' +
      '`END`KWDpublic`END`PLN `END`KWDfinal`END`PLN `END`KWDclass`END' +
          '`PLN `END`TYPFibonacci`END`PLN `END`KWDimplements`END`PLN `END' +
          '`TYPIterable`END`PUN&lt;`END`TYPInteger`END`PUN&gt;`END`PLN `END`' +
          'PUN{`END`PLN<br>' +
      '&nbsp; `END' +
          '`COM/** the next and previous members of the series. *\/`END' +
          '`PLN<br>' +
      '&nbsp; `END`KWDprivate`END`PLN `END`KWDint`END`PLN a `END`PUN=`END' +
          '`PLN `END`LIT1`END`PUN,`END`PLN b `END`PUN=`END`PLN `END`LIT1`END' +
          '`PUN;`END`PLN<br>' +
      '<br>' +
      '&nbsp; `END`KWDpublic`END`PLN `END`TYPIterator`END`PUN&lt;`END' +
          '`TYPInteger`END`PUN&gt;`END`PLN iterator`END`PUN()`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; `END`KWDreturn`END`PLN `END`KWDnew`END`PLN `END' +
          '`TYPIterator`END`PUN&lt;`END`TYPInteger`END`PUN&gt;()`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`COM/** the series is infinite. *\/`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`KWDpublic`END`PLN `END`KWDboolean`END' +
          '`PLN hasNext`END`PUN()`END`PLN `END`PUN{`END`PLN `END' +
          '`KWDreturn`END`PLN `END`KWDtrue`END`PUN;`END`PLN `END`PUN}`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`KWDpublic`END`PLN `END`TYPInteger`END' +
          '`PLN `END`KWDnext`END`PUN()`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`KWDint`END`PLN tmp `END`PUN=`END' +
          '`PLN a`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; a `END`PUN+=`END`PLN b`END`PUN;`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; b `END`PUN=`END`PLN tmp`END`PUN;`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`KWDreturn`END`PLN a`END`PUN;`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`KWDpublic`END`PLN `END`KWDvoid`END' +
          '`PLN remove`END`PUN()`END`PLN `END`PUN{`END`PLN `END`KWDthrow`END' +
          '`PLN `END`KWDnew`END`PLN `END' +
          '`TYPUnsupportedOperationException`END`PUN();`END`PLN `END' +
          '`PUN}`END`PLN<br>' +
      '&nbsp; &nbsp; `END`PUN};`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '<br>' +
      '&nbsp; `END`COM/**<br>' +
      '&nbsp; &nbsp;* the n&lt;sup&gt;th&lt;/sup&gt; element of the given ' +
          'series.<br>' +
      '&nbsp; &nbsp;* @throws NoSuchElementException if there are less than ' +
          'n elements in the<br>' +
      '&nbsp; &nbsp;* &nbsp; given Iterable\'s {@link Iterable#iterator ' +
          'iterator}.<br>' +
      '&nbsp; &nbsp;*\/`END`PLN<br>' +
      '&nbsp; `END`KWDpublic`END`PLN `END`KWDstatic`END`PLN `END' +
          '`PUN&lt;`END`PLNT`END`PUN&gt;`END`PLN<br>' +
      '&nbsp; T nth`END`PUN(`END`KWDint`END`PLN n`END`PUN,`END`PLN `END' +
          '`TYPIterable`END`PUN&lt;`END`PLNT`END`PUN&gt;`END' +
          '`PLN iterable`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TYPIterator`END`PUN&lt;?`END`PLN `END' +
          '`KWDextends`END`PLN T`END`PUN&gt;`END`PLN it `END`PUN=`END' +
          '`PLN iterable`END`PUN.`END`PLNiterator`END`PUN();`END`PLN<br>' +
      '&nbsp; &nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END' +
          '`PUN&gt;`END`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; it`END`PUN.`END`KWDnext`END`PUN();`END`PLN<br>' +
      '&nbsp; &nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; &nbsp; `END`KWDreturn`END`PLN it`END`PUN.`END`KWDnext`END' +
          '`PUN();`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '<br>' +
      '&nbsp; `END`KWDpublic`END`PLN `END`KWDstatic`END`PLN `END`KWDvoid`END' +
          '`PLN main`END`PUN(`END`TYPString`END`PUN[]`END`PLN args`END' +
          '`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TYPSystem`END`PUN.`END`KWDout`END`PUN.`END' +
          '`KWDprint`END`PUN(`END`PLNnth`END`PUN(`END`LIT10`END`PUN,`END' +
          '`PLN `END`KWDnew`END`PLN `END`TYPFibonacci`END`PUN()));`END' +
          '`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '`END`PUN}`END'),
  javascript: (
      '`COM/**<br>' +
      '&nbsp;* nth element in the fibonacci series.<br>' +
      '&nbsp;* @param n &gt;= 0<br>' +
      '&nbsp;* @return the nth element, &gt;= 0.<br>' +
      '&nbsp;*\/`END`PLN<br>' +
      '`END`KWDfunction`END`PLN fib`END`PUN(`END`PLNn`END`PUN)`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; `END`KWDvar`END`PLN a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END' +
          '`PLN b `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDvar`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +
          '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; a `END`PUN+=`END`PLN b`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; `END`KWDreturn`END`PLN a`END`PUN;`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      'document`END`PUN.`END`PLNwrite`END`PUN(`END`PLNfib`END`PUN(`END' +
          '`LIT10`END`PUN));`END'),
  perl: (
      '`COM#!/usr/bin/perl`END`PLN<br>' +
      '<br>' +
      '`END`KWDuse`END`PLN strict`END`PUN;`END`PLN<br>' +
      '`END`KWDuse`END`PLN integer`END`PUN;`END`PLN<br>' +
      '<br>' +
      '`END`COM# the nth element of the fibonacci series`END`PLN<br>' +
      '`END`COM# param n - an int &gt;= 0`END`PLN<br>' +
      '`END`COM# return an int &gt;= 0`END`PLN<br>' +
      '`END`KWDsub`END`PLN fib`END`PUN(`END`PLN$`END`PUN)`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; my $n `END`PUN=`END`PLN shift`END`PUN,`END`PLN ' +
      '$a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END`PLN $b `END' +
          '`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`PUN(`END`PLN$a`END`PUN,`END`PLN $b`END`PUN)`END' +
          '`PLN `END`PUN=`END`PLN `END`PUN(`END`PLN$a `END`PUN+`END' +
          '`PLN $b`END`PUN,`END`PLN $a`END`PUN)`END`PLN `END`KWDuntil`END' +
          '`PLN `END`PUN(--`END`PLN$n `END`PUN&lt;`END`PLN `END`LIT0`END' +
          '`PUN);`END`PLN<br>' +
      '&nbsp; `END`KWDreturn`END`PLN $a`END`PUN;`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      '`END`KWDprint`END`PLN fib`END`PUN(`END`LIT10`END`PUN);`END'),
  python: (
      '`COM#!/usr/bin/python2.4`END`PLN<br>' +
      '<br>' +
      '`END`KWDdef`END`PLN fib`END`PUN():`END`PLN<br>' +
      '&nbsp; `END`STR\'\'\'<br>' +
      '&nbsp; a generator that produces the elements of the fibonacci series' +
          '<br>' +
      '&nbsp; \'\'\'`END`PLN<br>' +
      '<br>' +
      '&nbsp; a `END`PUN=`END`PLN `END`LIT1`END`PLN<br>' +
      '&nbsp; b `END`PUN=`END`PLN `END`LIT1`END`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`KWDTrue`END`PUN:`END`PLN<br>' +
      '&nbsp; &nbsp; a`END`PUN,`END`PLN b `END`PUN=`END`PLN a `END`PUN+`END' +
          '`PLN b`END`PUN,`END`PLN a<br>' +
      '&nbsp; &nbsp; `END`KWDyield`END`PLN a<br>' +
      '<br>' +
      '`END`KWDdef`END`PLN nth`END`PUN(`END`PLNseries`END`PUN,`END`PLN n`END' +
          '`PUN):`END`PLN<br>' +
      '&nbsp; `END`STR\'\'\'<br>' +
      '&nbsp; returns the nth element of a series,<br>' +
      '&nbsp; consuming the earlier elements of the series<br>' +
      '&nbsp; \'\'\'`END`PLN<br>' +
      '<br>' +
      '&nbsp; `END`KWDfor`END`PLN x `END`KWDin`END`PLN series`END`PUN:`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; n `END`PUN=`END`PLN n `END`PUN-`END`PLN `END`LIT1`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; `END`KWDif`END`PLN n `END`PUN&lt;=`END`PLN `END' +
          '`LIT0`END`PUN:`END`PLN `END`KWDreturn`END`PLN x<br>' +
      '<br>' +
      '`END`KWDprint`END`PLN nth`END`PUN(`END`PLNfib`END`PUN(),`END`PLN `END' +
          '`LIT10`END`PUN)`END'),
  xml: (
      '`DEC&lt;!DOCTYPE series PUBLIC "fibonacci numbers"&gt;`END`PLN<br>' +
      '<br>' +
      '`END`TAG&lt;series `END`ATNbase`END`TAG=`END`ATV"1"`END`TAG `END' +
          '`ATNstep`END`TAG=`END`ATV"s(n-2) + s(n-1)"`END`TAG&gt;`END' +
          '`PLN<br>' +
      '&nbsp; `END`TAG&lt;element `END`ATNi`END`TAG=`END`ATV"0"`END' +
          '`TAG&gt;`END`PLN1`END`TAG&lt;/element&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;element `END`ATNi`END`TAG=`END`ATV"1"`END' +
          '`TAG&gt;`END`PLN1`END`TAG&lt;/element&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;element `END`ATNi`END`TAG=`END`ATV"2"`END' +
          '`TAG&gt;`END`PLN2`END`TAG&lt;/element&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;element `END`ATNi`END`TAG=`END`ATV"3"`END' +
          '`TAG&gt;`END`PLN3`END`TAG&lt;/element&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;element `END`ATNi`END`TAG=`END`ATV"4"`END' +
          '`TAG&gt;`END`PLN5`END`TAG&lt;/element&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;element `END`ATNi`END`TAG=`END`ATV"5"`END' +
          '`TAG&gt;`END`PLN8`END`TAG&lt;/element&gt;`END`PLN<br>' +
      '&nbsp; ...<br>' +
      '`END`TAG&lt;/series&gt;`END'),
  html: (
      '`TAG&lt;html&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;head&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;title&gt;`END`PLNFibonacci number`END' +
          '`TAG&lt;/title&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;/head&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;body&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;noscript&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`TAG&lt;dl&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dt&gt;`END' +
          '`PLNFibonacci numbers`END`TAG&lt;/dt&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN1`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN1`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN2`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN3`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN5`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN8`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &amp;hellip;<br>' +
      '&nbsp; &nbsp; &nbsp; `END`TAG&lt;/dl&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;/noscript&gt;`END`PLN<br>' +
      '<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;script `END`ATNtype`END`TAG=`END' +
          '`ATV"text/javascript"`END`TAG&gt;`END' +
          '<span class="embsrc">`PUN&lt;!--`END`PLN<br>' +
      '`END`KWDfunction`END`PLN fib`END`PUN(`END`PLNn`END`PUN)`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; `END`KWDvar`END`PLN a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END' +
          '`PLN b `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDvar`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +
          '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; a `END`PUN+=`END`PLN b`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; `END`KWDreturn`END`PLN a`END`PUN;`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      'document`END`PUN.`END`PLNwriteln`END`PUN(`END`PLNfib`END`PUN(`END' +
          '`LIT10`END`PUN));`END`PLN<br>' +
      '`END`COM// --&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`END`TAG&lt;/script&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;/body&gt;`END`PLN<br>' +
      '`END`TAG&lt;/html&gt;`END'),
  htmlXmp: (
      '`TAG&lt;html&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;head&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;title&gt;`END`PLNFibonacci number`END' +
          '`TAG&lt;/title&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;/head&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;body&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;noscript&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`TAG&lt;dl&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dt&gt;`END' +
          '`PLNFibonacci numbers`END`TAG&lt;/dt&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN1`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN1`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN2`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN3`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN5`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN8`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &amp;hellip;<br>' +
      '&nbsp; &nbsp; &nbsp; `END`TAG&lt;/dl&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;/noscript&gt;`END`PLN<br>' +
      '<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;script `END`ATNtype`END`TAG=`END' +
          '`ATV"text/javascript"`END`TAG&gt;`END' +
          '<span class="embsrc">`PUN&lt;!--`END`PLN<br>' +
      '`END`KWDfunction`END`PLN fib`END`PUN(`END`PLNn`END`PUN)`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; `END`KWDvar`END`PLN a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END' +
          '`PLN b `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDvar`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +
          '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; a `END`PUN+=`END`PLN b`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; `END`KWDreturn`END`PLN a`END`PUN;`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      'document`END`PUN.`END`PLNwriteln`END`PUN(`END`PLNfib`END`PUN(`END' +
          '`LIT10`END`PUN));`END`PLN<br>' +
      '`END`COM// --&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`END`TAG&lt;/script&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;/body&gt;`END`PLN<br>' +
      '`END`TAG&lt;/html&gt;`END'),
  PHP: (
      '`TAG&lt;html&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;head&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;title&gt;&lt;?`END' +
          '<span class="embsrc">`PUN=`END`PLN `END' +
          '`STR\'Fibonacci numbers\'`END`PLN `END`END' +
          '`TAG?&gt;&lt;/title&gt;`END`PLN<br>' +
      '<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;?`END<span class="embsrc">`PLNphp<br>' +
      '&nbsp; &nbsp; &nbsp; `END`COM// PHP has a plethora of comment types' +
          '`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`COM\/* What is a<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"plethora"? *\/`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`KWDfunction`END`PLN fib`END`PUN(`END' +
          '`PLN$n`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`COM# I don\'t know.`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; $a `END`PUN=`END`PLN `END`LIT1`END' +
          '`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; $b `END`PUN=`END`PLN `END`LIT1`END' +
          '`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END' +
          '`PLN$n `END`PUN&gt;=`END`PLN `END`LIT0`END`PUN)`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo `END`STR"$a\\n"`END`PUN;`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tmp `END`PUN=`END`PLN $a`END' +
          '`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $a `END`PUN+=`END`PLN $b`END' +
          '`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $b `END`PUN=`END`PLN $tmp`END' +
          '`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; &nbsp; `END`END`TAG?&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;/head&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;body&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;?`END<span class="embsrc">`PLN fib`END' +
          '`PUN(`END`LIT10`END`PUN);`END`PLN `END`END`TAG?&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;/body&gt;`END`PLN<br>' +
      '`END`TAG&lt;/html&gt;`END'),
  whitespace: '',
  misc1: '`COM// ends with line comment token`END`PLN<br>' +
      '`END`COM//`END',
  issue4: (
      '`TAG&lt;script `END`ATNtype`END`TAG=`END`ATV"text/javascript"`END' +
          '`TAG&gt;`END<span class="embsrc">`PLN<br>' +
      '&nbsp; &nbsp;`END`KWDvar`END`PLN savedTarget`END`PUN=`END`KWDnull`END' +
          '`PUN;`END`PLN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `END`COM// The target ' +
          'layer (effectively vidPane)`END`PLN<br>' +
      '&nbsp; &nbsp;`END`KWDvar`END`PLN orgCursor`END`PUN=`END`KWDnull`END' +
          '`PUN;`END`PLN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `END`COM// The ' +
          'original mouse style so we can restore it`END`PLN<br>' +
      '&nbsp; &nbsp;`END`KWDvar`END`PLN dragOK`END`PUN=`END`KWDfalse`END' +
          '`PUN;`END`PLN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `END' +
          '`COM// True if we\'re allowed to move the element under mouse' +
          '`END`PLN<br>' +
      '&nbsp; &nbsp;`END`KWDvar`END`PLN dragXoffset`END`PUN=`END`LIT0`END' +
          '`PUN;`END`PLN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;`END' +
          '`COM// How much we\'ve moved the element on the horozontal`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp;`END`KWDvar`END`PLN dragYoffset`END`PUN=`END`LIT0`END' +
          '`PUN;`END`PLN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;`END' +
          '`COM// How much we\'ve moved the element on the verticle`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp;vidPaneID `END`PUN=`END`PLN document`END`PUN.`END' +
          '`PLNgetElementById`END`PUN(`END`STR\'vidPane\'`END`PUN);`END' +
          '`PLN `END`COM// Our movable layer`END`PLN<br>' +
      '&nbsp; &nbsp;vidPaneID`END`PUN.`END`PLNstyle`END`PUN.`END`PLNtop`END' +
          '`PUN=`END`STR\'75px\'`END`PUN;`END`PLN &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `END`COM// ' +
          'Starting location horozontal`END`PLN<br>' +
      '&nbsp; &nbsp;vidPaneID`END`PUN.`END`PLNstyle`END`PUN.`END`PLNleft`END' +
          '`PUN=`END`STR\'75px\'`END`PUN;`END`PLN &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;`END`COM// ' +
          'Starting location verticle`END`PLN<br>' +
      '`END`PUN&lt;`END`PLNscript`END`PUN&gt;`END</span>'),
  issue8: (
      '<b>`PLNone`END</b>`PLN &nbsp; &nbsp; `END<b>`TYPTwo`END</b>`PLN' +
          ' &nbsp; &nbsp; `END<b>`PLNthree`END</b>`PLN &nbsp; `END`TYPFour' +
          '`END`PLN &nbsp; &nbsp;`END<b>`PLNfive`END</b>`PLN &nbsp; &nbsp;' +
          '`END`PUN|`END`PLN<br>' +
      '`END`TYPSix`END`PLN &nbsp; &nbsp; `END<b>`PLNseven`END</b>`PLN &nbsp; ' +
          '`END`TYPEight`END`PLN &nbsp; nine &nbsp; &nbsp;`END`TYPTen`END' +
          '`PLN &nbsp; &nbsp; `END`PUN|`END`PLN<br>' +
      '`END<b>`PLNeleven`END</b>`PLN &nbsp;`END`TYPTwelve`END`PLN &nbsp;`END' +
          '<b>`PLNthirteen`END</b>`PLN &nbsp; &nbsp; &nbsp; &nbsp;`END' +
          '`TYPFourteen`END`PLN &nbsp; &nbsp; &nbsp; &nbsp;fifteen `END`' +
          'PUN|`END'),
  issue12: (
      '`STR/foo/`END`PUN;`END`PLN &nbsp;`END`COM// a slash starting a line ' +
          'treated as a regexp beginning`END`PLN<br>' +
      '`END`STR"foo"`END`PUN.`END`PLNmatch`END`PUN(`END`STR/fo+$/`END' +
          '`PUN);`END`PLN<br>' +
      '`END`COM// this line comment not treated as a regular expressions`END' +
          '`PLN<br>' +
      '`END`STR"foo /bar/"`END`PUN.`END`PLNtest`END`PUN(`END`STR/"baz"/`END' +
          '`PUN);`END`PLN &nbsp;`END`COM// test string and regexp boundaries' +
          '`END`PLN<br>' +
      '`END`KWDvar`END`PLN division `END`PUN=`END`PLN `END' +
          '`STR/\\b\\d+\\/\\d+/`END`PLNg`END`PUN;`END`PLN &nbsp;`END' +
          '`COM// test char sets and escaping of specials`END`PLN<br>' +
      '`END`KWDvar`END`PLN allSpecials `END`PUN=`END`PLN `END' +
          '`STR/([^\\(\\)\\[\\]\\{\\}\\-\\?\\+\\*\\.\\^\\$\\/]+)\\\\/`END' +
          '`PUN;`END`PLN<br>' +
      '<br>' +
      '`END`COM// test that slash used in numeric context treated as an ' +
          'operator`END`PLN<br>' +
      '`END`LIT1`END`PLN `END`PUN/`END`PLN `END`LIT2`END`PUN;`END`PLN<br>' +
      '`END`LIT1`END`PUN.`END`PLN `END`PUN/`END`PLN x`END`PUN;`END`PLN<br>' +
      'x `END`PUN/`END`PLN y`END`PUN;`END`PLN<br>' +
      '`END`PUN(`END`PLNx`END`PUN)`END`PLN `END`PUN/`END`PLN y`END`PUN;`END' +
          '`PLN<br>' +
      '`END`LIT1`END`PLN `END`COM/* foo */`END`PLN `END`PUN/`END`PLN `END' +
          '`LIT2`END`PUN;`END`PLN<br>' +
      '`END`LIT1`END`PLN `END`COM/* foo */`END`PUN/`END`PLN `END`LIT2`END' +
          '`PUN;`END`PLN<br>' +
      '`END`LIT1`END`PUN/`END`LIT2`END`PUN;`END`PLN<br>' +
      '`END`LIT1`END`PUN./`END`PLNx`END`PUN;`END`PLN<br>' +
      'x`END`PUN/`END`PLNy`END`PUN;`END`PLN<br>' +
      '`END`PUN(`END`PLNx`END`PUN)/`END`PLNy`END`PUN;`END`PLN<br>' +
      '<br>' +
      '`END`COM// test split over two lines. &nbsp;line comment should not ' +
          'fool it`END`PLN<br>' +
      '`END`LIT1`END`COM//`END`PLN<br>' +
      '`END`PUN/`END`LIT2`END`PUN;`END`PLN<br>' +
      '<br>' +
      'x`END`PUN++/`END`PLNy`END`PUN;`END`PLN<br>' +
      'x`END`PUN--/`END`PLNy`END`PUN;`END`PLN<br>' +
      'x`END`PUN[`END`PLNy`END`PUN]`END`PLN `END`PUN/`END`PLN z`END`PUN;`END' +
          '`PLN<br>' +
      'f`END`PUN()`END`PLN `END`PUN/`END`PLN n`END`PUN;`END`PLN<br>' +
      '<br>' +
      '`END`COM// test that slash after non postfix operator is start of ' +
          'regexp`END`PLN<br>' +
      'log`END`PUN(`END`STR\'matches = \'`END`PLN `END`PUN+`END`PLN `END' +
          '`STR/foo/`END`PUN.`END`PLNtest`END`PUN(`END`PLNfoo`END`PUN));`END' +
          '`PLN<br>' +
      '<br>' +
      '`END`COM// test keyword preceders`END`PLN<br>' +
      '`END`KWDreturn`END`PLN `END`STR/a regexp/`END`PUN;`END`PLN<br>' +
      'division `END`PUN=`END`PLN notreturn `END`PUN/`END`PLN not_a_regexp ' +
          '`END`PUN/`END`PLN `END`LIT2`END`PUN;`END`PLN &nbsp;`END`COM// ' +
          'keyword suffix does not match`END`PLN<br>' +
      '<br>' +
      '`END`COM// &amp; not used as prefix operator in javascript but this ' +
          'should still work`END`PLN<br>' +
      '`END`PUN&amp;`END`STR/foo/`END`PUN;`END'),
  issue14a: (
      '`COM//comment`END`PLN<br>' +
      '`END`KWDint`END`PLN main`END`PUN(`END`KWDint`END`PLN argc`END`PUN,`END' +
          '`PLN `END`KWDchar`END`PLN `END`PUN**`END`PLNargv`END`PUN)`END' +
          '`PLN<br>' +
      '`END`PUN{}`END'),
  issue14b: (
      '`COM&lt;!-- There\'s an `END<acronym title="tag soup">`COMHTML`END' +
           '</acronym>`COM comment in my comment --&gt;`END`PLN<br>' +
      '`END`TAG&lt;p&gt;`END`PLNAnd another one inside the end tag`END' +
      '`TAG&lt;/p&gt;`END')
};


function runTests() {
  /** number of characters in common at the end up to max. */
  function commonPrefix(a, b) {
    var n = Math.min(a.length, b.length);
    var i;
    for (i = 0; i < n; ++i) {
      if (a.charAt(i) !== b.charAt(i)) { break; }
    }
    return i;
  }

  /** number of characters in common at the end up to max. */
  function commonSuffix(a, b, max) {
    var n = Math.min(a.length - max, b.length - max);
    var i;
    for (i = 0; i < n; ++i) {
      if (a.charAt(a.length - i - 1) !== b.charAt(b.length - i - 1)) { break; }
    }
    return i;
  }

  /** convert a plain text string to html by escaping html special chars. */
  function html(plainText) {
    return plainText.replace(/\046/g, '&amp;')
        .replace(/\074/g, '&lt;')
        .replace(/\076/g, '&gt;')
        .replace(/\042/g, '&quot;')
        .replace(/\xa0/g, '&nbsp;');
  }

  /**
   * get normalized markup.  innerHTML varies enough across browsers that we
   * can't use it.
   */
  function normalizedInnerHtml(node, opt_out) {
    var out = [];
    for (var child = node.firstChild; child; child = child.nextSibling) {
      PR_normalizedHtml(child, out);
    }
    out = out.join('');
    // more normalization to work around problems with non-ascii chars in
    // regexps in Safari
    for (var i = 0; (i = out.indexOf('\xa0')) >= 0;) {
      out = out.substring(0, i) + '&nbsp;' + out.substring(i + 1);
    }
    return out;
  }

  var htmlOut = [];
  var failures = 0;
  document.getElementById('errorReport').innerHTML =
      '<h1>Running tests&hellip;<\/h1>';
  htmlOut.push('<h1>Test results<\/h1>');
  for (var lang in goldens) {
    var golden = goldens[lang].replace(/`([A-Z]{3})/g, function (_, lbl) {
        return (lbl == 'END'
            ? '<\/span>'
            : '<span class="' + lbl.toLowerCase() + '">');
      });
    var actual = normalizedInnerHtml(document.getElementById(lang));
    if (golden !== actual) {  // test failed
      // write out
      var pre = commonPrefix(golden, actual);
      var post = commonSuffix(golden, actual, pre);

      ++failures;
      htmlOut.push('<h2>' + html(lang) + ' Failed<\/h1>');
      htmlOut.push(
          '<tt>' + html(golden.substring(0, pre)) +
          '&raquo;<span class="mismatch">' +
          html(golden.substring(pre, golden.length - post)) +
          '<\/span>&laquo;' +
          html(golden.substring(golden.length - post)) +

          '<br>!==<br>' +

          html(actual.substring(0, pre)) +
          '&raquo;<span class="mismatch">' +
          html(actual.substring(pre, actual.length - post)) +
          '<\/span>&laquo;' +
          html(actual.substring(actual.length - post)) + '<\/tt>');
    } else {
      htmlOut.push('<h2>' + html(lang) + ' OK<\/h1>');
    }
  }
  htmlOut.push('<h2>' + (failures ? (failures + ' test(s) failed') : 'Pass') +
               '<\/h2>');
  document.getElementById('errorReport').innerHTML =
      htmlOut.join('').replace(/&lt;br&gt;/g, '&lt;br&gt;\n');
}
</script>

</html>
<commit_msg>Increase timeout before running tests.  As I add more tests, IE under vmware runs out of time to finish prettifying.  I should just speed things up.<commit_after><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Code Prettifier</title>
<script src="../src/prettify.js" type="text/javascript"
 onerror="alert('Error: failed to load ' + this.src)"></script>
<link rel="stylesheet" type="text/css" href="../src/prettify.css" />
<style type="text/css">
.mismatch { background: #fee; }
</style>
</head>

<body onload="prettyPrint(); setTimeout(runTests, 2000/*ms*/)" bgcolor="white">
<div id="errorReport" style="white-space: pre"></div>

<h1>Bash</h1>
<pre class="prettyprint" id="bash">#!/bin/bash

# Fibonacci numbers
# Writes an infinite series to stdout, one entry per line
function fib() {
  local a=1
  local b=1
  while true ; do
    echo $a
    local tmp=$a
    a=$(( $a + $b ))
    b=$tmp
  done
}

# output the 10th element of the series and halt
fib | head -10 | tail -1
</pre>

<h1>C</h1>

<pre class="prettyprint" id="C">
#include &lt;stdio.h&gt;

/* the n-th fibonacci number.
 */
unsigned int fib(unsigned int n) {
  unsigned int a = 1, b = 1;
  unsigned int tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}

main() {
  printf("%u", fib(10));
}
</pre>

<h1>C++</h1>
<pre class="prettyprint" id="Cpp">
#include &lt;iostream&gt;

using namespace std;

//! fibonacci numbers with gratuitous use of templates.
//! \param n an index into the fibonacci series
//! \param fib0 element 0 of the series
//! \return the nth element of the fibonacci series
template &lt;class T>
T fib(unsigned int n, const T&amp; fib0) {
  T a(fib0), b(fib0);
  while (--n &gt;= 0) {
    T tmp(a);
    a += b;
    b = tmp;
  }
  return a;
}

int main(int argc, char **argv) {
  cout &lt;&lt; fib(10, 1U);
}
</pre>

<h1>Java</h1>
<pre class="prettyprint" id="java">
package foo;

import java.util.Iterator;

/**
 * the fibonacci series implemented as an Iterable.
 */
public final class Fibonacci implements Iterable&lt;Integer> {
  /** the next and previous members of the series. */
  private int a = 1, b = 1;

  public Iterator&lt;Integer> iterator() {
    return new Iterator&lt;Integer>() {
      /** the series is infinite. */
      public boolean hasNext() { return true; }
      public Integer next() {
        int tmp = a;
        a += b;
        b = tmp;
        return a;
      }
      public void remove() { throw new UnsupportedOperationException(); }
    };
  }

  /**
   * the n&lt;sup>th&lt;/sup> element of the given series.
   * @throws NoSuchElementException if there are less than n elements in the
   *   given Iterable's {@link Iterable#iterator iterator}.
   */
  public static &lt;T>
  T nth(int n, Iterable&lt;T> iterable) {
    Iterator&lt;? extends T> it = iterable.iterator();
    while (--n > 0) {
      it.next();
    }
    return it.next();
  }

  public static void main(String[] args) {
    System.out.print(nth(10, new Fibonacci()));
  }
}
</pre>

<h1>Javascript</h1>
<pre class="prettyprint" id="javascript">
/**
 * nth element in the fibonacci series.
 * @param n >= 0
 * @return the nth element, >= 0.
 */
function fib(n) {
  var a = 1, b = 1;
  var tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}

document.write(fib(10));
</pre>

<h1>Issue 12 - Javascript Regular Expressions</h1>
<pre class="prettyprint" id="issue12">
/foo/;  // a slash starting a line treated as a regexp beginning
"foo".match(/fo+$/);
// this line comment not treated as a regular expressions
"foo /bar/".test(/"baz"/);  // test string and regexp boundaries
var division = /\b\d+\/\d+/g;  // test char sets and escaping of specials
var allSpecials = /([^\(\)\[\]\{\}\-\?\+\*\.\^\$\/]+)\\/;

// test that slash used in numeric context treated as an operator
1 / 2;
1. / x;
x / y;
(x) / y;
1 /* foo */ / 2;
1 /* foo *// 2;
1/2;
1./x;
x/y;
(x)/y;

// test split over two lines.  line comment should not fool it
1//
/2;

x++/y;
x--/y;
x[y] / z;
f() / n;

// test that slash after non postfix operator is start of regexp
log('matches = ' + /foo/.test(foo));

// test keyword preceders
return /a regexp/;
division = notreturn / not_a_regexp / 2;  // keyword suffix does not match

// & not used as prefix operator in javascript but this should still work
&/foo/;
</pre>

<h1>Perl</h1>
<pre class="prettyprint" id="perl">
#!/usr/bin/perl

use strict;
use integer;

# the nth element of the fibonacci series
# param n - an int >= 0
# return an int >= 0
sub fib($) {
  my $n = shift, $a = 1, $b = 1;
  ($a, $b) = ($a + $b, $a) until (--$n < 0);
  return $a;
}

print fib(10);
</pre>

<h1>Python</h1>
<pre class="prettyprint" id="python">
#!/usr/bin/python2.4

def fib():
  '''
  a generator that produces the elements of the fibonacci series
  '''

  a = 1
  b = 1
  while True:
    a, b = a + b, a
    yield a

def nth(series, n):
  '''
  returns the nth element of a series,
  consuming the earlier elements of the series
  '''

  for x in series:
    n = n - 1
    if n <= 0: return x

print nth(fib(), 10)
</pre>

<h1>XML</h1>
<pre class="prettyprint" id="xml">
&lt;!DOCTYPE series PUBLIC "fibonacci numbers"&gt;

&lt;series base="1" step="s(n-2) + s(n-1)">
  &lt;element i="0"&gt;1&lt;/element&gt;
  &lt;element i="1"&gt;1&lt;/element&gt;
  &lt;element i="2"&gt;2&lt;/element&gt;
  &lt;element i="3"&gt;3&lt;/element&gt;
  &lt;element i="4"&gt;5&lt;/element&gt;
  &lt;element i="5"&gt;8&lt;/element&gt;
  ...
&lt;/series&gt;
</pre>

<h1>HTML</h1>
<pre class="prettyprint" id="html">
&lt;html&gt;
  &lt;head>
    &lt;title&gt;Fibonacci number&lt;/title&gt;
  &lt;/head&gt;
  &lt;body>
    &lt;noscript&gt;
      &lt;dl&gt;
        &lt;dt&gt;Fibonacci numbers&lt;/dt&gt;
        &lt;dd&gt;1&lt;/dd&gt;
        &lt;dd&gt;1&lt;/dd&gt;
        &lt;dd&gt;2&lt;/dd&gt;
        &lt;dd&gt;3&lt;/dd&gt;
        &lt;dd&gt;5&lt;/dd&gt;
        &lt;dd&gt;8&lt;/dd&gt;
        &amp;hellip;
      &lt;/dl&gt;
    &lt;/noscript&gt;

    &lt;script type="text/javascript">&lt;!--
function fib(n) {
  var a = 1, b = 1;
  var tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}

document.writeln(fib(10));
// --&gt;
    &lt;/script>
  &lt;/body&gt;
&lt;/html&gt;
</pre>


<h1>HTML using XMP</h1>
<xmp class="prettyprint" id="htmlXmp"
><html>
  <head>
    <title>Fibonacci number</title>
  </head>
  <body>
    <noscript>
      <dl>
        <dt>Fibonacci numbers</dt>
        <dd>1</dd>
        <dd>1</dd>
        <dd>2</dd>
        <dd>3</dd>
        <dd>5</dd>
        <dd>8</dd>
        &hellip;
      </dl>
    </noscript>

    <script type="text/javascript"><!--
function fib(n) {
  var a = 1, b = 1;
  var tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}

document.writeln(fib(10));
// -->
    </script>
  </body>
</html>
</xmp>

<h1>PHP</h1>
<pre class="prettyprint" id ="PHP">
&lt;html>
  &lt;head>
    &lt;title>&lt;?= 'Fibonacci numbers' ?>&lt;/title>

    &lt;?php
      // PHP has a plethora of comment types
      /* What is a
         "plethora"? */
      function fib($n) {
        # I don't know.
        $a = 1;
        $b = 1;
        while (--$n >= 0) {
          echo "$a\n";
          $tmp = $a;
          $a += $b;
          $b = $tmp;
        }
      }
    ?>
  &lt;/head>
  &lt;body>
    &lt;? fib(10); ?>
  &lt;/body>
&lt;/html>
</pre>

<h1>Whitespace</h1>
<pre class=prettyprint id="whitespace"></pre>

<h1>Misc</h1>
<pre class=prettyprint id="misc1">// ends with line comment token
//</pre>

<h1>User submitted testcase for Bug 4</h1>
<p>
Javascript Snippets wrapped in HTML SCRIPT tags hides/destroys inner content
</p>
<pre class=prettyprint id="issue4">
&lt;script type="text/javascript"&gt;
   var savedTarget=null;                           // The target layer (effectively vidPane)
   var orgCursor=null;                             // The original mouse style so we can restore it
   var dragOK=false;                               // True if we're allowed to move the element under mouse
   var dragXoffset=0;                              // How much we've moved the element on the horozontal
   var dragYoffset=0;                              // How much we've moved the element on the verticle
   vidPaneID = document.getElementById('vidPane'); // Our movable layer
   vidPaneID.style.top='75px';                     // Starting location horozontal
   vidPaneID.style.left='75px';                    // Starting location verticle
&lt;script&gt;
</pre>
<p>The fact that the script tag was not closed properly was causing
PR_splitSourceNodes to end without emitting the script contents.</p>

<h1>Bug 8 - tabs mangled</h1>
<p>If tabs are used to indent code inside &lt;pre> IE6 and 7 won't honor them
after the script runs.

Code indented with tabs will be shown aligned to the left margin instead of
the proper indenting shown in Firefox.

I'm using Revision 20 of prettify.js, IE 6.0.29.00 in English and IE
7.0.5730.11 in Spanish.
</p>
<pre class=prettyprint id="issue8">
<b>one</b>&#9;<b>Two</b>&#9;<b>three</b>&#9;Four&#9;<b>five</b>&#9;|
Six&#9;<b>seven</b>&#9;Eight&#9;nine&#9;Ten&#9;|
<b>eleven</b>&#9;Twelve&#9;<b>thirteen</b>&#9;Fourteen&#9;fifteen&#9;|
</pre>

<h1>Bug 14a - does not recognize <code>&lt;br&gt;</code> as newline</h1>
<pre class="prettyprint" id="issue14a"
>//comment<br />int main(int argc, char **argv)
{}</pre>

<h1>Bug 14b - comments not ignored</h1>
<pre class="prettyprint" id="issue14b"
>&lt;!-- There's an <!-- BOO!! --><acronym title="tag soup">HTML</acronym> comment in my comment --&gt;
&lt;p&gt;And another one inside the end tag&lt;/p<!-- GOTCHA!! -->&gt;
</pre>


</body>

<script type="text/javascript">
/**
 * maps ids of rewritten code to the expected output.
 * For brevity, <span class="foo"> has been changed to `FOO and close span tags
 * have been changed to `END.
 */
var goldens = {
  bash: (
      '`COM#!/bin/bash`END`PLN<br>' +
      '<br>' +
      '`END`COM# Fibonacci numbers`END`PLN<br>' +
      '`END`COM# Writes an infinite series to stdout, one entry per line`END' +
          '`PLN<br>' +
      '`END`KWDfunction`END`PLN fib`END`PUN()`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; local a`END`PUN=`END`LIT1`END`PLN<br>' +
      '&nbsp; local b`END`PUN=`END`LIT1`END`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`KWDtrue`END`PLN `END`PUN;`END' +
          '`PLN `END`KWDdo`END`PLN<br>' +
      '&nbsp; &nbsp; echo $a<br>' +
      '&nbsp; &nbsp; local tmp`END`PUN=`END`PLN$a<br>' +
      '&nbsp; &nbsp; a`END`PUN=`END`PLN$`END`PUN((`END`PLN $a `END`PUN+`END' +
          '`PLN $b `END`PUN))`END`PLN<br>' +
      '&nbsp; &nbsp; b`END`PUN=`END`PLN$tmp<br>' +
      '&nbsp; `END`KWDdone`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      '`END`COM# output the 10th element of the series and halt`END`PLN<br>' +
      'fib `END`PUN|`END`PLN head `END`PUN-`END`LIT10`END`PLN `END`PUN|`END' +
          '`PLN tail `END`PUN-`END`LIT1`END'),
  C: (
      '`COM#include &lt;stdio.h&gt;`END`PLN<br>' +
      '<br>' +
      '`END`COM/* the n-th fibonacci number.<br>' +
      '&nbsp;*\/`END`PLN<br>' +
      '`END`KWDunsigned`END`PLN `END`KWDint`END`PLN fib`END`PUN(`END' +
          '`KWDunsigned`END`PLN `END`KWDint`END`PLN n`END`PUN)`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; `END`KWDunsigned`END`PLN `END`KWDint`END`PLN a `END`PUN=`END' +
          '`PLN `END`LIT1`END`PUN,`END`PLN b `END`PUN=`END`PLN `END`LIT1`END' +
          '`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDunsigned`END`PLN `END`KWDint`END`PLN tmp`END`PUN;`END' +
          '`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +
          '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; a `END`PUN+=`END`PLN b`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; `END`KWDreturn`END`PLN a`END`PUN;`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      'main`END`PUN()`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; printf`END`PUN(`END`STR"%u"`END`PUN,`END`PLN fib`END`PUN(`END' +
          '`LIT10`END`PUN));`END`PLN<br>' +
      '`END`PUN}`END'),
  Cpp: (
      '`COM#include &lt;iostream&gt;`END`PLN<br>' +
      '<br>' +
      '`END`KWDusing`END`PLN `END`KWDnamespace`END`PLN std`END`PUN;`END' +
          '`PLN<br>' +
      '<br>' +
      '`END`COM//! fibonacci numbers with gratuitous use of templates.`END' +
          '`PLN<br>' +
      '`END`COM//! \\param n an index into the fibonacci series`END`PLN<br>' +
      '`END`COM//! \\param fib0 element 0 of the series`END`PLN<br>' +
      '`END`COM//! \\return the nth element of the fibonacci series`END' +
          '`PLN<br>' +
      '`END`KWDtemplate`END`PLN `END`PUN&lt;`END`KWDclass`END`PLN T`END' +
          '`PUN&gt;`END`PLN<br>' +
      'T fib`END`PUN(`END`KWDunsigned`END`PLN `END`KWDint`END`PLN n`END' +
          '`PUN,`END`PLN `END`KWDconst`END`PLN T`END`PUN&amp;`END`PLN fib0' +
          '`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; T a`END`PUN(`END`PLNfib0`END`PUN),`END`PLN b`END`PUN(`END' +
          '`PLNfib0`END`PUN);`END`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +
          '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; T tmp`END`PUN(`END`PLNa`END`PUN);`END`PLN<br>' +
      '&nbsp; &nbsp; a `END`PUN+=`END`PLN b`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; `END`KWDreturn`END`PLN a`END`PUN;`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      '`END`KWDint`END`PLN main`END`PUN(`END`KWDint`END`PLN argc`END' +
          '`PUN,`END`PLN `END`KWDchar`END`PLN `END`PUN**`END`PLNargv`END' +
          '`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; cout `END`PUN&lt;&lt;`END`PLN fib`END`PUN(`END`LIT10`END' +
          '`PUN,`END`PLN `END`LIT1U`END`PUN);`END`PLN<br>' +
      '`END`PUN}`END'),

  java: (
      '`KWDpackage`END`PLN foo`END`PUN;`END`PLN<br>' +
      '<br>' +
      '`END`KWDimport`END`PLN java`END`PUN.`END`PLNutil`END`PUN.`END' +
          '`TYPIterator`END`PUN;`END`PLN<br>' +
      '<br>' +
      '`END`COM/**<br>' +
      '&nbsp;* the fibonacci series implemented as an Iterable.<br>' +
      '&nbsp;*\/`END`PLN<br>' +
      '`END`KWDpublic`END`PLN `END`KWDfinal`END`PLN `END`KWDclass`END' +
          '`PLN `END`TYPFibonacci`END`PLN `END`KWDimplements`END`PLN `END' +
          '`TYPIterable`END`PUN&lt;`END`TYPInteger`END`PUN&gt;`END`PLN `END`' +
          'PUN{`END`PLN<br>' +
      '&nbsp; `END' +
          '`COM/** the next and previous members of the series. *\/`END' +
          '`PLN<br>' +
      '&nbsp; `END`KWDprivate`END`PLN `END`KWDint`END`PLN a `END`PUN=`END' +
          '`PLN `END`LIT1`END`PUN,`END`PLN b `END`PUN=`END`PLN `END`LIT1`END' +
          '`PUN;`END`PLN<br>' +
      '<br>' +
      '&nbsp; `END`KWDpublic`END`PLN `END`TYPIterator`END`PUN&lt;`END' +
          '`TYPInteger`END`PUN&gt;`END`PLN iterator`END`PUN()`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; `END`KWDreturn`END`PLN `END`KWDnew`END`PLN `END' +
          '`TYPIterator`END`PUN&lt;`END`TYPInteger`END`PUN&gt;()`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`COM/** the series is infinite. *\/`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`KWDpublic`END`PLN `END`KWDboolean`END' +
          '`PLN hasNext`END`PUN()`END`PLN `END`PUN{`END`PLN `END' +
          '`KWDreturn`END`PLN `END`KWDtrue`END`PUN;`END`PLN `END`PUN}`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`KWDpublic`END`PLN `END`TYPInteger`END' +
          '`PLN `END`KWDnext`END`PUN()`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`KWDint`END`PLN tmp `END`PUN=`END' +
          '`PLN a`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; a `END`PUN+=`END`PLN b`END`PUN;`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; b `END`PUN=`END`PLN tmp`END`PUN;`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`KWDreturn`END`PLN a`END`PUN;`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`KWDpublic`END`PLN `END`KWDvoid`END' +
          '`PLN remove`END`PUN()`END`PLN `END`PUN{`END`PLN `END`KWDthrow`END' +
          '`PLN `END`KWDnew`END`PLN `END' +
          '`TYPUnsupportedOperationException`END`PUN();`END`PLN `END' +
          '`PUN}`END`PLN<br>' +
      '&nbsp; &nbsp; `END`PUN};`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '<br>' +
      '&nbsp; `END`COM/**<br>' +
      '&nbsp; &nbsp;* the n&lt;sup&gt;th&lt;/sup&gt; element of the given ' +
          'series.<br>' +
      '&nbsp; &nbsp;* @throws NoSuchElementException if there are less than ' +
          'n elements in the<br>' +
      '&nbsp; &nbsp;* &nbsp; given Iterable\'s {@link Iterable#iterator ' +
          'iterator}.<br>' +
      '&nbsp; &nbsp;*\/`END`PLN<br>' +
      '&nbsp; `END`KWDpublic`END`PLN `END`KWDstatic`END`PLN `END' +
          '`PUN&lt;`END`PLNT`END`PUN&gt;`END`PLN<br>' +
      '&nbsp; T nth`END`PUN(`END`KWDint`END`PLN n`END`PUN,`END`PLN `END' +
          '`TYPIterable`END`PUN&lt;`END`PLNT`END`PUN&gt;`END' +
          '`PLN iterable`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TYPIterator`END`PUN&lt;?`END`PLN `END' +
          '`KWDextends`END`PLN T`END`PUN&gt;`END`PLN it `END`PUN=`END' +
          '`PLN iterable`END`PUN.`END`PLNiterator`END`PUN();`END`PLN<br>' +
      '&nbsp; &nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END' +
          '`PUN&gt;`END`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; it`END`PUN.`END`KWDnext`END`PUN();`END`PLN<br>' +
      '&nbsp; &nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; &nbsp; `END`KWDreturn`END`PLN it`END`PUN.`END`KWDnext`END' +
          '`PUN();`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '<br>' +
      '&nbsp; `END`KWDpublic`END`PLN `END`KWDstatic`END`PLN `END`KWDvoid`END' +
          '`PLN main`END`PUN(`END`TYPString`END`PUN[]`END`PLN args`END' +
          '`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TYPSystem`END`PUN.`END`KWDout`END`PUN.`END' +
          '`KWDprint`END`PUN(`END`PLNnth`END`PUN(`END`LIT10`END`PUN,`END' +
          '`PLN `END`KWDnew`END`PLN `END`TYPFibonacci`END`PUN()));`END' +
          '`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '`END`PUN}`END'),
  javascript: (
      '`COM/**<br>' +
      '&nbsp;* nth element in the fibonacci series.<br>' +
      '&nbsp;* @param n &gt;= 0<br>' +
      '&nbsp;* @return the nth element, &gt;= 0.<br>' +
      '&nbsp;*\/`END`PLN<br>' +
      '`END`KWDfunction`END`PLN fib`END`PUN(`END`PLNn`END`PUN)`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; `END`KWDvar`END`PLN a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END' +
          '`PLN b `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDvar`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +
          '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; a `END`PUN+=`END`PLN b`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; `END`KWDreturn`END`PLN a`END`PUN;`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      'document`END`PUN.`END`PLNwrite`END`PUN(`END`PLNfib`END`PUN(`END' +
          '`LIT10`END`PUN));`END'),
  perl: (
      '`COM#!/usr/bin/perl`END`PLN<br>' +
      '<br>' +
      '`END`KWDuse`END`PLN strict`END`PUN;`END`PLN<br>' +
      '`END`KWDuse`END`PLN integer`END`PUN;`END`PLN<br>' +
      '<br>' +
      '`END`COM# the nth element of the fibonacci series`END`PLN<br>' +
      '`END`COM# param n - an int &gt;= 0`END`PLN<br>' +
      '`END`COM# return an int &gt;= 0`END`PLN<br>' +
      '`END`KWDsub`END`PLN fib`END`PUN(`END`PLN$`END`PUN)`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; my $n `END`PUN=`END`PLN shift`END`PUN,`END`PLN ' +
      '$a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END`PLN $b `END' +
          '`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`PUN(`END`PLN$a`END`PUN,`END`PLN $b`END`PUN)`END' +
          '`PLN `END`PUN=`END`PLN `END`PUN(`END`PLN$a `END`PUN+`END' +
          '`PLN $b`END`PUN,`END`PLN $a`END`PUN)`END`PLN `END`KWDuntil`END' +
          '`PLN `END`PUN(--`END`PLN$n `END`PUN&lt;`END`PLN `END`LIT0`END' +
          '`PUN);`END`PLN<br>' +
      '&nbsp; `END`KWDreturn`END`PLN $a`END`PUN;`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      '`END`KWDprint`END`PLN fib`END`PUN(`END`LIT10`END`PUN);`END'),
  python: (
      '`COM#!/usr/bin/python2.4`END`PLN<br>' +
      '<br>' +
      '`END`KWDdef`END`PLN fib`END`PUN():`END`PLN<br>' +
      '&nbsp; `END`STR\'\'\'<br>' +
      '&nbsp; a generator that produces the elements of the fibonacci series' +
          '<br>' +
      '&nbsp; \'\'\'`END`PLN<br>' +
      '<br>' +
      '&nbsp; a `END`PUN=`END`PLN `END`LIT1`END`PLN<br>' +
      '&nbsp; b `END`PUN=`END`PLN `END`LIT1`END`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`KWDTrue`END`PUN:`END`PLN<br>' +
      '&nbsp; &nbsp; a`END`PUN,`END`PLN b `END`PUN=`END`PLN a `END`PUN+`END' +
          '`PLN b`END`PUN,`END`PLN a<br>' +
      '&nbsp; &nbsp; `END`KWDyield`END`PLN a<br>' +
      '<br>' +
      '`END`KWDdef`END`PLN nth`END`PUN(`END`PLNseries`END`PUN,`END`PLN n`END' +
          '`PUN):`END`PLN<br>' +
      '&nbsp; `END`STR\'\'\'<br>' +
      '&nbsp; returns the nth element of a series,<br>' +
      '&nbsp; consuming the earlier elements of the series<br>' +
      '&nbsp; \'\'\'`END`PLN<br>' +
      '<br>' +
      '&nbsp; `END`KWDfor`END`PLN x `END`KWDin`END`PLN series`END`PUN:`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; n `END`PUN=`END`PLN n `END`PUN-`END`PLN `END`LIT1`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; `END`KWDif`END`PLN n `END`PUN&lt;=`END`PLN `END' +
          '`LIT0`END`PUN:`END`PLN `END`KWDreturn`END`PLN x<br>' +
      '<br>' +
      '`END`KWDprint`END`PLN nth`END`PUN(`END`PLNfib`END`PUN(),`END`PLN `END' +
          '`LIT10`END`PUN)`END'),
  xml: (
      '`DEC&lt;!DOCTYPE series PUBLIC "fibonacci numbers"&gt;`END`PLN<br>' +
      '<br>' +
      '`END`TAG&lt;series `END`ATNbase`END`TAG=`END`ATV"1"`END`TAG `END' +
          '`ATNstep`END`TAG=`END`ATV"s(n-2) + s(n-1)"`END`TAG&gt;`END' +
          '`PLN<br>' +
      '&nbsp; `END`TAG&lt;element `END`ATNi`END`TAG=`END`ATV"0"`END' +
          '`TAG&gt;`END`PLN1`END`TAG&lt;/element&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;element `END`ATNi`END`TAG=`END`ATV"1"`END' +
          '`TAG&gt;`END`PLN1`END`TAG&lt;/element&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;element `END`ATNi`END`TAG=`END`ATV"2"`END' +
          '`TAG&gt;`END`PLN2`END`TAG&lt;/element&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;element `END`ATNi`END`TAG=`END`ATV"3"`END' +
          '`TAG&gt;`END`PLN3`END`TAG&lt;/element&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;element `END`ATNi`END`TAG=`END`ATV"4"`END' +
          '`TAG&gt;`END`PLN5`END`TAG&lt;/element&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;element `END`ATNi`END`TAG=`END`ATV"5"`END' +
          '`TAG&gt;`END`PLN8`END`TAG&lt;/element&gt;`END`PLN<br>' +
      '&nbsp; ...<br>' +
      '`END`TAG&lt;/series&gt;`END'),
  html: (
      '`TAG&lt;html&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;head&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;title&gt;`END`PLNFibonacci number`END' +
          '`TAG&lt;/title&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;/head&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;body&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;noscript&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`TAG&lt;dl&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dt&gt;`END' +
          '`PLNFibonacci numbers`END`TAG&lt;/dt&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN1`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN1`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN2`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN3`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN5`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN8`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &amp;hellip;<br>' +
      '&nbsp; &nbsp; &nbsp; `END`TAG&lt;/dl&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;/noscript&gt;`END`PLN<br>' +
      '<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;script `END`ATNtype`END`TAG=`END' +
          '`ATV"text/javascript"`END`TAG&gt;`END' +
          '<span class="embsrc">`PUN&lt;!--`END`PLN<br>' +
      '`END`KWDfunction`END`PLN fib`END`PUN(`END`PLNn`END`PUN)`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; `END`KWDvar`END`PLN a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END' +
          '`PLN b `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDvar`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +
          '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; a `END`PUN+=`END`PLN b`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; `END`KWDreturn`END`PLN a`END`PUN;`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      'document`END`PUN.`END`PLNwriteln`END`PUN(`END`PLNfib`END`PUN(`END' +
          '`LIT10`END`PUN));`END`PLN<br>' +
      '`END`COM// --&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`END`TAG&lt;/script&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;/body&gt;`END`PLN<br>' +
      '`END`TAG&lt;/html&gt;`END'),
  htmlXmp: (
      '`TAG&lt;html&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;head&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;title&gt;`END`PLNFibonacci number`END' +
          '`TAG&lt;/title&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;/head&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;body&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;noscript&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`TAG&lt;dl&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dt&gt;`END' +
          '`PLNFibonacci numbers`END`TAG&lt;/dt&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN1`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN1`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN2`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN3`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN5`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`TAG&lt;dd&gt;`END`PLN8`END' +
          '`TAG&lt;/dd&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &amp;hellip;<br>' +
      '&nbsp; &nbsp; &nbsp; `END`TAG&lt;/dl&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;/noscript&gt;`END`PLN<br>' +
      '<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;script `END`ATNtype`END`TAG=`END' +
          '`ATV"text/javascript"`END`TAG&gt;`END' +
          '<span class="embsrc">`PUN&lt;!--`END`PLN<br>' +
      '`END`KWDfunction`END`PLN fib`END`PUN(`END`PLNn`END`PUN)`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; `END`KWDvar`END`PLN a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END' +
          '`PLN b `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDvar`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +
          '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; a `END`PUN+=`END`PLN b`END`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN<br>' +
      '&nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; `END`KWDreturn`END`PLN a`END`PUN;`END`PLN<br>' +
      '`END`PUN}`END`PLN<br>' +
      '<br>' +
      'document`END`PUN.`END`PLNwriteln`END`PUN(`END`PLNfib`END`PUN(`END' +
          '`LIT10`END`PUN));`END`PLN<br>' +
      '`END`COM// --&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`END`TAG&lt;/script&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;/body&gt;`END`PLN<br>' +
      '`END`TAG&lt;/html&gt;`END'),
  PHP: (
      '`TAG&lt;html&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;head&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;title&gt;&lt;?`END' +
          '<span class="embsrc">`PUN=`END`PLN `END' +
          '`STR\'Fibonacci numbers\'`END`PLN `END`END' +
          '`TAG?&gt;&lt;/title&gt;`END`PLN<br>' +
      '<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;?`END<span class="embsrc">`PLNphp<br>' +
      '&nbsp; &nbsp; &nbsp; `END`COM// PHP has a plethora of comment types' +
          '`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`COM\/* What is a<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"plethora"? *\/`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`KWDfunction`END`PLN fib`END`PUN(`END' +
          '`PLN$n`END`PUN)`END`PLN `END`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`COM# I don\'t know.`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; $a `END`PUN=`END`PLN `END`LIT1`END' +
          '`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; $b `END`PUN=`END`PLN `END`LIT1`END' +
          '`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`KWDwhile`END`PLN `END`PUN(--`END' +
          '`PLN$n `END`PUN&gt;=`END`PLN `END`LIT0`END`PUN)`END`PLN `END' +
          '`PUN{`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo `END`STR"$a\\n"`END`PUN;`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tmp `END`PUN=`END`PLN $a`END' +
          '`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $a `END`PUN+=`END`PLN $b`END' +
          '`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $b `END`PUN=`END`PLN $tmp`END' +
          '`PUN;`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; &nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; &nbsp; &nbsp; `END`PUN}`END`PLN<br>' +
      '&nbsp; &nbsp; `END`END`TAG?&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;/head&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;body&gt;`END`PLN<br>' +
      '&nbsp; &nbsp; `END`TAG&lt;?`END<span class="embsrc">`PLN fib`END' +
          '`PUN(`END`LIT10`END`PUN);`END`PLN `END`END`TAG?&gt;`END`PLN<br>' +
      '&nbsp; `END`TAG&lt;/body&gt;`END`PLN<br>' +
      '`END`TAG&lt;/html&gt;`END'),
  whitespace: '',
  misc1: '`COM// ends with line comment token`END`PLN<br>' +
      '`END`COM//`END',
  issue4: (
      '`TAG&lt;script `END`ATNtype`END`TAG=`END`ATV"text/javascript"`END' +
          '`TAG&gt;`END<span class="embsrc">`PLN<br>' +
      '&nbsp; &nbsp;`END`KWDvar`END`PLN savedTarget`END`PUN=`END`KWDnull`END' +
          '`PUN;`END`PLN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `END`COM// The target ' +
          'layer (effectively vidPane)`END`PLN<br>' +
      '&nbsp; &nbsp;`END`KWDvar`END`PLN orgCursor`END`PUN=`END`KWDnull`END' +
          '`PUN;`END`PLN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `END`COM// The ' +
          'original mouse style so we can restore it`END`PLN<br>' +
      '&nbsp; &nbsp;`END`KWDvar`END`PLN dragOK`END`PUN=`END`KWDfalse`END' +
          '`PUN;`END`PLN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `END' +
          '`COM// True if we\'re allowed to move the element under mouse' +
          '`END`PLN<br>' +
      '&nbsp; &nbsp;`END`KWDvar`END`PLN dragXoffset`END`PUN=`END`LIT0`END' +
          '`PUN;`END`PLN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;`END' +
          '`COM// How much we\'ve moved the element on the horozontal`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp;`END`KWDvar`END`PLN dragYoffset`END`PUN=`END`LIT0`END' +
          '`PUN;`END`PLN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;`END' +
          '`COM// How much we\'ve moved the element on the verticle`END' +
          '`PLN<br>' +
      '&nbsp; &nbsp;vidPaneID `END`PUN=`END`PLN document`END`PUN.`END' +
          '`PLNgetElementById`END`PUN(`END`STR\'vidPane\'`END`PUN);`END' +
          '`PLN `END`COM// Our movable layer`END`PLN<br>' +
      '&nbsp; &nbsp;vidPaneID`END`PUN.`END`PLNstyle`END`PUN.`END`PLNtop`END' +
          '`PUN=`END`STR\'75px\'`END`PUN;`END`PLN &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `END`COM// ' +
          'Starting location horozontal`END`PLN<br>' +
      '&nbsp; &nbsp;vidPaneID`END`PUN.`END`PLNstyle`END`PUN.`END`PLNleft`END' +
          '`PUN=`END`STR\'75px\'`END`PUN;`END`PLN &nbsp; &nbsp; &nbsp; ' +
          '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;`END`COM// ' +
          'Starting location verticle`END`PLN<br>' +
      '`END`PUN&lt;`END`PLNscript`END`PUN&gt;`END</span>'),
  issue8: (
      '<b>`PLNone`END</b>`PLN &nbsp; &nbsp; `END<b>`TYPTwo`END</b>`PLN' +
          ' &nbsp; &nbsp; `END<b>`PLNthree`END</b>`PLN &nbsp; `END`TYPFour' +
          '`END`PLN &nbsp; &nbsp;`END<b>`PLNfive`END</b>`PLN &nbsp; &nbsp;' +
          '`END`PUN|`END`PLN<br>' +
      '`END`TYPSix`END`PLN &nbsp; &nbsp; `END<b>`PLNseven`END</b>`PLN &nbsp; ' +
          '`END`TYPEight`END`PLN &nbsp; nine &nbsp; &nbsp;`END`TYPTen`END' +
          '`PLN &nbsp; &nbsp; `END`PUN|`END`PLN<br>' +
      '`END<b>`PLNeleven`END</b>`PLN &nbsp;`END`TYPTwelve`END`PLN &nbsp;`END' +
          '<b>`PLNthirteen`END</b>`PLN &nbsp; &nbsp; &nbsp; &nbsp;`END' +
          '`TYPFourteen`END`PLN &nbsp; &nbsp; &nbsp; &nbsp;fifteen `END`' +
          'PUN|`END'),
  issue12: (
      '`STR/foo/`END`PUN;`END`PLN &nbsp;`END`COM// a slash starting a line ' +
          'treated as a regexp beginning`END`PLN<br>' +
      '`END`STR"foo"`END`PUN.`END`PLNmatch`END`PUN(`END`STR/fo+$/`END' +
          '`PUN);`END`PLN<br>' +
      '`END`COM// this line comment not treated as a regular expressions`END' +
          '`PLN<br>' +
      '`END`STR"foo /bar/"`END`PUN.`END`PLNtest`END`PUN(`END`STR/"baz"/`END' +
          '`PUN);`END`PLN &nbsp;`END`COM// test string and regexp boundaries' +
          '`END`PLN<br>' +
      '`END`KWDvar`END`PLN division `END`PUN=`END`PLN `END' +
          '`STR/\\b\\d+\\/\\d+/`END`PLNg`END`PUN;`END`PLN &nbsp;`END' +
          '`COM// test char sets and escaping of specials`END`PLN<br>' +
      '`END`KWDvar`END`PLN allSpecials `END`PUN=`END`PLN `END' +
          '`STR/([^\\(\\)\\[\\]\\{\\}\\-\\?\\+\\*\\.\\^\\$\\/]+)\\\\/`END' +
          '`PUN;`END`PLN<br>' +
      '<br>' +
      '`END`COM// test that slash used in numeric context treated as an ' +
          'operator`END`PLN<br>' +
      '`END`LIT1`END`PLN `END`PUN/`END`PLN `END`LIT2`END`PUN;`END`PLN<br>' +
      '`END`LIT1`END`PUN.`END`PLN `END`PUN/`END`PLN x`END`PUN;`END`PLN<br>' +
      'x `END`PUN/`END`PLN y`END`PUN;`END`PLN<br>' +
      '`END`PUN(`END`PLNx`END`PUN)`END`PLN `END`PUN/`END`PLN y`END`PUN;`END' +
          '`PLN<br>' +
      '`END`LIT1`END`PLN `END`COM/* foo */`END`PLN `END`PUN/`END`PLN `END' +
          '`LIT2`END`PUN;`END`PLN<br>' +
      '`END`LIT1`END`PLN `END`COM/* foo */`END`PUN/`END`PLN `END`LIT2`END' +
          '`PUN;`END`PLN<br>' +
      '`END`LIT1`END`PUN/`END`LIT2`END`PUN;`END`PLN<br>' +
      '`END`LIT1`END`PUN./`END`PLNx`END`PUN;`END`PLN<br>' +
      'x`END`PUN/`END`PLNy`END`PUN;`END`PLN<br>' +
      '`END`PUN(`END`PLNx`END`PUN)/`END`PLNy`END`PUN;`END`PLN<br>' +
      '<br>' +
      '`END`COM// test split over two lines. &nbsp;line comment should not ' +
          'fool it`END`PLN<br>' +
      '`END`LIT1`END`COM//`END`PLN<br>' +
      '`END`PUN/`END`LIT2`END`PUN;`END`PLN<br>' +
      '<br>' +
      'x`END`PUN++/`END`PLNy`END`PUN;`END`PLN<br>' +
      'x`END`PUN--/`END`PLNy`END`PUN;`END`PLN<br>' +
      'x`END`PUN[`END`PLNy`END`PUN]`END`PLN `END`PUN/`END`PLN z`END`PUN;`END' +
          '`PLN<br>' +
      'f`END`PUN()`END`PLN `END`PUN/`END`PLN n`END`PUN;`END`PLN<br>' +
      '<br>' +
      '`END`COM// test that slash after non postfix operator is start of ' +
          'regexp`END`PLN<br>' +
      'log`END`PUN(`END`STR\'matches = \'`END`PLN `END`PUN+`END`PLN `END' +
          '`STR/foo/`END`PUN.`END`PLNtest`END`PUN(`END`PLNfoo`END`PUN));`END' +
          '`PLN<br>' +
      '<br>' +
      '`END`COM// test keyword preceders`END`PLN<br>' +
      '`END`KWDreturn`END`PLN `END`STR/a regexp/`END`PUN;`END`PLN<br>' +
      'division `END`PUN=`END`PLN notreturn `END`PUN/`END`PLN not_a_regexp ' +
          '`END`PUN/`END`PLN `END`LIT2`END`PUN;`END`PLN &nbsp;`END`COM// ' +
          'keyword suffix does not match`END`PLN<br>' +
      '<br>' +
      '`END`COM// &amp; not used as prefix operator in javascript but this ' +
          'should still work`END`PLN<br>' +
      '`END`PUN&amp;`END`STR/foo/`END`PUN;`END'),
  issue14a: (
      '`COM//comment`END`PLN<br>' +
      '`END`KWDint`END`PLN main`END`PUN(`END`KWDint`END`PLN argc`END`PUN,`END' +
          '`PLN `END`KWDchar`END`PLN `END`PUN**`END`PLNargv`END`PUN)`END' +
          '`PLN<br>' +
      '`END`PUN{}`END'),
  issue14b: (
      '`COM&lt;!-- There\'s an `END<acronym title="tag soup">`COMHTML`END' +
           '</acronym>`COM comment in my comment --&gt;`END`PLN<br>' +
      '`END`TAG&lt;p&gt;`END`PLNAnd another one inside the end tag`END' +
      '`TAG&lt;/p&gt;`END')
};


function runTests() {
  /** number of characters in common at the end up to max. */
  function commonPrefix(a, b) {
    var n = Math.min(a.length, b.length);
    var i;
    for (i = 0; i < n; ++i) {
      if (a.charAt(i) !== b.charAt(i)) { break; }
    }
    return i;
  }

  /** number of characters in common at the end up to max. */
  function commonSuffix(a, b, max) {
    var n = Math.min(a.length - max, b.length - max);
    var i;
    for (i = 0; i < n; ++i) {
      if (a.charAt(a.length - i - 1) !== b.charAt(b.length - i - 1)) { break; }
    }
    return i;
  }

  /** convert a plain text string to html by escaping html special chars. */
  function html(plainText) {
    return plainText.replace(/\046/g, '&amp;')
        .replace(/\074/g, '&lt;')
        .replace(/\076/g, '&gt;')
        .replace(/\042/g, '&quot;')
        .replace(/\xa0/g, '&nbsp;');
  }

  /**
   * get normalized markup.  innerHTML varies enough across browsers that we
   * can't use it.
   */
  function normalizedInnerHtml(node, opt_out) {
    var out = [];
    for (var child = node.firstChild; child; child = child.nextSibling) {
      PR_normalizedHtml(child, out);
    }
    out = out.join('');
    // more normalization to work around problems with non-ascii chars in
    // regexps in Safari
    for (var i = 0; (i = out.indexOf('\xa0')) >= 0;) {
      out = out.substring(0, i) + '&nbsp;' + out.substring(i + 1);
    }
    return out;
  }

  var htmlOut = [];
  var failures = 0;
  document.getElementById('errorReport').innerHTML =
      '<h1>Running tests&hellip;<\/h1>';
  htmlOut.push('<h1>Test results<\/h1>');
  for (var lang in goldens) {
    var golden = goldens[lang].replace(/`([A-Z]{3})/g, function (_, lbl) {
        return (lbl == 'END'
            ? '<\/span>'
            : '<span class="' + lbl.toLowerCase() + '">');
      });
    var actual = normalizedInnerHtml(document.getElementById(lang));
    if (golden !== actual) {  // test failed
      // write out
      var pre = commonPrefix(golden, actual);
      var post = commonSuffix(golden, actual, pre);

      ++failures;
      htmlOut.push('<h2>' + html(lang) + ' Failed<\/h1>');
      htmlOut.push(
          '<tt>' + html(golden.substring(0, pre)) +
          '&raquo;<span class="mismatch">' +
          html(golden.substring(pre, golden.length - post)) +
          '<\/span>&laquo;' +
          html(golden.substring(golden.length - post)) +

          '<br>!==<br>' +

          html(actual.substring(0, pre)) +
          '&raquo;<span class="mismatch">' +
          html(actual.substring(pre, actual.length - post)) +
          '<\/span>&laquo;' +
          html(actual.substring(actual.length - post)) + '<\/tt>');
    } else {
      htmlOut.push('<h2>' + html(lang) + ' OK<\/h1>');
    }
  }
  htmlOut.push('<h2>' + (failures ? (failures + ' test(s) failed') : 'Pass') +
               '<\/h2>');
  document.getElementById('errorReport').innerHTML =
      htmlOut.join('').replace(/&lt;br&gt;/g, '&lt;br&gt;\n');
}
</script>

</html>

{'fraction_non_alphanumeric': 0.2349505894277061, 'fraction_numerical': 0.008615176707651098, 'mean_word_length': 3.1855461845361344, 'pattern_counts': {'":': 0, '<': 995, '<?xml version=': 0, '>': 1061, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2194263', 'n_tokens_mistral': 37736, 'n_tokens_neox': 37046, 'n_words': 5963}