Full Code of asadm/urduscript for AI

master 1e669b153dfc cached
36 files
3.3 MB
867.6k tokens
2612 symbols
1 requests
Download .txt
Showing preview only (3,471K chars total). Download the full file or copy to clipboard to get everything.
Repository: asadm/urduscript
Branch: master
Commit: 1e669b153dfc
Files: 36
Total size: 3.3 MB

Directory structure:
gitextract_cbtgvdd3/

├── .gitignore
├── CITATION.cff
├── LICENSE.md
├── README.md
├── bin/
│   └── urdujs.js
├── docs/
│   ├── README.md
│   ├── _config.yml
│   ├── contribute.md
│   └── editor/
│       ├── addon/
│       │   └── edit/
│       │       └── matchbrackets.js
│       ├── css/
│       │   ├── base16-light.css
│       │   ├── codemirror.css
│       │   └── style.css
│       ├── index.html
│       ├── mode/
│       │   ├── javascript/
│       │   │   ├── index.html
│       │   │   ├── javascript.js
│       │   │   └── typescript.html
│       │   └── urduscript/
│       │       └── urduscript.js
│       └── scripts/
│           ├── codemirror.js
│           ├── codes.js
│           ├── editor.js
│           ├── escodegen.js
│           ├── expander.js
│           ├── jquery.js
│           ├── parser.js
│           ├── patterns.js
│           ├── require.js
│           ├── scopedEval.js
│           ├── sweet.js
│           ├── syntax.js
│           ├── text.js
│           ├── underscore.js
│           └── urdujs/
│               ├── keywords.js
│               └── keywords.js.txt
├── hello.js
├── package.json
└── src/
    └── keywords.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Dependency directory
# Deployed apps should consider commenting this line out:
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
node_modules


.DS_Store

editor/scripts/urdujs

================================================
FILE: CITATION.cff
================================================
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Memon
    given-names: Asad
title: "UrduScript"
version: 1.0.0
date-released: 2019-08-24


================================================
FILE: LICENSE.md
================================================
The MIT License (MIT)

Copyright (c) 2017 Asad Memon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

================================================
FILE: README.md
================================================
# UrduScript

![](docs/head.png?raw=true)

UrduScript is an [Urdish](http://www.urbandictionary.com/define.php?term=Urdish) dialect of JavaScript. The goal is to make programming more accessible to beginners from South Asia. UrduScript uses informal Urdu analogies to programming concepts, making it easy to get started without remembering keywords.

UrduScript transpiles to JavaScript. All JavaScript frameworks (like jQuery, UnderScore, React, etc) can be seemlessly used.

### Hello World

```js
// declare variable
rakho naam = "Asad"

// output to console
likho("Hello, " + naam)
```

[**Try it online here**](https://asadmemon.com/urduscript/editor/).

### Installation (Web Editor)
If you want to run the web editor offline. Follow these steps:

##### Prerequisites:
In order to run UrduScript on your computer, you need to install [Node.js](https://nodejs.org/en/download/) first. 
##### Installing (Windows):

- Download zip or clone the repository

- Inside your project directory, run:

  ```sh
  npm install
  npm install -g nws
  npm run windows
  ```

- Open your browser and type

```js
http://localhost:3030
```
##### Installing (MacOs, Ubuntu, Unix, etc):

- Download zip or clone the repository
- Inside your project directory, run:
```sh
npm install
npm start
```

- Open your browser and type

```js
http://localhost:3030
```

### Contributing

This is an open project and I am open to all ideas and improvements. See [this page](https://asadmemon.com/urduscript/contribute).



### Acknowledgments

- Project is only possible due to [Sweet.js](https://github.com/sweet-js/sweet-core).
- The online editor uses the wonderful [CodeMirror](https://github.com/codemirror/CodeMirror).
- Special thanks to Ali Alavi, Osman Mian, Eric Bhatti for their help.


================================================
FILE: bin/urdujs.js
================================================
#!/usr/bin/env node

var argv = require('yargs')
  .usage('Usage: urdujs [options] file')
  .boolean("t")
  .alias('t', 'transpile')
  .alias('o', 'out-file')
  .alias('d', 'out-dir')
  .describe('o', 'write output to file')
  .describe('d', 'write output to directory')
  .describe('t', 'only output the transpiled js code (only works when no output file defined)')
  .nargs('out-file', 1)
  .nargs('out-dir', 1)
  //.nargs('transpile', 1)
  .demand(1)
  .help('h')
  .alias('h', 'help')
  .argv;

var path = require('path');
var fs   = require('fs');

//console.log(__dirname + "/../src/keywords")
var urduHeadersPath = fs.realpathSync(__dirname + "/../src/keywords.js")
var urduHeaders = fs.readFileSync(urduHeadersPath, "utf8");

var compile = require('@sweet-js/core').compile;
var NodeLoader = require('@sweet-js/core/dist/node-loader').default;

let loaderOptions = {
  noBabel: argv.noBabel,
  logging: argv.outFile || argv.outDir
};

var loader = new NodeLoader(process.cwd(), loaderOptions);

argv._.forEach(function (file) {
  // first add header file in the dir.
  var fileStr = fs.realpathSync(file)
  //fs.writeFileSync(path.dirname(fileStr) + "/__urduHeaders.js", urduHeaders, 'utf8');
  //console.log("dir", path.dirname(file))
  
  var output = compile(fileStr, loader, {
    noBabel: argv.noBabel
  }).code;

  //remove the header file we added.
  //fs.unlinkSync(path.dirname(fileStr) + "/__urduHeaders.js")

  if (argv.outFile) {
    fs.writeFileSync(argv.outFile, output, 'utf8');
  } else if (argv.outDir) {
    fs.writeFileSync(path.join(argv.outDir, path.basename(file)), output, 'utf8');
  } else {
    if (!argv.transpile){
      eval(output)
    }
    else{
      console.log(output);
    }
  }
});


================================================
FILE: docs/README.md
================================================
# UrduScript - Urdu Mein Programming 
![](head.png?raw=true&t=4)
UrduScript ek programming language hai. Iska goal naye programmers k liye programming ko asaan banana ha. UrduScript informal Urdu use karti hai jis se naye programmers k liye programming concepts asaan hojate hen.

UrduScript transpile ho k JavaScript banjati hai. Apke saray JavaScript frameworks (jese jQuery, UnderScore, React, etc) iske saath use keeye jasakte hen.

## Hello Dunya

```js
// declare variable
rakho naam = "Asad"

// output to console
likho("Hello, " + naam)
```



### [Online Try Karen!](https://asadmemon.com/urduscript/editor/)

## Kyun?

If you are an experienced programmer, you might find this stupid. Per ye apke liye nahin hai. 

Remember learning programming for the first time? Remember the analogy of `variable` being a box jis mein value rakhte hen. UrduScript is based on those analogies to the core. Removing friction for new programmers.

Let me explain with an example, imagine explaining the following code to a very new learner:

```js
var name = "Ali"
console.log("Hello, " + name)
```

You will have to first convey the box analogy, then you will need to explain what a *console* is and what *log* is. And then finally how we concat the output.

This is the UrduScript equivalent:

```js
rakho naam = "Ali"
likho("Hello, " + naam)
```

Imagine explaining this to a new programmer, when you explain the variable/box analogy, `rakho` fits right in. 
ie. We are making a box called `naam` and usmein `"Ali"` rakhrahe hen.

`likho()` is also pretty self-explanatory too.

You get the idea. UrduScript is based on this concept.

## Pure اردو kyu nahin?

As much as I wanted to. Here are few reasons:

- Persian-like alphabets are not native to our keyboard.
- The default non-nastaliq font is hard to read.
- Right-to-left code style is horrible.
- Newer generation is adapting Urdish rapidly. 


To prove my point, here is a RTL pseudo-code hello world:

<img src="rtl1.png" width="400">

See what I mean? The font is bad. RTL is hard to understand. Also typing this was less natural than Urdish:

<img src="ltr1.png" width="400">


## Other Examples

### For Each

```js
// variable
rakho list = ["Ahmed", "Ali", "Qasim"]

// foreach loop. Iterate over 'list' array
har list k naam per{
  // output to screen
  likho(naam)
}
```

### If-Else

```js
// declare variable
rakho naam = "Asad"

// if else
agar (naam){
  likho("Salam, " + naam)
}
warna {
  likho("Naam khali hai")
}
```

### Prompt

```js
//prompt: ask for input from user
rakho naam = pucho("Apna naam likhen")

// if else
agar (naam){
  likho("Salam, " + naam)
}
warna {
  likho("Naam khali hai")
}
```

### Function

```js
// function is 'kaam'
kaam salaam(naam){
	agar (naam){
    likho("Salam, " + naam)
  }
  warna {
    likho("Naam khali hai")
  }
}

// calling function
salaam("Ali")
```

### While

```js
// declare a variable
rakho a = 10

// while is 'jabtak'
jabtak( a>0 ){
	likho(a)
	a--
}
```

### Do-While

```js
// ask age until given
karo{
  age = pucho("Apni age likhen")
}
jabtak(!age)
likho("Apki age " + age + " hai")
```


### If-Elseif-Else

```js
// declare variable
rakho naam = "Asad"

// if elseif else
agar (naam === "Asad"){
  likho("Salam, " + naam)
}
warnaagar (naam === "John"){
  likho("Hello, " + naam)
}
warna {
  likho("Naam khali hai")
}
```

### Recursion (Fibonacci)
```js
// recursive function
kaam fibonacci(num) {
  // base case
  agar (num <= 1) bhejo 1;
	
  // recursion
  bhejo fibonacci(num - 1) + fibonacci(num - 2);
}

likho(fibonacci(5))
```


## Contribute

You can contribute even if you think you are not a programmer. Please read [this guide](contribute).

Here are some contributors of the language:

- Ali Alavi
- Eric Bhatti
- Azka Qaiser
- Junaid Sarfraz
- Mehmood Memon
- Pavan Kumar
- Muhammad Asif
- Ahmed Jawed
- Harris Irfan
- Zayn-ul-abdin
- Mubashar Iqbal
- M Shaharyar Siddiqui
- Areeba
- Ahmer
- Muhammad Zaid Ikhlas
- Mian Asad
- Junaid Nadeem
- Shahan
- Muhammad Noman
- Ahsan Sohail
- Majid Razvi
- Hammad Siddiqui

## [Source Code](https://github.com/asadm/urduscript)

I have released the [code](https://github.com/asadm/urduscript) under MIT License. ⭐ the repo while you are there :P

The transpiler is written in JavaScript using [Sweet.js](https://github.com/sweet-js/sweet-core).

================================================
FILE: docs/_config.yml
================================================
theme: jekyll-theme-minimal
title: UrduScript
description: JavaScript ka Urdish dialect.

gems:
  - jekyll-seo-tag

logo: 'head.png'

defaults:
  - scope:
      path: ""
    values:
      image: 'head.png'

================================================
FILE: docs/contribute.md
================================================
# Contributing

The goal of UrduScript is to make programming more accessible to beginners from South Asia. 

There are two ways to contribute.

## Contribute to Grammar

UrduScript uses informal Urdu analogies to programming concepts, making it easy to get started without remembering keywords.

With that in mind. If you have suggestion for a keyword (Like "true" should be "sach"). Please [record it here](https://goo.gl/forms/2yU3xylEoKAQZrbG2). I will add your name to the contributors if I use your suggestion. Thanks!



## Contribute to Code

The [code](https://github.com/asadm/urduscript) is a proof of concept right now. I will put up more instructions on how things work. This section is *TODO*

================================================
FILE: docs/editor/addon/edit/matchbrackets.js
================================================
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

(function(mod) {
  if (typeof exports == "object" && typeof module == "object") // CommonJS
    mod(require("../../lib/codemirror"));
  else if (typeof define == "function" && define.amd) // AMD
    define(["../../lib/codemirror"], mod);
  else // Plain browser env
    mod(CodeMirror);
})(function(CodeMirror) {
  var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
    (document.documentMode == null || document.documentMode < 8);

  var Pos = CodeMirror.Pos;

  var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};

  function findMatchingBracket(cm, where, config) {
    var line = cm.getLineHandle(where.line), pos = where.ch - 1;
    var afterCursor = config && config.afterCursor
    if (afterCursor == null)
      afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)

    // A cursor is defined as between two characters, but in in vim command mode
    // (i.e. not insert mode), the cursor is visually represented as a
    // highlighted box on top of the 2nd character. Otherwise, we allow matches
    // from before or after the cursor.
    var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) ||
        matching[line.text.charAt(++pos)];
    if (!match) return null;
    var dir = match.charAt(1) == ">" ? 1 : -1;
    if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
    var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));

    var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
    if (found == null) return null;
    return {from: Pos(where.line, pos), to: found && found.pos,
            match: found && found.ch == match.charAt(0), forward: dir > 0};
  }

  // bracketRegex is used to specify which type of bracket to scan
  // should be a regexp, e.g. /[[\]]/
  //
  // Note: If "where" is on an open bracket, then this bracket is ignored.
  //
  // Returns false when no bracket was found, null when it reached
  // maxScanLines and gave up
  function scanForBracket(cm, where, dir, style, config) {
    var maxScanLen = (config && config.maxScanLineLength) || 10000;
    var maxScanLines = (config && config.maxScanLines) || 1000;

    var stack = [];
    var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
    var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
                          : Math.max(cm.firstLine() - 1, where.line - maxScanLines);
    for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
      var line = cm.getLine(lineNo);
      if (!line) continue;
      var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
      if (line.length > maxScanLen) continue;
      if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
      for (; pos != end; pos += dir) {
        var ch = line.charAt(pos);
        if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
          var match = matching[ch];
          if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
          else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
          else stack.pop();
        }
      }
    }
    return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
  }

  function matchBrackets(cm, autoclear, config) {
    // Disable brace matching in long lines, since it'll cause hugely slow updates
    var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
    var marks = [], ranges = cm.listSelections();
    for (var i = 0; i < ranges.length; i++) {
      var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);
      if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
        var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
        marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
        if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
          marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
      }
    }

    if (marks.length) {
      // Kludge to work around the IE bug from issue #1193, where text
      // input stops going to the textare whever this fires.
      if (ie_lt8 && cm.state.focused) cm.focus();

      var clear = function() {
        cm.operation(function() {
          for (var i = 0; i < marks.length; i++) marks[i].clear();
        });
      };
      if (autoclear) setTimeout(clear, 800);
      else return clear;
    }
  }

  var currentlyHighlighted = null;
  function doMatchBrackets(cm) {
    cm.operation(function() {
      if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
      currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
    });
  }

  CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
    if (old && old != CodeMirror.Init) {
      cm.off("cursorActivity", doMatchBrackets);
      if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
    }
    if (val) {
      cm.state.matchBrackets = typeof val == "object" ? val : {};
      cm.on("cursorActivity", doMatchBrackets);
    }
  });

  CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
  CodeMirror.defineExtension("findMatchingBracket", function(pos, config, oldConfig){
    // Backwards-compatibility kludge
    if (oldConfig || typeof config == "boolean") {
      if (!oldConfig) {
        config = config ? {strict: true} : null
      } else {
        oldConfig.strict = config
        config = oldConfig
      }
    }
    return findMatchingBracket(this, pos, config)
  });
  CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
    return scanForBracket(this, pos, dir, style, config);
  });
});


================================================
FILE: docs/editor/css/base16-light.css
================================================
/*

    Name:       Base16 Default Light
    Author:     Chris Kempson (http://chriskempson.com)

    CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools)
    Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)

*/

/* based on https://raw.githubusercontent.com/FarhadG/code-mirror-themes/master/themes/chrome-devtools.css */
.cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;}
.cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;}
.cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;}
.cm-s-base16-light .CodeMirror-linenumber {color: #b0b0b0;}
.cm-s-base16-light .CodeMirror-cursor {border-left: 1px solid #505050 !important;}

.cm-s-base16-light span.cm-comment {color: #8f5536;}
.cm-s-base16-light span.cm-atom {color: #aa759f;}
.cm-s-base16-light span.cm-number {color: #aa759f;}

.cm-s-base16-light span.cm-property, .cm-s-base16-light span.cm-attribute {color: #90a959;}
.cm-s-base16-light span.cm-keyword {color: #ac4142;}
.cm-s-base16-light span.cm-string {color: #F0A742;}

.cm-s-base16-light span.cm-variable {color: #7D944C;}
.cm-s-base16-light span.cm-variable-2 {color: #6a9fb5;}
.cm-s-base16-light span.cm-def {color: #d28445;}
.cm-s-base16-light span.cm-bracket {color: #202020;}
.cm-s-base16-light span.cm-tag {color: #ac4142;}
.cm-s-base16-light span.cm-link {color: #aa759f;}
.cm-s-base16-light span.cm-error {background: #ac4142; color: #505050;}

.cm-s-base16-light .CodeMirror-activeline-background {background: #DDDCDC !important;}
.cm-s-base16-light .CodeMirror-matchingbracket { text-decoration: underline; color: #ff00ff !important;}

/* Based on Sublime Text's Monokai theme */

body.invert .cm-s-base16-light.CodeMirror {background: rgb(22,23,25); color: #f8f8f2;}
body.invert .cm-s-base16-light div.CodeMirror-selected {background: #49483E !important;}
body.invert .cm-s-base16-light .CodeMirror-gutters {background: rgb(22,23,25); border-right: 0px;}
body.invert .cm-s-base16-light .CodeMirror-linenumber {color: #484848;}
body.invert .cm-s-base16-light .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}

body.invert .cm-s-base16-light span.cm-comment {color: #75715e;}
body.invert .cm-s-base16-light span.cm-atom {color: #ae81ff;}
body.invert .cm-s-base16-light span.cm-number {color: #ae81ff;}

body.invert .cm-s-base16-light span.cm-property,body.invert .cm-s-base16-light span.cm-attribute {color: #a6e22e;}
body.invert .cm-s-base16-light span.cm-keyword {color: #f92672;}
body.invert .cm-s-base16-light span.cm-string {color: #e6db74;}

body.invert .cm-s-base16-light span.cm-variable {color: #a6e22e;}
body.invert .cm-s-base16-light span.cm-variable-2 {color: #9effff;}
body.invert .cm-s-base16-light span.cm-def {color: #fd971f;}
body.invert .cm-s-base16-light span.cm-bracket {color: #f8f8f2;}
body.invert .cm-s-base16-light span.cm-tag {color: #f92672;}
body.invert .cm-s-base16-light span.cm-link {color: #ae81ff;}
body.invert .cm-s-base16-light span.cm-error {background: #f92672; color: #f8f8f0;}

body.invert .cm-s-base16-light .CodeMirror-activeline-background {background: #373831 !important;}
body.invert .cm-s-base16-light .CodeMirror-matchingbracket {
  text-decoration: underline;
  color: white !important;
}


================================================
FILE: docs/editor/css/codemirror.css
================================================
/* BASICS */

.CodeMirror {
  /* Set height, width, borders, and global font properties here */
  font-family: monospace;
  height: 300px;
  color: black;
}

/* PADDING */

.CodeMirror-lines {
  padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre {
  padding: 0 4px; /* Horizontal padding of content */
}

.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
  background-color: white; /* The little square between H and V scrollbars */
}

/* GUTTER */

.CodeMirror-gutters {
  border-right: 1px solid #ddd;
  background-color: #f7f7f7;
  white-space: nowrap;
}
.CodeMirror-linenumbers {}
.CodeMirror-linenumber {
  padding: 0 3px 0 5px;
  min-width: 20px;
  text-align: right;
  color: #999;
  white-space: nowrap;
}

.CodeMirror-guttermarker { color: black; }
.CodeMirror-guttermarker-subtle { color: #999; }

/* CURSOR */

.CodeMirror-cursor {
  border-left: 1px solid black;
  border-right: none;
  width: 0;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
  border-left: 1px solid silver;
}
.cm-fat-cursor .CodeMirror-cursor {
  width: auto;
  border: 0 !important;
  background: #7e7;
}
.cm-fat-cursor div.CodeMirror-cursors {
  z-index: 1;
}

.cm-animate-fat-cursor {
  width: auto;
  border: 0;
  -webkit-animation: blink 1.06s steps(1) infinite;
  -moz-animation: blink 1.06s steps(1) infinite;
  animation: blink 1.06s steps(1) infinite;
  background-color: #7e7;
}
@-moz-keyframes blink {
  0% {}
  50% { background-color: transparent; }
  100% {}
}
@-webkit-keyframes blink {
  0% {}
  50% { background-color: transparent; }
  100% {}
}
@keyframes blink {
  0% {}
  50% { background-color: transparent; }
  100% {}
}

/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror-overwrite .CodeMirror-cursor {}

.cm-tab { display: inline-block; text-decoration: inherit; }

.CodeMirror-rulers {
  position: absolute;
  left: 0; right: 0; top: -50px; bottom: -20px;
  overflow: hidden;
}
.CodeMirror-ruler {
  border-left: 1px solid #ccc;
  top: 0; bottom: 0;
  position: absolute;
}

/* DEFAULT THEME */

.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-strikethrough {text-decoration: line-through;}

.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;}
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable,
.cm-s-default .cm-punctuation,
.cm-s-default .cm-property,
.cm-s-default .cm-operator {}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
.cm-s-default .cm-comment {color: #a50;}
.cm-s-default .cm-string {color: #a11;}
.cm-s-default .cm-string-2 {color: #f50;}
.cm-s-default .cm-meta {color: #555;}
.cm-s-default .cm-qualifier {color: #555;}
.cm-s-default .cm-builtin {color: #30a;}
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}

.cm-s-default .cm-error {color: #f00;}
.cm-invalidchar {color: #f00;}

.CodeMirror-composing { border-bottom: 2px solid; }

/* Default styles for common addons */

div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
.CodeMirror-activeline-background {background: #e8f2ff;}

/* STOP */

/* The rest of this file contains styles related to the mechanics of
   the editor. You probably shouldn't touch them. */

.CodeMirror {
  position: relative;
  overflow: hidden;
  background: white;
}

.CodeMirror-scroll {
  overflow: scroll !important; /* Things will break if this is overridden */
  /* 30px is the magic margin used to hide the element's real scrollbars */
  /* See overflow: hidden in .CodeMirror */
  margin-bottom: -30px; margin-right: -30px;
  padding-bottom: 30px;
  height: 100%;
  outline: none; /* Prevent dragging from highlighting the element */
  position: relative;
}
.CodeMirror-sizer {
  position: relative;
  border-right: 30px solid transparent;
}

/* The fake, visible scrollbars. Used to force redraw during scrolling
   before actual scrolling happens, thus preventing shaking and
   flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
  position: absolute;
  z-index: 6;
  display: none;
}
.CodeMirror-vscrollbar {
  right: 0; top: 0;
  overflow-x: hidden;
  overflow-y: scroll;
}
.CodeMirror-hscrollbar {
  bottom: 0; left: 0;
  overflow-y: hidden;
  overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
  right: 0; bottom: 0;
}
.CodeMirror-gutter-filler {
  left: 0; bottom: 0;
}

.CodeMirror-gutters {
  position: absolute; left: 0; top: 0;
  min-height: 100%;
  z-index: 3;
}
.CodeMirror-gutter {
  white-space: normal;
  height: 100%;
  display: inline-block;
  vertical-align: top;
  margin-bottom: -30px;
}
.CodeMirror-gutter-wrapper {
  position: absolute;
  z-index: 4;
  background: none !important;
  border: none !important;
}
.CodeMirror-gutter-background {
  position: absolute;
  top: 0; bottom: 0;
  z-index: 4;
}
.CodeMirror-gutter-elt {
  position: absolute;
  cursor: default;
  z-index: 4;
}
.CodeMirror-gutter-wrapper ::selection { background-color: transparent }
.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }

.CodeMirror-lines {
  cursor: text;
  min-height: 1px; /* prevents collapsing before first draw */
}
.CodeMirror pre {
  /* Reset some styles that the rest of the page might have set */
  -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
  border-width: 0;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  margin: 0;
  white-space: pre;
  word-wrap: normal;
  line-height: inherit;
  color: inherit;
  z-index: 2;
  position: relative;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-variant-ligatures: contextual;
  font-variant-ligatures: contextual;
}
.CodeMirror-wrap pre {
  word-wrap: break-word;
  white-space: pre-wrap;
  word-break: normal;
}

.CodeMirror-linebackground {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  z-index: 0;
}

.CodeMirror-linewidget {
  position: relative;
  z-index: 2;
  overflow: auto;
}

.CodeMirror-widget {}

.CodeMirror-rtl pre { direction: rtl; }

.CodeMirror-code {
  outline: none;
}

/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-gutter,
.CodeMirror-gutters,
.CodeMirror-linenumber {
  -moz-box-sizing: content-box;
  box-sizing: content-box;
}

.CodeMirror-measure {
  position: absolute;
  width: 100%;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

.CodeMirror-cursor {
  position: absolute;
  pointer-events: none;
}
.CodeMirror-measure pre { position: static; }

div.CodeMirror-cursors {
  visibility: hidden;
  position: relative;
  z-index: 3;
}
div.CodeMirror-dragcursors {
  visibility: visible;
}

.CodeMirror-focused div.CodeMirror-cursors {
  visibility: visible;
}

.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-crosshair { cursor: crosshair; }
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }

.cm-searching {
  background: #ffa;
  background: rgba(255, 255, 0, .4);
}

/* Used to force a border model for a node */
.cm-force-border { padding-right: .1px; }

@media print {
  /* Hide the cursor when printing */
  .CodeMirror div.CodeMirror-cursors {
    visibility: hidden;
  }
}

/* See issue #2901 */
.cm-tab-wrap-hack:after { content: ''; }

/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext { background: none; }

================================================
FILE: docs/editor/css/style.css
================================================
body {
  font-family: Droid Sans, Arial, sans-serif;
  line-height: 1.5;
  /*max-width: 64.3em;*/
}
.CodeMirror {
  font-family: Menlo, 'Source Code Pro', monospace;
  font-size: 15px;
  height: 100%;
}

#options {
  position: absolute;
  font-size: 14px;
  font-family: Droid Sans, Arial, sans-serif;
  line-height: 1.5;
  top: 20px;
  right: 40px;
  z-index: 1;

}

#header {
  color: #fff;
  background-color: #000;
  position: absolute;
  bottom: 0;
  right: 50%;
  left: 0;
  height: 40px;
  
  
  
  font-family: 'Lato',Helvetica Neue,Helvetica,Arial,sans-serif;
  font-weight: 300;
  padding-left: 20px;
}

#header span{
  display: inline-block;
  margin-top: 7px;
}

#controls {
  color: #fff;
  background-color: #000;
  position: absolute;;
  height: 40px;
  right: 0;
  bottom: 0;
  left: 50%;

}

#errors {
  color: red;
  position: absolute;
  background-color: white;
  /*right: 10;*/
  z-index: 10;
  bottom: 10;
  /*left: 50%;*/
  /*padding-top: 20px;*/
  /*padding-left: 55px;*/
  padding: 10px;
}

#edit-box {
  position: absolute;
  top: 0px;
  right: 50%;
  bottom: 40px;
  left: 0;
  border-right: 1px solid #000;
}
#output-box {
  position: absolute;
  top: 0px;
  right: 0;
  bottom: 40px;
  left: 50%;
}


/* Small Devices, Tablets */
@media only screen and (max-width : 768px) {
  #edit-box{
    right: 0;
    bottom: 30%;
    border-bottom: 1px solid #000;
    border-right: 0px;
  }

  #output-box{
    top: 70%;
    bottom: 40px;
    left: 0;
  }

  #header{
    right: 0;
    padding-left: 0;
  }
  #header span{
    display: none;
  }
  #controls{
    display: none;
  }

  #drop-examples{
    margin-right: 10px;
    margin-top: 8px;
    float: right;
  }
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;

    box-shadow: none;
    border: 1px solid rgba(0,0,0,.125);
}

body.invert .btn-success {
  color: #fff;
  background-color: rgb(97, 152, 32);
}

#btn-run,
#lbl-examples{
  margin-left: 10px;
}

.btn-default{
  color: #fff;
  background-color: #000;
  border: 1px solid #fff;
}

#chk-transpile{
  margin-top: 15px;
}

#lbl-examples{
  font-weight: bold;
  font-size: 13px; 
  margin-right: 10px;
}

#drop-examples{
  font-size: 14px;
  min-width: 150px;
}

================================================
FILE: docs/editor/index.html
================================================
<html>
<head>
  <meta charset="utf-8">
  <title>Play UrduScript</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link href='https://fonts.googleapis.com/css?family=Lato:100,300' rel='stylesheet' type='text/css'>
  <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:400,600" rel="stylesheet" type="text/css"/>
  <link rel="stylesheet" href="css/codemirror.css">
  <link rel="stylesheet" href="css/base16-light.css">
  <link rel="stylesheet" href="css/style.css">

  <script src="scripts/jquery.js"></script>
  <script src="scripts/codemirror.js"></script>
  <script src="addon/edit/matchbrackets.js"></script>
  <script src="mode/urduscript/urduscript.js"></script>
  <script src="scripts/codes.js"></script>
  <script data-main="scripts/editor" src="scripts/require.js"></script>

  <script>
	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

	  ga('create', 'UA-58030862-1', 'auto');
	  ga('send', 'pageview');

	</script>
</head>
<body class="invert">

<div id='header'>
   <span>UrduScript</span>
   <a id="btn-run" class="btn btn-success">Run</a>
   <span id="lbl-examples">Examples: </span>
   <select id="drop-examples">
    
  </select>
   
   
</div>

<div id="controls">
  <!--input id="btn-reset" type="button" class="btn btn-default" value="Reset Code"/-->
  <input id="chk-transpile" type="checkbox" value="transpile" /> Only output transpiled code.
  
  <!-- <input id="ck-builtin" type="checkbox" value="builtin" /> include builtin macros -->
</div>
<pre id="errors">
  
</pre>

<div id='edit-box'>
<textarea id="editor">/*
Neche UrduScript likhen. Code chalane k liye Run pe click karen.
*/

// variable
rakho list = ["Ahmed", "Ali", "Qasim"]

// loop (foreach)
har list k naam per{
  // output to screen
  likho(naam)
}

// function ko 'tareeka' kehte hen
tareeka salam(naam){
  likho("Salam, " + naam)
}

salam("Qasim")

</textarea>
</div>

<div id='output-box'>
<textarea id="output">//Output comes here</textarea>
</div>


</body>
</html>


================================================
FILE: docs/editor/mode/javascript/index.html
================================================
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>CodeMirror: JavaScript mode</title>
    <link rel="stylesheet" href="../../lib/codemirror.css">
    <script src="../../lib/codemirror.js"></script>
    <script src="../../addon/edit/matchbrackets.js"></script>
    <script src="../../addon/edit/continuecomment.js"></script>
    <script src="../../addon/comment/comment.js"></script>
    <script src="javascript.js"></script>
    <link rel="stylesheet" href="../../doc/docs.css">
    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  </head>
  <body>
    <h1>CodeMirror: JavaScript mode</h1>

<div><textarea id="code" name="code">
// Demo code (the actual new parser character stream implementation)

function StringStream(string) {
  this.pos = 0;
  this.string = string;
}

StringStream.prototype = {
  done: function() {return this.pos >= this.string.length;},
  peek: function() {return this.string.charAt(this.pos);},
  next: function() {
    if (this.pos &lt; this.string.length)
      return this.string.charAt(this.pos++);
  },
  eat: function(match) {
    var ch = this.string.charAt(this.pos);
    if (typeof match == "string") var ok = ch == match;
    else var ok = ch &amp;&amp; match.test ? match.test(ch) : match(ch);
    if (ok) {this.pos++; return ch;}
  },
  eatWhile: function(match) {
    var start = this.pos;
    while (this.eat(match));
    if (this.pos > start) return this.string.slice(start, this.pos);
  },
  backUp: function(n) {this.pos -= n;},
  column: function() {return this.pos;},
  eatSpace: function() {
    var start = this.pos;
    while (/\s/.test(this.string.charAt(this.pos))) this.pos++;
    return this.pos - start;
  },
  match: function(pattern, consume, caseInsensitive) {
    if (typeof pattern == "string") {
      function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
      if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
        if (consume !== false) this.pos += str.length;
        return true;
      }
    }
    else {
      var match = this.string.slice(this.pos).match(pattern);
      if (match &amp;&amp; consume !== false) this.pos += match[0].length;
      return match;
    }
  }
};
</textarea></div>

    <script>
      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
        lineNumbers: true,
        matchBrackets: true,
        continueComments: "Enter",
        extraKeys: {"Ctrl-Q": "toggleComment"}
      });
    </script>

    <p>
      JavaScript mode supports a two configuration
      options:
      <ul>
        <li><code>json</code> which will set the mode to expect JSON
        data rather than a JavaScript program.</li>
        <li><code>typescript</code> which will activate additional
        syntax highlighting and some other things for TypeScript code
        (<a href="typescript.html">demo</a>).</li>
        <li><code>statementIndent</code> which (given a number) will
        determine the amount of indentation to use for statements
        continued on a new line.</li>
      </ul>
    </p>

    <p><strong>MIME types defined:</strong> <code>text/javascript</code>, <code>application/json</code>, <code>text/typescript</code>, <code>application/typescript</code>.</p>
  </body>
</html>


================================================
FILE: docs/editor/mode/javascript/javascript.js
================================================
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

(function(mod) {
  if (typeof exports == "object" && typeof module == "object") // CommonJS
    mod(require("../../lib/codemirror"));
  else if (typeof define == "function" && define.amd) // AMD
    define(["../../lib/codemirror"], mod);
  else // Plain browser env
    mod(CodeMirror);
})(function(CodeMirror) {
"use strict";

function expressionAllowed(stream, state, backUp) {
  return /^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
    (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
}

CodeMirror.defineMode("javascript", function(config, parserConfig) {
  var indentUnit = config.indentUnit;
  var statementIndent = parserConfig.statementIndent;
  var jsonldMode = parserConfig.jsonld;
  var jsonMode = parserConfig.json || jsonldMode;
  var isTS = parserConfig.typescript;
  var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;

  // Tokenizer

  var keywords = function(){
    function kw(type) {return {type: type, style: "keyword"};}
    var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
    var operator = kw("operator"), atom = {type: "atom", style: "atom"};

    var jsKeywords = {
      "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
      "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C,
      "var": kw("var"), "const": kw("var"), "let": kw("var"),
      "function": kw("function"), "catch": kw("catch"),
      "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
      "in": operator, "typeof": operator, "instanceof": operator,
      "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
      "this": kw("this"), "class": kw("class"), "super": kw("atom"),
      "yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
      "await": C
    };

    // Extend the 'normal' keywords with the TypeScript language extensions
    if (isTS) {
      var type = {type: "variable", style: "type"};
      var tsKeywords = {
        // object-like things
        "interface": kw("class"),
        "implements": C,
        "namespace": C,
        "module": kw("module"),
        "enum": kw("module"),

        // scope modifiers
        "public": kw("modifier"),
        "private": kw("modifier"),
        "protected": kw("modifier"),
        "abstract": kw("modifier"),

        // types
        "string": type, "number": type, "boolean": type, "any": type
      };

      for (var attr in tsKeywords) {
        jsKeywords[attr] = tsKeywords[attr];
      }
    }

    return jsKeywords;
  }();

  var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
  var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;

  function readRegexp(stream) {
    var escaped = false, next, inSet = false;
    while ((next = stream.next()) != null) {
      if (!escaped) {
        if (next == "/" && !inSet) return;
        if (next == "[") inSet = true;
        else if (inSet && next == "]") inSet = false;
      }
      escaped = !escaped && next == "\\";
    }
  }

  // Used as scratch variables to communicate multiple values without
  // consing up tons of objects.
  var type, content;
  function ret(tp, style, cont) {
    type = tp; content = cont;
    return style;
  }
  function tokenBase(stream, state) {
    var ch = stream.next();
    if (ch == '"' || ch == "'") {
      state.tokenize = tokenString(ch);
      return state.tokenize(stream, state);
    } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) {
      return ret("number", "number");
    } else if (ch == "." && stream.match("..")) {
      return ret("spread", "meta");
    } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
      return ret(ch);
    } else if (ch == "=" && stream.eat(">")) {
      return ret("=>", "operator");
    } else if (ch == "0" && stream.eat(/x/i)) {
      stream.eatWhile(/[\da-f]/i);
      return ret("number", "number");
    } else if (ch == "0" && stream.eat(/o/i)) {
      stream.eatWhile(/[0-7]/i);
      return ret("number", "number");
    } else if (ch == "0" && stream.eat(/b/i)) {
      stream.eatWhile(/[01]/i);
      return ret("number", "number");
    } else if (/\d/.test(ch)) {
      stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
      return ret("number", "number");
    } else if (ch == "/") {
      if (stream.eat("*")) {
        state.tokenize = tokenComment;
        return tokenComment(stream, state);
      } else if (stream.eat("/")) {
        stream.skipToEnd();
        return ret("comment", "comment");
      } else if (expressionAllowed(stream, state, 1)) {
        readRegexp(stream);
        stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);
        return ret("regexp", "string-2");
      } else {
        stream.eatWhile(isOperatorChar);
        return ret("operator", "operator", stream.current());
      }
    } else if (ch == "`") {
      state.tokenize = tokenQuasi;
      return tokenQuasi(stream, state);
    } else if (ch == "#") {
      stream.skipToEnd();
      return ret("error", "error");
    } else if (isOperatorChar.test(ch)) {
      if (ch != ">" || !state.lexical || state.lexical.type != ">")
        stream.eatWhile(isOperatorChar);
      return ret("operator", "operator", stream.current());
    } else if (wordRE.test(ch)) {
      stream.eatWhile(wordRE);
      var word = stream.current()
      if (state.lastType != ".") {
        if (keywords.propertyIsEnumerable(word)) {
          var kw = keywords[word]
          return ret(kw.type, kw.style, word)
        }
        if (word == "async" && stream.match(/^\s*[\(\w]/, false))
          return ret("async", "keyword", word)
      }
      return ret("variable", "variable", word)
    }
  }

  function tokenString(quote) {
    return function(stream, state) {
      var escaped = false, next;
      if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){
        state.tokenize = tokenBase;
        return ret("jsonld-keyword", "meta");
      }
      while ((next = stream.next()) != null) {
        if (next == quote && !escaped) break;
        escaped = !escaped && next == "\\";
      }
      if (!escaped) state.tokenize = tokenBase;
      return ret("string", "string");
    };
  }

  function tokenComment(stream, state) {
    var maybeEnd = false, ch;
    while (ch = stream.next()) {
      if (ch == "/" && maybeEnd) {
        state.tokenize = tokenBase;
        break;
      }
      maybeEnd = (ch == "*");
    }
    return ret("comment", "comment");
  }

  function tokenQuasi(stream, state) {
    var escaped = false, next;
    while ((next = stream.next()) != null) {
      if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
        state.tokenize = tokenBase;
        break;
      }
      escaped = !escaped && next == "\\";
    }
    return ret("quasi", "string-2", stream.current());
  }

  var brackets = "([{}])";
  // This is a crude lookahead trick to try and notice that we're
  // parsing the argument patterns for a fat-arrow function before we
  // actually hit the arrow token. It only works if the arrow is on
  // the same line as the arguments and there's no strange noise
  // (comments) in between. Fallback is to only notice when we hit the
  // arrow, and not declare the arguments as locals for the arrow
  // body.
  function findFatArrow(stream, state) {
    if (state.fatArrowAt) state.fatArrowAt = null;
    var arrow = stream.string.indexOf("=>", stream.start);
    if (arrow < 0) return;

    if (isTS) { // Try to skip TypeScript return type declarations after the arguments
      var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow))
      if (m) arrow = m.index
    }

    var depth = 0, sawSomething = false;
    for (var pos = arrow - 1; pos >= 0; --pos) {
      var ch = stream.string.charAt(pos);
      var bracket = brackets.indexOf(ch);
      if (bracket >= 0 && bracket < 3) {
        if (!depth) { ++pos; break; }
        if (--depth == 0) { if (ch == "(") sawSomething = true; break; }
      } else if (bracket >= 3 && bracket < 6) {
        ++depth;
      } else if (wordRE.test(ch)) {
        sawSomething = true;
      } else if (/["'\/]/.test(ch)) {
        return;
      } else if (sawSomething && !depth) {
        ++pos;
        break;
      }
    }
    if (sawSomething && !depth) state.fatArrowAt = pos;
  }

  // Parser

  var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};

  function JSLexical(indented, column, type, align, prev, info) {
    this.indented = indented;
    this.column = column;
    this.type = type;
    this.prev = prev;
    this.info = info;
    if (align != null) this.align = align;
  }

  function inScope(state, varname) {
    for (var v = state.localVars; v; v = v.next)
      if (v.name == varname) return true;
    for (var cx = state.context; cx; cx = cx.prev) {
      for (var v = cx.vars; v; v = v.next)
        if (v.name == varname) return true;
    }
  }

  function parseJS(state, style, type, content, stream) {
    var cc = state.cc;
    // Communicate our context to the combinators.
    // (Less wasteful than consing up a hundred closures on every call.)
    cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;

    if (!state.lexical.hasOwnProperty("align"))
      state.lexical.align = true;

    while(true) {
      var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
      if (combinator(type, content)) {
        while(cc.length && cc[cc.length - 1].lex)
          cc.pop()();
        if (cx.marked) return cx.marked;
        if (type == "variable" && inScope(state, content)) return "variable-2";
        return style;
      }
    }
  }

  // Combinator utils

  var cx = {state: null, column: null, marked: null, cc: null};
  function pass() {
    for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
  }
  function cont() {
    pass.apply(null, arguments);
    return true;
  }
  function register(varname) {
    function inList(list) {
      for (var v = list; v; v = v.next)
        if (v.name == varname) return true;
      return false;
    }
    var state = cx.state;
    cx.marked = "def";
    if (state.context) {
      if (inList(state.localVars)) return;
      state.localVars = {name: varname, next: state.localVars};
    } else {
      if (inList(state.globalVars)) return;
      if (parserConfig.globalVars)
        state.globalVars = {name: varname, next: state.globalVars};
    }
  }

  // Combinators

  var defaultVars = {name: "this", next: {name: "arguments"}};
  function pushcontext() {
    cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
    cx.state.localVars = defaultVars;
  }
  function popcontext() {
    cx.state.localVars = cx.state.context.vars;
    cx.state.context = cx.state.context.prev;
  }
  function pushlex(type, info) {
    var result = function() {
      var state = cx.state, indent = state.indented;
      if (state.lexical.type == "stat") indent = state.lexical.indented;
      else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
        indent = outer.indented;
      state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);
    };
    result.lex = true;
    return result;
  }
  function poplex() {
    var state = cx.state;
    if (state.lexical.prev) {
      if (state.lexical.type == ")")
        state.indented = state.lexical.indented;
      state.lexical = state.lexical.prev;
    }
  }
  poplex.lex = true;

  function expect(wanted) {
    function exp(type) {
      if (type == wanted) return cont();
      else if (wanted == ";") return pass();
      else return cont(exp);
    };
    return exp;
  }

  function statement(type, value) {
    if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex);
    if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex);
    if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
    if (type == "{") return cont(pushlex("}"), block, poplex);
    if (type == ";") return cont();
    if (type == "if") {
      if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
        cx.state.cc.pop()();
      return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
    }
    if (type == "function") return cont(functiondef);
    if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
    if (type == "variable") {
      if (isTS && value == "type") {
        cx.marked = "keyword"
        return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
      } else {
        return cont(pushlex("stat"), maybelabel);
      }
    }
    if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"),
                                      block, poplex, poplex);
    if (type == "case") return cont(expression, expect(":"));
    if (type == "default") return cont(expect(":"));
    if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
                                     statement, poplex, popcontext);
    if (type == "class") return cont(pushlex("form"), className, poplex);
    if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
    if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
    if (type == "module") return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
    if (type == "async") return cont(statement)
    if (value == "@") return cont(expression, statement)
    return pass(pushlex("stat"), expression, expect(";"), poplex);
  }
  function expression(type) {
    return expressionInner(type, false);
  }
  function expressionNoComma(type) {
    return expressionInner(type, true);
  }
  function parenExpr(type) {
    if (type != "(") return pass()
    return cont(pushlex(")"), expression, expect(")"), poplex)
  }
  function expressionInner(type, noComma) {
    if (cx.state.fatArrowAt == cx.stream.start) {
      var body = noComma ? arrowBodyNoComma : arrowBody;
      if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext);
      else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
    }

    var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
    if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
    if (type == "function") return cont(functiondef, maybeop);
    if (type == "class") return cont(pushlex("form"), classExpression, poplex);
    if (type == "keyword c" || type == "async") return cont(noComma ? maybeexpressionNoComma : maybeexpression);
    if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
    if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
    if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
    if (type == "{") return contCommasep(objprop, "}", null, maybeop);
    if (type == "quasi") return pass(quasi, maybeop);
    if (type == "new") return cont(maybeTarget(noComma));
    return cont();
  }
  function maybeexpression(type) {
    if (type.match(/[;\}\)\],]/)) return pass();
    return pass(expression);
  }
  function maybeexpressionNoComma(type) {
    if (type.match(/[;\}\)\],]/)) return pass();
    return pass(expressionNoComma);
  }

  function maybeoperatorComma(type, value) {
    if (type == ",") return cont(expression);
    return maybeoperatorNoComma(type, value, false);
  }
  function maybeoperatorNoComma(type, value, noComma) {
    var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
    var expr = noComma == false ? expression : expressionNoComma;
    if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
    if (type == "operator") {
      if (/\+\+|--/.test(value)) return cont(me);
      if (value == "?") return cont(expression, expect(":"), expr);
      return cont(expr);
    }
    if (type == "quasi") { return pass(quasi, me); }
    if (type == ";") return;
    if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
    if (type == ".") return cont(property, me);
    if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
    if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) }
  }
  function quasi(type, value) {
    if (type != "quasi") return pass();
    if (value.slice(value.length - 2) != "${") return cont(quasi);
    return cont(expression, continueQuasi);
  }
  function continueQuasi(type) {
    if (type == "}") {
      cx.marked = "string-2";
      cx.state.tokenize = tokenQuasi;
      return cont(quasi);
    }
  }
  function arrowBody(type) {
    findFatArrow(cx.stream, cx.state);
    return pass(type == "{" ? statement : expression);
  }
  function arrowBodyNoComma(type) {
    findFatArrow(cx.stream, cx.state);
    return pass(type == "{" ? statement : expressionNoComma);
  }
  function maybeTarget(noComma) {
    return function(type) {
      if (type == ".") return cont(noComma ? targetNoComma : target);
      else return pass(noComma ? expressionNoComma : expression);
    };
  }
  function target(_, value) {
    if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); }
  }
  function targetNoComma(_, value) {
    if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); }
  }
  function maybelabel(type) {
    if (type == ":") return cont(poplex, statement);
    return pass(maybeoperatorComma, expect(";"), poplex);
  }
  function property(type) {
    if (type == "variable") {cx.marked = "property"; return cont();}
  }
  function objprop(type, value) {
    if (type == "async") {
      cx.marked = "property";
      return cont(objprop);
    } else if (type == "variable" || cx.style == "keyword") {
      cx.marked = "property";
      if (value == "get" || value == "set") return cont(getterSetter);
      return cont(afterprop);
    } else if (type == "number" || type == "string") {
      cx.marked = jsonldMode ? "property" : (cx.style + " property");
      return cont(afterprop);
    } else if (type == "jsonld-keyword") {
      return cont(afterprop);
    } else if (type == "modifier") {
      return cont(objprop)
    } else if (type == "[") {
      return cont(expression, expect("]"), afterprop);
    } else if (type == "spread") {
      return cont(expression, afterprop);
    } else if (type == ":") {
      return pass(afterprop)
    }
  }
  function getterSetter(type) {
    if (type != "variable") return pass(afterprop);
    cx.marked = "property";
    return cont(functiondef);
  }
  function afterprop(type) {
    if (type == ":") return cont(expressionNoComma);
    if (type == "(") return pass(functiondef);
  }
  function commasep(what, end, sep) {
    function proceed(type, value) {
      if (sep ? sep.indexOf(type) > -1 : type == ",") {
        var lex = cx.state.lexical;
        if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
        return cont(function(type, value) {
          if (type == end || value == end) return pass()
          return pass(what)
        }, proceed);
      }
      if (type == end || value == end) return cont();
      return cont(expect(end));
    }
    return function(type, value) {
      if (type == end || value == end) return cont();
      return pass(what, proceed);
    };
  }
  function contCommasep(what, end, info) {
    for (var i = 3; i < arguments.length; i++)
      cx.cc.push(arguments[i]);
    return cont(pushlex(end, info), commasep(what, end), poplex);
  }
  function block(type) {
    if (type == "}") return cont();
    return pass(statement, block);
  }
  function maybetype(type, value) {
    if (isTS) {
      if (type == ":") return cont(typeexpr);
      if (value == "?") return cont(maybetype);
    }
  }
  function typeexpr(type) {
    if (type == "variable") {cx.marked = "type"; return cont(afterType);}
    if (type == "string" || type == "number" || type == "atom") return cont(afterType);
    if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
    if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType)
  }
  function maybeReturnType(type) {
    if (type == "=>") return cont(typeexpr)
  }
  function typeprop(type, value) {
    if (type == "variable" || cx.style == "keyword") {
      cx.marked = "property"
      return cont(typeprop)
    } else if (value == "?") {
      return cont(typeprop)
    } else if (type == ":") {
      return cont(typeexpr)
    } else if (type == "[") {
      return cont(expression, maybetype, expect("]"), typeprop)
    }
  }
  function typearg(type) {
    if (type == "variable") return cont(typearg)
    else if (type == ":") return cont(typeexpr)
  }
  function afterType(type, value) {
    if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
    if (value == "|" || type == ".") return cont(typeexpr)
    if (type == "[") return cont(expect("]"), afterType)
    if (value == "extends") return cont(typeexpr)
  }
  function vardef() {
    return pass(pattern, maybetype, maybeAssign, vardefCont);
  }
  function pattern(type, value) {
    if (type == "modifier") return cont(pattern)
    if (type == "variable") { register(value); return cont(); }
    if (type == "spread") return cont(pattern);
    if (type == "[") return contCommasep(pattern, "]");
    if (type == "{") return contCommasep(proppattern, "}");
  }
  function proppattern(type, value) {
    if (type == "variable" && !cx.stream.match(/^\s*:/, false)) {
      register(value);
      return cont(maybeAssign);
    }
    if (type == "variable") cx.marked = "property";
    if (type == "spread") return cont(pattern);
    if (type == "}") return pass();
    return cont(expect(":"), pattern, maybeAssign);
  }
  function maybeAssign(_type, value) {
    if (value == "=") return cont(expressionNoComma);
  }
  function vardefCont(type) {
    if (type == ",") return cont(vardef);
  }
  function maybeelse(type, value) {
    if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
  }
  function forspec(type) {
    if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
  }
  function forspec1(type) {
    if (type == "var") return cont(vardef, expect(";"), forspec2);
    if (type == ";") return cont(forspec2);
    if (type == "variable") return cont(formaybeinof);
    return pass(expression, expect(";"), forspec2);
  }
  function formaybeinof(_type, value) {
    if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
    return cont(maybeoperatorComma, forspec2);
  }
  function forspec2(type, value) {
    if (type == ";") return cont(forspec3);
    if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
    return pass(expression, expect(";"), forspec3);
  }
  function forspec3(type) {
    if (type != ")") cont(expression);
  }
  function functiondef(type, value) {
    if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
    if (type == "variable") {register(value); return cont(functiondef);}
    if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, maybetype, statement, popcontext);
    if (isTS && value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, functiondef)
  }
  function funarg(type) {
    if (type == "spread") return cont(funarg);
    return pass(pattern, maybetype, maybeAssign);
  }
  function classExpression(type, value) {
    // Class expressions may have an optional name.
    if (type == "variable") return className(type, value);
    return classNameAfter(type, value);
  }
  function className(type, value) {
    if (type == "variable") {register(value); return cont(classNameAfter);}
  }
  function classNameAfter(type, value) {
    if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, classNameAfter)
    if (value == "extends" || value == "implements" || (isTS && type == ","))
      return cont(isTS ? typeexpr : expression, classNameAfter);
    if (type == "{") return cont(pushlex("}"), classBody, poplex);
  }
  function classBody(type, value) {
    if (type == "variable" || cx.style == "keyword") {
      if ((value == "async" || value == "static" || value == "get" || value == "set" ||
           (isTS && (value == "public" || value == "private" || value == "protected" || value == "readonly" || value == "abstract"))) &&
          cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false)) {
        cx.marked = "keyword";
        return cont(classBody);
      }
      cx.marked = "property";
      return cont(isTS ? classfield : functiondef, classBody);
    }
    if (type == "[")
      return cont(expression, expect("]"), isTS ? classfield : functiondef, classBody)
    if (value == "*") {
      cx.marked = "keyword";
      return cont(classBody);
    }
    if (type == ";") return cont(classBody);
    if (type == "}") return cont();
    if (value == "@") return cont(expression, classBody)
  }
  function classfield(type, value) {
    if (value == "?") return cont(classfield)
    if (type == ":") return cont(typeexpr, maybeAssign)
    if (value == "=") return cont(expressionNoComma)
    return pass(functiondef)
  }
  function afterExport(type, value) {
    if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
    if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
    if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";"));
    return pass(statement);
  }
  function exportField(type, value) {
    if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); }
    if (type == "variable") return pass(expressionNoComma, exportField);
  }
  function afterImport(type) {
    if (type == "string") return cont();
    return pass(importSpec, maybeMoreImports, maybeFrom);
  }
  function importSpec(type, value) {
    if (type == "{") return contCommasep(importSpec, "}");
    if (type == "variable") register(value);
    if (value == "*") cx.marked = "keyword";
    return cont(maybeAs);
  }
  function maybeMoreImports(type) {
    if (type == ",") return cont(importSpec, maybeMoreImports)
  }
  function maybeAs(_type, value) {
    if (value == "as") { cx.marked = "keyword"; return cont(importSpec); }
  }
  function maybeFrom(_type, value) {
    if (value == "from") { cx.marked = "keyword"; return cont(expression); }
  }
  function arrayLiteral(type) {
    if (type == "]") return cont();
    return pass(commasep(expressionNoComma, "]"));
  }

  function isContinuedStatement(state, textAfter) {
    return state.lastType == "operator" || state.lastType == "," ||
      isOperatorChar.test(textAfter.charAt(0)) ||
      /[,.]/.test(textAfter.charAt(0));
  }

  // Interface

  return {
    startState: function(basecolumn) {
      var state = {
        tokenize: tokenBase,
        lastType: "sof",
        cc: [],
        lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
        localVars: parserConfig.localVars,
        context: parserConfig.localVars && {vars: parserConfig.localVars},
        indented: basecolumn || 0
      };
      if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
        state.globalVars = parserConfig.globalVars;
      return state;
    },

    token: function(stream, state) {
      if (stream.sol()) {
        if (!state.lexical.hasOwnProperty("align"))
          state.lexical.align = false;
        state.indented = stream.indentation();
        findFatArrow(stream, state);
      }
      if (state.tokenize != tokenComment && stream.eatSpace()) return null;
      var style = state.tokenize(stream, state);
      if (type == "comment") return style;
      state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;
      return parseJS(state, style, type, content, stream);
    },

    indent: function(state, textAfter) {
      if (state.tokenize == tokenComment) return CodeMirror.Pass;
      if (state.tokenize != tokenBase) return 0;
      var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top
      // Kludge to prevent 'maybelse' from blocking lexical scope pops
      if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
        var c = state.cc[i];
        if (c == poplex) lexical = lexical.prev;
        else if (c != maybeelse) break;
      }
      while ((lexical.type == "stat" || lexical.type == "form") &&
             (firstChar == "}" || ((top = state.cc[state.cc.length - 1]) &&
                                   (top == maybeoperatorComma || top == maybeoperatorNoComma) &&
                                   !/^[,\.=+\-*:?[\(]/.test(textAfter))))
        lexical = lexical.prev;
      if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")
        lexical = lexical.prev;
      var type = lexical.type, closing = firstChar == type;

      if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0);
      else if (type == "form" && firstChar == "{") return lexical.indented;
      else if (type == "form") return lexical.indented + indentUnit;
      else if (type == "stat")
        return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);
      else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)
        return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
      else if (lexical.align) return lexical.column + (closing ? 0 : 1);
      else return lexical.indented + (closing ? 0 : indentUnit);
    },

    electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
    blockCommentStart: jsonMode ? null : "/*",
    blockCommentEnd: jsonMode ? null : "*/",
    lineComment: jsonMode ? null : "//",
    fold: "brace",
    closeBrackets: "()[]{}''\"\"``",

    helperType: jsonMode ? "json" : "javascript",
    jsonldMode: jsonldMode,
    jsonMode: jsonMode,

    expressionAllowed: expressionAllowed,
    skipExpression: function(state) {
      var top = state.cc[state.cc.length - 1]
      if (top == expression || top == expressionNoComma) state.cc.pop()
    }
  };
});

CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/);

CodeMirror.defineMIME("text/javascript", "javascript");
CodeMirror.defineMIME("text/ecmascript", "javascript");
CodeMirror.defineMIME("application/javascript", "javascript");
CodeMirror.defineMIME("application/x-javascript", "javascript");
CodeMirror.defineMIME("application/ecmascript", "javascript");
CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true});
CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true});
CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });

});

================================================
FILE: docs/editor/mode/javascript/typescript.html
================================================
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>CodeMirror: TypeScript mode</title>
    <link rel="stylesheet" href="../../lib/codemirror.css">
    <script src="../../lib/codemirror.js"></script>
    <script src="javascript.js"></script>
    <link rel="stylesheet" href="../../doc/docs.css">
    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  </head>
  <body>
    <h1>CodeMirror: TypeScript mode</h1>

<div><textarea id="code" name="code">
class Greeter {
	greeting: string;
	constructor (message: string) {
		this.greeting = message;
	}
	greet() {
		return "Hello, " + this.greeting;
	}
}   

var greeter = new Greeter("world");

var button = document.createElement('button')
button.innerText = "Say Hello"
button.onclick = function() {
	alert(greeter.greet())
}

document.body.appendChild(button)

</textarea></div>

    <script>
      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
        lineNumbers: true,
        matchBrackets: true,
        mode: "text/typescript"
      });
    </script>

    <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
  </body>
</html>


================================================
FILE: docs/editor/mode/urduscript/urduscript.js
================================================
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

(function(mod) {
  if (typeof exports == "object" && typeof module == "object") // CommonJS
    mod(require("../../lib/codemirror"));
  else if (typeof define == "function" && define.amd) // AMD
    define(["../../lib/codemirror"], mod);
  else // Plain browser env
    mod(CodeMirror);
})(function(CodeMirror) {
"use strict";

function expressionAllowed(stream, state, backUp) {
  return /^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
    (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
}

CodeMirror.defineMode("javascript", function(config, parserConfig) {
  var indentUnit = config.indentUnit;
  var statementIndent = parserConfig.statementIndent;
  var jsonldMode = parserConfig.jsonld;
  var jsonMode = parserConfig.json || jsonldMode;
  var isTS = parserConfig.typescript;
  var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;

  // Tokenizer

  var keywords = function(){
    function kw(type) {return {type: type, style: "keyword"};}
    var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
    var operator = kw("operator"), atom = {type: "atom", style: "atom"};

    var jsKeywords = {
      "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
      "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C,
      "var": kw("var"), "const": kw("var"), "let": kw("var"),
      "function": kw("function"), "catch": kw("catch"),
      "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
      "in": operator, "typeof": operator, "instanceof": operator,
      "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
      "this": kw("this"), "class": kw("class"), "super": kw("atom"),
      "yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
      "await": C,
      //urduscript additions:
      "agar": kw("if"), "karo": B, "jabtak": A, "warna": B, "warnaagar": B,
      "rakho": kw("var"), "likho": A, "pucho": A,
      "sahi": atom, "galat": atom, "ghalat": atom, "khali": atom, "khaali": atom,
      "kaam": kw("function"), "har": kw("for"), "k": A, "per": A, "pe": A,
      "bhejo": C, "rukjao": C
    };

    // Extend the 'normal' keywords with the TypeScript language extensions
    if (isTS) {
      var type = {type: "variable", style: "type"};
      var tsKeywords = {
        // object-like things
        "interface": kw("class"),
        "implements": C,
        "namespace": C,
        "module": kw("module"),
        "enum": kw("module"),

        // scope modifiers
        "public": kw("modifier"),
        "private": kw("modifier"),
        "protected": kw("modifier"),
        "abstract": kw("modifier"),

        // types
        "string": type, "number": type, "boolean": type, "any": type
      };

      for (var attr in tsKeywords) {
        jsKeywords[attr] = tsKeywords[attr];
      }
    }

    return jsKeywords;
  }();

  var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
  var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;

  function readRegexp(stream) {
    var escaped = false, next, inSet = false;
    while ((next = stream.next()) != null) {
      if (!escaped) {
        if (next == "/" && !inSet) return;
        if (next == "[") inSet = true;
        else if (inSet && next == "]") inSet = false;
      }
      escaped = !escaped && next == "\\";
    }
  }

  // Used as scratch variables to communicate multiple values without
  // consing up tons of objects.
  var type, content;
  function ret(tp, style, cont) {
    type = tp; content = cont;
    return style;
  }
  function tokenBase(stream, state) {
    var ch = stream.next();
    if (ch == '"' || ch == "'") {
      state.tokenize = tokenString(ch);
      return state.tokenize(stream, state);
    } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) {
      return ret("number", "number");
    } else if (ch == "." && stream.match("..")) {
      return ret("spread", "meta");
    } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
      return ret(ch);
    } else if (ch == "=" && stream.eat(">")) {
      return ret("=>", "operator");
    } else if (ch == "0" && stream.eat(/x/i)) {
      stream.eatWhile(/[\da-f]/i);
      return ret("number", "number");
    } else if (ch == "0" && stream.eat(/o/i)) {
      stream.eatWhile(/[0-7]/i);
      return ret("number", "number");
    } else if (ch == "0" && stream.eat(/b/i)) {
      stream.eatWhile(/[01]/i);
      return ret("number", "number");
    } else if (/\d/.test(ch)) {
      stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
      return ret("number", "number");
    } else if (ch == "/") {
      if (stream.eat("*")) {
        state.tokenize = tokenComment;
        return tokenComment(stream, state);
      } else if (stream.eat("/")) {
        stream.skipToEnd();
        return ret("comment", "comment");
      } else if (expressionAllowed(stream, state, 1)) {
        readRegexp(stream);
        stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);
        return ret("regexp", "string-2");
      } else {
        stream.eatWhile(isOperatorChar);
        return ret("operator", "operator", stream.current());
      }
    } else if (ch == "`") {
      state.tokenize = tokenQuasi;
      return tokenQuasi(stream, state);
    } else if (ch == "#") {
      stream.skipToEnd();
      return ret("error", "error");
    } else if (isOperatorChar.test(ch)) {
      if (ch != ">" || !state.lexical || state.lexical.type != ">")
        stream.eatWhile(isOperatorChar);
      return ret("operator", "operator", stream.current());
    } else if (wordRE.test(ch)) {
      stream.eatWhile(wordRE);
      var word = stream.current()
      if (state.lastType != ".") {
        if (keywords.propertyIsEnumerable(word)) {
          var kw = keywords[word]
          return ret(kw.type, kw.style, word)
        }
        if (word == "async" && stream.match(/^\s*[\(\w]/, false))
          return ret("async", "keyword", word)
      }
      return ret("variable", "variable", word)
    }
  }

  function tokenString(quote) {
    return function(stream, state) {
      var escaped = false, next;
      if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){
        state.tokenize = tokenBase;
        return ret("jsonld-keyword", "meta");
      }
      while ((next = stream.next()) != null) {
        if (next == quote && !escaped) break;
        escaped = !escaped && next == "\\";
      }
      if (!escaped) state.tokenize = tokenBase;
      return ret("string", "string");
    };
  }

  function tokenComment(stream, state) {
    var maybeEnd = false, ch;
    while (ch = stream.next()) {
      if (ch == "/" && maybeEnd) {
        state.tokenize = tokenBase;
        break;
      }
      maybeEnd = (ch == "*");
    }
    return ret("comment", "comment");
  }

  function tokenQuasi(stream, state) {
    var escaped = false, next;
    while ((next = stream.next()) != null) {
      if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
        state.tokenize = tokenBase;
        break;
      }
      escaped = !escaped && next == "\\";
    }
    return ret("quasi", "string-2", stream.current());
  }

  var brackets = "([{}])";
  // This is a crude lookahead trick to try and notice that we're
  // parsing the argument patterns for a fat-arrow function before we
  // actually hit the arrow token. It only works if the arrow is on
  // the same line as the arguments and there's no strange noise
  // (comments) in between. Fallback is to only notice when we hit the
  // arrow, and not declare the arguments as locals for the arrow
  // body.
  function findFatArrow(stream, state) {
    if (state.fatArrowAt) state.fatArrowAt = null;
    var arrow = stream.string.indexOf("=>", stream.start);
    if (arrow < 0) return;

    if (isTS) { // Try to skip TypeScript return type declarations after the arguments
      var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow))
      if (m) arrow = m.index
    }

    var depth = 0, sawSomething = false;
    for (var pos = arrow - 1; pos >= 0; --pos) {
      var ch = stream.string.charAt(pos);
      var bracket = brackets.indexOf(ch);
      if (bracket >= 0 && bracket < 3) {
        if (!depth) { ++pos; break; }
        if (--depth == 0) { if (ch == "(") sawSomething = true; break; }
      } else if (bracket >= 3 && bracket < 6) {
        ++depth;
      } else if (wordRE.test(ch)) {
        sawSomething = true;
      } else if (/["'\/]/.test(ch)) {
        return;
      } else if (sawSomething && !depth) {
        ++pos;
        break;
      }
    }
    if (sawSomething && !depth) state.fatArrowAt = pos;
  }

  // Parser

  var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};

  function JSLexical(indented, column, type, align, prev, info) {
    this.indented = indented;
    this.column = column;
    this.type = type;
    this.prev = prev;
    this.info = info;
    if (align != null) this.align = align;
  }

  function inScope(state, varname) {
    for (var v = state.localVars; v; v = v.next)
      if (v.name == varname) return true;
    for (var cx = state.context; cx; cx = cx.prev) {
      for (var v = cx.vars; v; v = v.next)
        if (v.name == varname) return true;
    }
  }

  function parseJS(state, style, type, content, stream) {
    var cc = state.cc;
    // Communicate our context to the combinators.
    // (Less wasteful than consing up a hundred closures on every call.)
    cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;

    if (!state.lexical.hasOwnProperty("align"))
      state.lexical.align = true;

    while(true) {
      var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
      if (combinator(type, content)) {
        while(cc.length && cc[cc.length - 1].lex)
          cc.pop()();
        if (cx.marked) return cx.marked;
        if (type == "variable" && inScope(state, content)) return "variable-2";
        return style;
      }
    }
  }

  // Combinator utils

  var cx = {state: null, column: null, marked: null, cc: null};
  function pass() {
    for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
  }
  function cont() {
    pass.apply(null, arguments);
    return true;
  }
  function register(varname) {
    function inList(list) {
      for (var v = list; v; v = v.next)
        if (v.name == varname) return true;
      return false;
    }
    var state = cx.state;
    cx.marked = "def";
    if (state.context) {
      if (inList(state.localVars)) return;
      state.localVars = {name: varname, next: state.localVars};
    } else {
      if (inList(state.globalVars)) return;
      if (parserConfig.globalVars)
        state.globalVars = {name: varname, next: state.globalVars};
    }
  }

  // Combinators

  var defaultVars = {name: "this", next: {name: "arguments"}};
  function pushcontext() {
    cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
    cx.state.localVars = defaultVars;
  }
  function popcontext() {
    cx.state.localVars = cx.state.context.vars;
    cx.state.context = cx.state.context.prev;
  }
  function pushlex(type, info) {
    var result = function() {
      var state = cx.state, indent = state.indented;
      if (state.lexical.type == "stat") indent = state.lexical.indented;
      else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
        indent = outer.indented;
      state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);
    };
    result.lex = true;
    return result;
  }
  function poplex() {
    var state = cx.state;
    if (state.lexical.prev) {
      if (state.lexical.type == ")")
        state.indented = state.lexical.indented;
      state.lexical = state.lexical.prev;
    }
  }
  poplex.lex = true;

  function expect(wanted) {
    function exp(type) {
      if (type == wanted) return cont();
      else if (wanted == ";") return pass();
      else return cont(exp);
    };
    return exp;
  }

  function statement(type, value) {
    if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex);
    if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex);
    if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
    if (type == "{") return cont(pushlex("}"), block, poplex);
    if (type == ";") return cont();
    if (type == "if") {
      if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
        cx.state.cc.pop()();
      return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
    }
    if (type == "function") return cont(functiondef);
    if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
    if (type == "variable") {
      if (isTS && value == "type") {
        cx.marked = "keyword"
        return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
      } else {
        return cont(pushlex("stat"), maybelabel);
      }
    }
    if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"),
                                      block, poplex, poplex);
    if (type == "case") return cont(expression, expect(":"));
    if (type == "default") return cont(expect(":"));
    if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
                                     statement, poplex, popcontext);
    if (type == "class") return cont(pushlex("form"), className, poplex);
    if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
    if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
    if (type == "module") return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
    if (type == "async") return cont(statement)
    if (value == "@") return cont(expression, statement)
    return pass(pushlex("stat"), expression, expect(";"), poplex);
  }
  function expression(type) {
    return expressionInner(type, false);
  }
  function expressionNoComma(type) {
    return expressionInner(type, true);
  }
  function parenExpr(type) {
    if (type != "(") return pass()
    return cont(pushlex(")"), expression, expect(")"), poplex)
  }
  function expressionInner(type, noComma) {
    if (cx.state.fatArrowAt == cx.stream.start) {
      var body = noComma ? arrowBodyNoComma : arrowBody;
      if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext);
      else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
    }

    var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
    if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
    if (type == "function") return cont(functiondef, maybeop);
    if (type == "class") return cont(pushlex("form"), classExpression, poplex);
    if (type == "keyword c" || type == "async") return cont(noComma ? maybeexpressionNoComma : maybeexpression);
    if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
    if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
    if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
    if (type == "{") return contCommasep(objprop, "}", null, maybeop);
    if (type == "quasi") return pass(quasi, maybeop);
    if (type == "new") return cont(maybeTarget(noComma));
    return cont();
  }
  function maybeexpression(type) {
    if (type.match(/[;\}\)\],]/)) return pass();
    return pass(expression);
  }
  function maybeexpressionNoComma(type) {
    if (type.match(/[;\}\)\],]/)) return pass();
    return pass(expressionNoComma);
  }

  function maybeoperatorComma(type, value) {
    if (type == ",") return cont(expression);
    return maybeoperatorNoComma(type, value, false);
  }
  function maybeoperatorNoComma(type, value, noComma) {
    var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
    var expr = noComma == false ? expression : expressionNoComma;
    if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
    if (type == "operator") {
      if (/\+\+|--/.test(value)) return cont(me);
      if (value == "?") return cont(expression, expect(":"), expr);
      return cont(expr);
    }
    if (type == "quasi") { return pass(quasi, me); }
    if (type == ";") return;
    if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
    if (type == ".") return cont(property, me);
    if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
    if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) }
  }
  function quasi(type, value) {
    if (type != "quasi") return pass();
    if (value.slice(value.length - 2) != "${") return cont(quasi);
    return cont(expression, continueQuasi);
  }
  function continueQuasi(type) {
    if (type == "}") {
      cx.marked = "string-2";
      cx.state.tokenize = tokenQuasi;
      return cont(quasi);
    }
  }
  function arrowBody(type) {
    findFatArrow(cx.stream, cx.state);
    return pass(type == "{" ? statement : expression);
  }
  function arrowBodyNoComma(type) {
    findFatArrow(cx.stream, cx.state);
    return pass(type == "{" ? statement : expressionNoComma);
  }
  function maybeTarget(noComma) {
    return function(type) {
      if (type == ".") return cont(noComma ? targetNoComma : target);
      else return pass(noComma ? expressionNoComma : expression);
    };
  }
  function target(_, value) {
    if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); }
  }
  function targetNoComma(_, value) {
    if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); }
  }
  function maybelabel(type) {
    if (type == ":") return cont(poplex, statement);
    return pass(maybeoperatorComma, expect(";"), poplex);
  }
  function property(type) {
    if (type == "variable") {cx.marked = "property"; return cont();}
  }
  function objprop(type, value) {
    if (type == "async") {
      cx.marked = "property";
      return cont(objprop);
    } else if (type == "variable" || cx.style == "keyword") {
      cx.marked = "property";
      if (value == "get" || value == "set") return cont(getterSetter);
      return cont(afterprop);
    } else if (type == "number" || type == "string") {
      cx.marked = jsonldMode ? "property" : (cx.style + " property");
      return cont(afterprop);
    } else if (type == "jsonld-keyword") {
      return cont(afterprop);
    } else if (type == "modifier") {
      return cont(objprop)
    } else if (type == "[") {
      return cont(expression, expect("]"), afterprop);
    } else if (type == "spread") {
      return cont(expression, afterprop);
    } else if (type == ":") {
      return pass(afterprop)
    }
  }
  function getterSetter(type) {
    if (type != "variable") return pass(afterprop);
    cx.marked = "property";
    return cont(functiondef);
  }
  function afterprop(type) {
    if (type == ":") return cont(expressionNoComma);
    if (type == "(") return pass(functiondef);
  }
  function commasep(what, end, sep) {
    function proceed(type, value) {
      if (sep ? sep.indexOf(type) > -1 : type == ",") {
        var lex = cx.state.lexical;
        if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
        return cont(function(type, value) {
          if (type == end || value == end) return pass()
          return pass(what)
        }, proceed);
      }
      if (type == end || value == end) return cont();
      return cont(expect(end));
    }
    return function(type, value) {
      if (type == end || value == end) return cont();
      return pass(what, proceed);
    };
  }
  function contCommasep(what, end, info) {
    for (var i = 3; i < arguments.length; i++)
      cx.cc.push(arguments[i]);
    return cont(pushlex(end, info), commasep(what, end), poplex);
  }
  function block(type) {
    if (type == "}") return cont();
    return pass(statement, block);
  }
  function maybetype(type, value) {
    if (isTS) {
      if (type == ":") return cont(typeexpr);
      if (value == "?") return cont(maybetype);
    }
  }
  function typeexpr(type) {
    if (type == "variable") {cx.marked = "type"; return cont(afterType);}
    if (type == "string" || type == "number" || type == "atom") return cont(afterType);
    if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
    if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType)
  }
  function maybeReturnType(type) {
    if (type == "=>") return cont(typeexpr)
  }
  function typeprop(type, value) {
    if (type == "variable" || cx.style == "keyword") {
      cx.marked = "property"
      return cont(typeprop)
    } else if (value == "?") {
      return cont(typeprop)
    } else if (type == ":") {
      return cont(typeexpr)
    } else if (type == "[") {
      return cont(expression, maybetype, expect("]"), typeprop)
    }
  }
  function typearg(type) {
    if (type == "variable") return cont(typearg)
    else if (type == ":") return cont(typeexpr)
  }
  function afterType(type, value) {
    if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
    if (value == "|" || type == ".") return cont(typeexpr)
    if (type == "[") return cont(expect("]"), afterType)
    if (value == "extends") return cont(typeexpr)
  }
  function vardef() {
    return pass(pattern, maybetype, maybeAssign, vardefCont);
  }
  function pattern(type, value) {
    if (type == "modifier") return cont(pattern)
    if (type == "variable") { register(value); return cont(); }
    if (type == "spread") return cont(pattern);
    if (type == "[") return contCommasep(pattern, "]");
    if (type == "{") return contCommasep(proppattern, "}");
  }
  function proppattern(type, value) {
    if (type == "variable" && !cx.stream.match(/^\s*:/, false)) {
      register(value);
      return cont(maybeAssign);
    }
    if (type == "variable") cx.marked = "property";
    if (type == "spread") return cont(pattern);
    if (type == "}") return pass();
    return cont(expect(":"), pattern, maybeAssign);
  }
  function maybeAssign(_type, value) {
    if (value == "=") return cont(expressionNoComma);
  }
  function vardefCont(type) {
    if (type == ",") return cont(vardef);
  }
  function maybeelse(type, value) {
    if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
  }
  function forspec(type) {
    if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
  }
  function forspec1(type) {
    if (type == "var") return cont(vardef, expect(";"), forspec2);
    if (type == ";") return cont(forspec2);
    if (type == "variable") return cont(formaybeinof);
    return pass(expression, expect(";"), forspec2);
  }
  function formaybeinof(_type, value) {
    if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
    return cont(maybeoperatorComma, forspec2);
  }
  function forspec2(type, value) {
    if (type == ";") return cont(forspec3);
    if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
    return pass(expression, expect(";"), forspec3);
  }
  function forspec3(type) {
    if (type != ")") cont(expression);
  }
  function functiondef(type, value) {
    if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
    if (type == "variable") {register(value); return cont(functiondef);}
    if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, maybetype, statement, popcontext);
    if (isTS && value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, functiondef)
  }
  function funarg(type) {
    if (type == "spread") return cont(funarg);
    return pass(pattern, maybetype, maybeAssign);
  }
  function classExpression(type, value) {
    // Class expressions may have an optional name.
    if (type == "variable") return className(type, value);
    return classNameAfter(type, value);
  }
  function className(type, value) {
    if (type == "variable") {register(value); return cont(classNameAfter);}
  }
  function classNameAfter(type, value) {
    if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, classNameAfter)
    if (value == "extends" || value == "implements" || (isTS && type == ","))
      return cont(isTS ? typeexpr : expression, classNameAfter);
    if (type == "{") return cont(pushlex("}"), classBody, poplex);
  }
  function classBody(type, value) {
    if (type == "variable" || cx.style == "keyword") {
      if ((value == "async" || value == "static" || value == "get" || value == "set" ||
           (isTS && (value == "public" || value == "private" || value == "protected" || value == "readonly" || value == "abstract"))) &&
          cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false)) {
        cx.marked = "keyword";
        return cont(classBody);
      }
      cx.marked = "property";
      return cont(isTS ? classfield : functiondef, classBody);
    }
    if (type == "[")
      return cont(expression, expect("]"), isTS ? classfield : functiondef, classBody)
    if (value == "*") {
      cx.marked = "keyword";
      return cont(classBody);
    }
    if (type == ";") return cont(classBody);
    if (type == "}") return cont();
    if (value == "@") return cont(expression, classBody)
  }
  function classfield(type, value) {
    if (value == "?") return cont(classfield)
    if (type == ":") return cont(typeexpr, maybeAssign)
    if (value == "=") return cont(expressionNoComma)
    return pass(functiondef)
  }
  function afterExport(type, value) {
    if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
    if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
    if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";"));
    return pass(statement);
  }
  function exportField(type, value) {
    if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); }
    if (type == "variable") return pass(expressionNoComma, exportField);
  }
  function afterImport(type) {
    if (type == "string") return cont();
    return pass(importSpec, maybeMoreImports, maybeFrom);
  }
  function importSpec(type, value) {
    if (type == "{") return contCommasep(importSpec, "}");
    if (type == "variable") register(value);
    if (value == "*") cx.marked = "keyword";
    return cont(maybeAs);
  }
  function maybeMoreImports(type) {
    if (type == ",") return cont(importSpec, maybeMoreImports)
  }
  function maybeAs(_type, value) {
    if (value == "as") { cx.marked = "keyword"; return cont(importSpec); }
  }
  function maybeFrom(_type, value) {
    if (value == "from") { cx.marked = "keyword"; return cont(expression); }
  }
  function arrayLiteral(type) {
    if (type == "]") return cont();
    return pass(commasep(expressionNoComma, "]"));
  }

  function isContinuedStatement(state, textAfter) {
    return state.lastType == "operator" || state.lastType == "," ||
      isOperatorChar.test(textAfter.charAt(0)) ||
      /[,.]/.test(textAfter.charAt(0));
  }

  // Interface

  return {
    startState: function(basecolumn) {
      var state = {
        tokenize: tokenBase,
        lastType: "sof",
        cc: [],
        lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
        localVars: parserConfig.localVars,
        context: parserConfig.localVars && {vars: parserConfig.localVars},
        indented: basecolumn || 0
      };
      if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
        state.globalVars = parserConfig.globalVars;
      return state;
    },

    token: function(stream, state) {
      if (stream.sol()) {
        if (!state.lexical.hasOwnProperty("align"))
          state.lexical.align = false;
        state.indented = stream.indentation();
        findFatArrow(stream, state);
      }
      if (state.tokenize != tokenComment && stream.eatSpace()) return null;
      var style = state.tokenize(stream, state);
      if (type == "comment") return style;
      state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;
      return parseJS(state, style, type, content, stream);
    },

    indent: function(state, textAfter) {
      if (state.tokenize == tokenComment) return CodeMirror.Pass;
      if (state.tokenize != tokenBase) return 0;
      var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top
      // Kludge to prevent 'maybelse' from blocking lexical scope pops
      if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
        var c = state.cc[i];
        if (c == poplex) lexical = lexical.prev;
        else if (c != maybeelse) break;
      }
      while ((lexical.type == "stat" || lexical.type == "form") &&
             (firstChar == "}" || ((top = state.cc[state.cc.length - 1]) &&
                                   (top == maybeoperatorComma || top == maybeoperatorNoComma) &&
                                   !/^[,\.=+\-*:?[\(]/.test(textAfter))))
        lexical = lexical.prev;
      if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")
        lexical = lexical.prev;
      var type = lexical.type, closing = firstChar == type;

      if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0);
      else if (type == "form" && firstChar == "{") return lexical.indented;
      else if (type == "form") return lexical.indented + indentUnit;
      else if (type == "stat")
        return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);
      else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)
        return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
      else if (lexical.align) return lexical.column + (closing ? 0 : 1);
      else return lexical.indented + (closing ? 0 : indentUnit);
    },

    electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
    blockCommentStart: jsonMode ? null : "/*",
    blockCommentEnd: jsonMode ? null : "*/",
    lineComment: jsonMode ? null : "//",
    fold: "brace",
    closeBrackets: "()[]{}''\"\"``",

    helperType: jsonMode ? "json" : "javascript",
    jsonldMode: jsonldMode,
    jsonMode: jsonMode,

    expressionAllowed: expressionAllowed,
    skipExpression: function(state) {
      var top = state.cc[state.cc.length - 1]
      if (top == expression || top == expressionNoComma) state.cc.pop()
    }
  };
});

CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/);

CodeMirror.defineMIME("text/javascript", "javascript");
CodeMirror.defineMIME("text/ecmascript", "javascript");
CodeMirror.defineMIME("application/javascript", "javascript");
CodeMirror.defineMIME("application/x-javascript", "javascript");
CodeMirror.defineMIME("application/ecmascript", "javascript");
CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true});
CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true});
CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });

});

================================================
FILE: docs/editor/scripts/codemirror.js
================================================
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

// This is CodeMirror (http://codemirror.net), a code editor
// implemented in JavaScript on top of the browser's DOM.
//
// You can find some technical background for some of the code below
// at http://marijnhaverbeke.nl/blog/#cm-internals .

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  typeof define === 'function' && define.amd ? define(factory) :
  (global.CodeMirror = factory());
}(this, (function () { 'use strict';

// Kludges for bugs and behavior differences that can't be feature
// detected are enabled based on userAgent etc sniffing.
var userAgent = navigator.userAgent
var platform = navigator.platform

var gecko = /gecko\/\d/i.test(userAgent)
var ie_upto10 = /MSIE \d/.test(userAgent)
var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent)
var edge = /Edge\/(\d+)/.exec(userAgent)
var ie = ie_upto10 || ie_11up || edge
var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1])
var webkit = !edge && /WebKit\//.test(userAgent)
var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent)
var chrome = !edge && /Chrome\//.test(userAgent)
var presto = /Opera\//.test(userAgent)
var safari = /Apple Computer/.test(navigator.vendor)
var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent)
var phantom = /PhantomJS/.test(userAgent)

var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent)
var android = /Android/.test(userAgent)
// This is woefully incomplete. Suggestions for alternative methods welcome.
var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)
var mac = ios || /Mac/.test(platform)
var chromeOS = /\bCrOS\b/.test(userAgent)
var windows = /win/i.test(platform)

var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/)
if (presto_version) { presto_version = Number(presto_version[1]) }
if (presto_version && presto_version >= 15) { presto = false; webkit = true }
// Some browsers use the wrong event properties to signal cmd/ctrl on OS X
var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11))
var captureRightClick = gecko || (ie && ie_version >= 9)

function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") }

var rmClass = function(node, cls) {
  var current = node.className
  var match = classTest(cls).exec(current)
  if (match) {
    var after = current.slice(match.index + match[0].length)
    node.className = current.slice(0, match.index) + (after ? match[1] + after : "")
  }
}

function removeChildren(e) {
  for (var count = e.childNodes.length; count > 0; --count)
    { e.removeChild(e.firstChild) }
  return e
}

function removeChildrenAndAdd(parent, e) {
  return removeChildren(parent).appendChild(e)
}

function elt(tag, content, className, style) {
  var e = document.createElement(tag)
  if (className) { e.className = className }
  if (style) { e.style.cssText = style }
  if (typeof content == "string") { e.appendChild(document.createTextNode(content)) }
  else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } }
  return e
}
// wrapper for elt, which removes the elt from the accessibility tree
function eltP(tag, content, className, style) {
  var e = elt(tag, content, className, style)
  e.setAttribute("role", "presentation")
  return e
}

var range
if (document.createRange) { range = function(node, start, end, endNode) {
  var r = document.createRange()
  r.setEnd(endNode || node, end)
  r.setStart(node, start)
  return r
} }
else { range = function(node, start, end) {
  var r = document.body.createTextRange()
  try { r.moveToElementText(node.parentNode) }
  catch(e) { return r }
  r.collapse(true)
  r.moveEnd("character", end)
  r.moveStart("character", start)
  return r
} }

function contains(parent, child) {
  if (child.nodeType == 3) // Android browser always returns false when child is a textnode
    { child = child.parentNode }
  if (parent.contains)
    { return parent.contains(child) }
  do {
    if (child.nodeType == 11) { child = child.host }
    if (child == parent) { return true }
  } while (child = child.parentNode)
}

function activeElt() {
  // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement.
  // IE < 10 will throw when accessed while the page is loading or in an iframe.
  // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.
  var activeElement
  try {
    activeElement = document.activeElement
  } catch(e) {
    activeElement = document.body || null
  }
  while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)
    { activeElement = activeElement.shadowRoot.activeElement }
  return activeElement
}

function addClass(node, cls) {
  var current = node.className
  if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls }
}
function joinClasses(a, b) {
  var as = a.split(" ")
  for (var i = 0; i < as.length; i++)
    { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i] } }
  return b
}

var selectInput = function(node) { node.select() }
if (ios) // Mobile Safari apparently has a bug where select() is broken.
  { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } }
else if (ie) // Suppress mysterious IE10 errors
  { selectInput = function(node) { try { node.select() } catch(_e) {} } }

function bind(f) {
  var args = Array.prototype.slice.call(arguments, 1)
  return function(){return f.apply(null, args)}
}

function copyObj(obj, target, overwrite) {
  if (!target) { target = {} }
  for (var prop in obj)
    { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
      { target[prop] = obj[prop] } }
  return target
}

// Counts the column offset in a string, taking tabs into account.
// Used mostly to find indentation.
function countColumn(string, end, tabSize, startIndex, startValue) {
  if (end == null) {
    end = string.search(/[^\s\u00a0]/)
    if (end == -1) { end = string.length }
  }
  for (var i = startIndex || 0, n = startValue || 0;;) {
    var nextTab = string.indexOf("\t", i)
    if (nextTab < 0 || nextTab >= end)
      { return n + (end - i) }
    n += nextTab - i
    n += tabSize - (n % tabSize)
    i = nextTab + 1
  }
}

var Delayed = function() {this.id = null};
Delayed.prototype.set = function (ms, f) {
  clearTimeout(this.id)
  this.id = setTimeout(f, ms)
};

function indexOf(array, elt) {
  for (var i = 0; i < array.length; ++i)
    { if (array[i] == elt) { return i } }
  return -1
}

// Number of pixels added to scroller and sizer to hide scrollbar
var scrollerGap = 30

// Returned or thrown by various protocols to signal 'I'm not
// handling this'.
var Pass = {toString: function(){return "CodeMirror.Pass"}}

// Reused option objects for setSelection & friends
var sel_dontScroll = {scroll: false};
var sel_mouse = {origin: "*mouse"};
var sel_move = {origin: "+move"};
// The inverse of countColumn -- find the offset that corresponds to
// a particular column.
function findColumn(string, goal, tabSize) {
  for (var pos = 0, col = 0;;) {
    var nextTab = string.indexOf("\t", pos)
    if (nextTab == -1) { nextTab = string.length }
    var skipped = nextTab - pos
    if (nextTab == string.length || col + skipped >= goal)
      { return pos + Math.min(skipped, goal - col) }
    col += nextTab - pos
    col += tabSize - (col % tabSize)
    pos = nextTab + 1
    if (col >= goal) { return pos }
  }
}

var spaceStrs = [""]
function spaceStr(n) {
  while (spaceStrs.length <= n)
    { spaceStrs.push(lst(spaceStrs) + " ") }
  return spaceStrs[n]
}

function lst(arr) { return arr[arr.length-1] }

function map(array, f) {
  var out = []
  for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) }
  return out
}

function insertSorted(array, value, score) {
  var pos = 0, priority = score(value)
  while (pos < array.length && score(array[pos]) <= priority) { pos++ }
  array.splice(pos, 0, value)
}

function nothing() {}

function createObj(base, props) {
  var inst
  if (Object.create) {
    inst = Object.create(base)
  } else {
    nothing.prototype = base
    inst = new nothing()
  }
  if (props) { copyObj(props, inst) }
  return inst
}

var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/
function isWordCharBasic(ch) {
  return /\w/.test(ch) || ch > "\x80" &&
    (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))
}
function isWordChar(ch, helper) {
  if (!helper) { return isWordCharBasic(ch) }
  if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true }
  return helper.test(ch)
}

function isEmpty(obj) {
  for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }
  return true
}

// Extending unicode characters. A series of a non-extending char +
// any number of extending chars is treated as a single unit as far
// as editing and measuring is concerned. This is not fully correct,
// since some scripts/fonts/browsers also treat other configurations
// of code points as a group.
var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/
function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }

// Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.
function skipExtendingChars(str, pos, dir) {
  while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir }
  return pos
}

// Returns the value from the range [`from`; `to`] that satisfies
// `pred` and is closest to `from`. Assumes that at least `to` satisfies `pred`.
function findFirst(pred, from, to) {
  for (;;) {
    if (Math.abs(from - to) <= 1) { return pred(from) ? from : to }
    var mid = Math.floor((from + to) / 2)
    if (pred(mid)) { to = mid }
    else { from = mid }
  }
}

// The display handles the DOM integration, both for input reading
// and content drawing. It holds references to DOM nodes and
// display-related state.

function Display(place, doc, input) {
  var d = this
  this.input = input

  // Covers bottom-right square when both scrollbars are present.
  d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler")
  d.scrollbarFiller.setAttribute("cm-not-content", "true")
  // Covers bottom of gutter when coverGutterNextToScrollbar is on
  // and h scrollbar is present.
  d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler")
  d.gutterFiller.setAttribute("cm-not-content", "true")
  // Will contain the actual code, positioned to cover the viewport.
  d.lineDiv = eltP("div", null, "CodeMirror-code")
  // Elements are added to these to represent selection and cursors.
  d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1")
  d.cursorDiv = elt("div", null, "CodeMirror-cursors")
  // A visibility: hidden element used to find the size of things.
  d.measure = elt("div", null, "CodeMirror-measure")
  // When lines outside of the viewport are measured, they are drawn in this.
  d.lineMeasure = elt("div", null, "CodeMirror-measure")
  // Wraps everything that needs to exist inside the vertically-padded coordinate system
  d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
                    null, "position: relative; outline: none")
  var lines = eltP("div", [d.lineSpace], "CodeMirror-lines")
  // Moved around its parent to cover visible view.
  d.mover = elt("div", [lines], null, "position: relative")
  // Set to the height of the document, allowing scrolling.
  d.sizer = elt("div", [d.mover], "CodeMirror-sizer")
  d.sizerWidth = null
  // Behavior of elts with overflow: auto and padding is
  // inconsistent across browsers. This is used to ensure the
  // scrollable area is big enough.
  d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;")
  // Will contain the gutters, if any.
  d.gutters = elt("div", null, "CodeMirror-gutters")
  d.lineGutter = null
  // Actual scrollable element.
  d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll")
  d.scroller.setAttribute("tabIndex", "-1")
  // The element in which the editor lives.
  d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror")

  // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
  if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 }
  if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true }

  if (place) {
    if (place.appendChild) { place.appendChild(d.wrapper) }
    else { place(d.wrapper) }
  }

  // Current rendered range (may be bigger than the view window).
  d.viewFrom = d.viewTo = doc.first
  d.reportedViewFrom = d.reportedViewTo = doc.first
  // Information about the rendered lines.
  d.view = []
  d.renderedView = null
  // Holds info about a single rendered line when it was rendered
  // for measurement, while not in view.
  d.externalMeasured = null
  // Empty space (in pixels) above the view
  d.viewOffset = 0
  d.lastWrapHeight = d.lastWrapWidth = 0
  d.updateLineNumbers = null

  d.nativeBarWidth = d.barHeight = d.barWidth = 0
  d.scrollbarsClipped = false

  // Used to only resize the line number gutter when necessary (when
  // the amount of lines crosses a boundary that makes its width change)
  d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null
  // Set to true when a non-horizontal-scrolling line widget is
  // added. As an optimization, line widget aligning is skipped when
  // this is false.
  d.alignWidgets = false

  d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null

  // Tracks the maximum line length so that the horizontal scrollbar
  // can be kept static when scrolling.
  d.maxLine = null
  d.maxLineLength = 0
  d.maxLineChanged = false

  // Used for measuring wheel scrolling granularity
  d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null

  // True when shift is held down.
  d.shift = false

  // Used to track whether anything happened since the context menu
  // was opened.
  d.selForContextMenu = null

  d.activeTouch = null

  input.init(d)
}

// Find the line object corresponding to the given line number.
function getLine(doc, n) {
  n -= doc.first
  if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") }
  var chunk = doc
  while (!chunk.lines) {
    for (var i = 0;; ++i) {
      var child = chunk.children[i], sz = child.chunkSize()
      if (n < sz) { chunk = child; break }
      n -= sz
    }
  }
  return chunk.lines[n]
}

// Get the part of a document between two positions, as an array of
// strings.
function getBetween(doc, start, end) {
  var out = [], n = start.line
  doc.iter(start.line, end.line + 1, function (line) {
    var text = line.text
    if (n == end.line) { text = text.slice(0, end.ch) }
    if (n == start.line) { text = text.slice(start.ch) }
    out.push(text)
    ++n
  })
  return out
}
// Get the lines between from and to, as array of strings.
function getLines(doc, from, to) {
  var out = []
  doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value
  return out
}

// Update the height of a line, propagating the height change
// upwards to parent nodes.
function updateLineHeight(line, height) {
  var diff = height - line.height
  if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }
}

// Given a line object, find its line number by walking up through
// its parent links.
function lineNo(line) {
  if (line.parent == null) { return null }
  var cur = line.parent, no = indexOf(cur.lines, line)
  for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
    for (var i = 0;; ++i) {
      if (chunk.children[i] == cur) { break }
      no += chunk.children[i].chunkSize()
    }
  }
  return no + cur.first
}

// Find the line at the given vertical position, using the height
// information in the document tree.
function lineAtHeight(chunk, h) {
  var n = chunk.first
  outer: do {
    for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {
      var child = chunk.children[i$1], ch = child.height
      if (h < ch) { chunk = child; continue outer }
      h -= ch
      n += child.chunkSize()
    }
    return n
  } while (!chunk.lines)
  var i = 0
  for (; i < chunk.lines.length; ++i) {
    var line = chunk.lines[i], lh = line.height
    if (h < lh) { break }
    h -= lh
  }
  return n + i
}

function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}

function lineNumberFor(options, i) {
  return String(options.lineNumberFormatter(i + options.firstLineNumber))
}

// A Pos instance represents a position within the text.
function Pos(line, ch, sticky) {
  if ( sticky === void 0 ) sticky = null;

  if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }
  this.line = line
  this.ch = ch
  this.sticky = sticky
}

// Compare two positions, return 0 if they are the same, a negative
// number when a is less, and a positive number otherwise.
function cmp(a, b) { return a.line - b.line || a.ch - b.ch }

function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }

function copyPos(x) {return Pos(x.line, x.ch)}
function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }
function minPos(a, b) { return cmp(a, b) < 0 ? a : b }

// Most of the external API clips given positions to make sure they
// actually exist within the document.
function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}
function clipPos(doc, pos) {
  if (pos.line < doc.first) { return Pos(doc.first, 0) }
  var last = doc.first + doc.size - 1
  if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }
  return clipToLen(pos, getLine(doc, pos.line).text.length)
}
function clipToLen(pos, linelen) {
  var ch = pos.ch
  if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }
  else if (ch < 0) { return Pos(pos.line, 0) }
  else { return pos }
}
function clipPosArray(doc, array) {
  var out = []
  for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) }
  return out
}

// Optimize some code when these features are not used.
var sawReadOnlySpans = false;
var sawCollapsedSpans = false;
function seeReadOnlySpans() {
  sawReadOnlySpans = true
}

function seeCollapsedSpans() {
  sawCollapsedSpans = true
}

// TEXTMARKER SPANS

function MarkedSpan(marker, from, to) {
  this.marker = marker
  this.from = from; this.to = to
}

// Search an array of spans for a span matching the given marker.
function getMarkedSpanFor(spans, marker) {
  if (spans) { for (var i = 0; i < spans.length; ++i) {
    var span = spans[i]
    if (span.marker == marker) { return span }
  } }
}
// Remove a span from an array, returning undefined if no spans are
// left (we don't store arrays for lines without spans).
function removeMarkedSpan(spans, span) {
  var r
  for (var i = 0; i < spans.length; ++i)
    { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }
  return r
}
// Add a span to a line.
function addMarkedSpan(line, span) {
  line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]
  span.marker.attachLine(line)
}

// Used for the algorithm that adjusts markers for a change in the
// document. These functions cut an array of spans at a given
// character position, returning an array of remaining chunks (or
// undefined if nothing remains).
function markedSpansBefore(old, startCh, isInsert) {
  var nw
  if (old) { for (var i = 0; i < old.length; ++i) {
    var span = old[i], marker = span.marker
    var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh)
    if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
      var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)
      ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to))
    }
  } }
  return nw
}
function markedSpansAfter(old, endCh, isInsert) {
  var nw
  if (old) { for (var i = 0; i < old.length; ++i) {
    var span = old[i], marker = span.marker
    var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh)
    if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {
      var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)
      ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,
                                            span.to == null ? null : span.to - endCh))
    }
  } }
  return nw
}

// Given a change object, compute the new set of marker spans that
// cover the line in which the change took place. Removes spans
// entirely within the change, reconnects spans belonging to the
// same marker that appear on both sides of the change, and cuts off
// spans partially within the change. Returns an array of span
// arrays with one element for each line in (after) the change.
function stretchSpansOverChange(doc, change) {
  if (change.full) { return null }
  var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans
  var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans
  if (!oldFirst && !oldLast) { return null }

  var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0
  // Get the spans that 'stick out' on both sides
  var first = markedSpansBefore(oldFirst, startCh, isInsert)
  var last = markedSpansAfter(oldLast, endCh, isInsert)

  // Next, merge those two ends
  var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0)
  if (first) {
    // Fix up .to properties of first
    for (var i = 0; i < first.length; ++i) {
      var span = first[i]
      if (span.to == null) {
        var found = getMarkedSpanFor(last, span.marker)
        if (!found) { span.to = startCh }
        else if (sameLine) { span.to = found.to == null ? null : found.to + offset }
      }
    }
  }
  if (last) {
    // Fix up .from in last (or move them into first in case of sameLine)
    for (var i$1 = 0; i$1 < last.length; ++i$1) {
      var span$1 = last[i$1]
      if (span$1.to != null) { span$1.to += offset }
      if (span$1.from == null) {
        var found$1 = getMarkedSpanFor(first, span$1.marker)
        if (!found$1) {
          span$1.from = offset
          if (sameLine) { (first || (first = [])).push(span$1) }
        }
      } else {
        span$1.from += offset
        if (sameLine) { (first || (first = [])).push(span$1) }
      }
    }
  }
  // Make sure we didn't create any zero-length spans
  if (first) { first = clearEmptySpans(first) }
  if (last && last != first) { last = clearEmptySpans(last) }

  var newMarkers = [first]
  if (!sameLine) {
    // Fill gap with whole-line-spans
    var gap = change.text.length - 2, gapMarkers
    if (gap > 0 && first)
      { for (var i$2 = 0; i$2 < first.length; ++i$2)
        { if (first[i$2].to == null)
          { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } }
    for (var i$3 = 0; i$3 < gap; ++i$3)
      { newMarkers.push(gapMarkers) }
    newMarkers.push(last)
  }
  return newMarkers
}

// Remove spans that are empty and don't have a clearWhenEmpty
// option of false.
function clearEmptySpans(spans) {
  for (var i = 0; i < spans.length; ++i) {
    var span = spans[i]
    if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)
      { spans.splice(i--, 1) }
  }
  if (!spans.length) { return null }
  return spans
}

// Used to 'clip' out readOnly ranges when making a change.
function removeReadOnlyRanges(doc, from, to) {
  var markers = null
  doc.iter(from.line, to.line + 1, function (line) {
    if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
      var mark = line.markedSpans[i].marker
      if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))
        { (markers || (markers = [])).push(mark) }
    } }
  })
  if (!markers) { return null }
  var parts = [{from: from, to: to}]
  for (var i = 0; i < markers.length; ++i) {
    var mk = markers[i], m = mk.find(0)
    for (var j = 0; j < parts.length; ++j) {
      var p = parts[j]
      if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }
      var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to)
      if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)
        { newParts.push({from: p.from, to: m.from}) }
      if (dto > 0 || !mk.inclusiveRight && !dto)
        { newParts.push({from: m.to, to: p.to}) }
      parts.splice.apply(parts, newParts)
      j += newParts.length - 3
    }
  }
  return parts
}

// Connect or disconnect spans from a line.
function detachMarkedSpans(line) {
  var spans = line.markedSpans
  if (!spans) { return }
  for (var i = 0; i < spans.length; ++i)
    { spans[i].marker.detachLine(line) }
  line.markedSpans = null
}
function attachMarkedSpans(line, spans) {
  if (!spans) { return }
  for (var i = 0; i < spans.length; ++i)
    { spans[i].marker.attachLine(line) }
  line.markedSpans = spans
}

// Helpers used when computing which overlapping collapsed span
// counts as the larger one.
function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }
function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }

// Returns a number indicating which of two overlapping collapsed
// spans is larger (and thus includes the other). Falls back to
// comparing ids when the spans cover exactly the same range.
function compareCollapsedMarkers(a, b) {
  var lenDiff = a.lines.length - b.lines.length
  if (lenDiff != 0) { return lenDiff }
  var aPos = a.find(), bPos = b.find()
  var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)
  if (fromCmp) { return -fromCmp }
  var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)
  if (toCmp) { return toCmp }
  return b.id - a.id
}

// Find out whether a line ends or starts in a collapsed span. If
// so, return the marker for that span.
function collapsedSpanAtSide(line, start) {
  var sps = sawCollapsedSpans && line.markedSpans, found
  if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
    sp = sps[i]
    if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&
        (!found || compareCollapsedMarkers(found, sp.marker) < 0))
      { found = sp.marker }
  } }
  return found
}
function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }
function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }

// Test whether there exists a collapsed span that partially
// overlaps (covers the start or end, but not both) of a new span.
// Such overlap is not allowed.
function conflictingCollapsedRange(doc, lineNo, from, to, marker) {
  var line = getLine(doc, lineNo)
  var sps = sawCollapsedSpans && line.markedSpans
  if (sps) { for (var i = 0; i < sps.length; ++i) {
    var sp = sps[i]
    if (!sp.marker.collapsed) { continue }
    var found = sp.marker.find(0)
    var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)
    var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)
    if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }
    if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||
        fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))
      { return true }
  } }
}

// A visual line is a line as drawn on the screen. Folding, for
// example, can cause multiple logical lines to appear on the same
// visual line. This finds the start of the visual line that the
// given line is part of (usually that is the line itself).
function visualLine(line) {
  var merged
  while (merged = collapsedSpanAtStart(line))
    { line = merged.find(-1, true).line }
  return line
}

function visualLineEnd(line) {
  var merged
  while (merged = collapsedSpanAtEnd(line))
    { line = merged.find(1, true).line }
  return line
}

// Returns an array of logical lines that continue the visual line
// started by the argument, or undefined if there are no such lines.
function visualLineContinued(line) {
  var merged, lines
  while (merged = collapsedSpanAtEnd(line)) {
    line = merged.find(1, true).line
    ;(lines || (lines = [])).push(line)
  }
  return lines
}

// Get the line number of the start of the visual line that the
// given line number is part of.
function visualLineNo(doc, lineN) {
  var line = getLine(doc, lineN), vis = visualLine(line)
  if (line == vis) { return lineN }
  return lineNo(vis)
}

// Get the line number of the start of the next visual line after
// the given line.
function visualLineEndNo(doc, lineN) {
  if (lineN > doc.lastLine()) { return lineN }
  var line = getLine(doc, lineN), merged
  if (!lineIsHidden(doc, line)) { return lineN }
  while (merged = collapsedSpanAtEnd(line))
    { line = merged.find(1, true).line }
  return lineNo(line) + 1
}

// Compute whether a line is hidden. Lines count as hidden when they
// are part of a visual line that starts with another line, or when
// they are entirely covered by collapsed, non-widget span.
function lineIsHidden(doc, line) {
  var sps = sawCollapsedSpans && line.markedSpans
  if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
    sp = sps[i]
    if (!sp.marker.collapsed) { continue }
    if (sp.from == null) { return true }
    if (sp.marker.widgetNode) { continue }
    if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))
      { return true }
  } }
}
function lineIsHiddenInner(doc, line, span) {
  if (span.to == null) {
    var end = span.marker.find(1, true)
    return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))
  }
  if (span.marker.inclusiveRight && span.to == line.text.length)
    { return true }
  for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {
    sp = line.markedSpans[i]
    if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&
        (sp.to == null || sp.to != span.from) &&
        (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
        lineIsHiddenInner(doc, line, sp)) { return true }
  }
}

// Find the height above the given line.
function heightAtLine(lineObj) {
  lineObj = visualLine(lineObj)

  var h = 0, chunk = lineObj.parent
  for (var i = 0; i < chunk.lines.length; ++i) {
    var line = chunk.lines[i]
    if (line == lineObj) { break }
    else { h += line.height }
  }
  for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
    for (var i$1 = 0; i$1 < p.children.length; ++i$1) {
      var cur = p.children[i$1]
      if (cur == chunk) { break }
      else { h += cur.height }
    }
  }
  return h
}

// Compute the character length of a line, taking into account
// collapsed ranges (see markText) that might hide parts, and join
// other lines onto it.
function lineLength(line) {
  if (line.height == 0) { return 0 }
  var len = line.text.length, merged, cur = line
  while (merged = collapsedSpanAtStart(cur)) {
    var found = merged.find(0, true)
    cur = found.from.line
    len += found.from.ch - found.to.ch
  }
  cur = line
  while (merged = collapsedSpanAtEnd(cur)) {
    var found$1 = merged.find(0, true)
    len -= cur.text.length - found$1.from.ch
    cur = found$1.to.line
    len += cur.text.length - found$1.to.ch
  }
  return len
}

// Find the longest line in the document.
function findMaxLine(cm) {
  var d = cm.display, doc = cm.doc
  d.maxLine = getLine(doc, doc.first)
  d.maxLineLength = lineLength(d.maxLine)
  d.maxLineChanged = true
  doc.iter(function (line) {
    var len = lineLength(line)
    if (len > d.maxLineLength) {
      d.maxLineLength = len
      d.maxLine = line
    }
  })
}

// BIDI HELPERS

function iterateBidiSections(order, from, to, f) {
  if (!order) { return f(from, to, "ltr") }
  var found = false
  for (var i = 0; i < order.length; ++i) {
    var part = order[i]
    if (part.from < to && part.to > from || from == to && part.to == from) {
      f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr")
      found = true
    }
  }
  if (!found) { f(from, to, "ltr") }
}

var bidiOther = null
function getBidiPartAt(order, ch, sticky) {
  var found
  bidiOther = null
  for (var i = 0; i < order.length; ++i) {
    var cur = order[i]
    if (cur.from < ch && cur.to > ch) { return i }
    if (cur.to == ch) {
      if (cur.from != cur.to && sticky == "before") { found = i }
      else { bidiOther = i }
    }
    if (cur.from == ch) {
      if (cur.from != cur.to && sticky != "before") { found = i }
      else { bidiOther = i }
    }
  }
  return found != null ? found : bidiOther
}

// Bidirectional ordering algorithm
// See http://unicode.org/reports/tr9/tr9-13.html for the algorithm
// that this (partially) implements.

// One-char codes used for character types:
// L (L):   Left-to-Right
// R (R):   Right-to-Left
// r (AL):  Right-to-Left Arabic
// 1 (EN):  European Number
// + (ES):  European Number Separator
// % (ET):  European Number Terminator
// n (AN):  Arabic Number
// , (CS):  Common Number Separator
// m (NSM): Non-Spacing Mark
// b (BN):  Boundary Neutral
// s (B):   Paragraph Separator
// t (S):   Segment Separator
// w (WS):  Whitespace
// N (ON):  Other Neutrals

// Returns null if characters are ordered as they appear
// (left-to-right), or an array of sections ({from, to, level}
// objects) in the order in which they occur visually.
var bidiOrdering = (function() {
  // Character types for codepoints 0 to 0xff
  var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"
  // Character types for codepoints 0x600 to 0x6f9
  var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"
  function charType(code) {
    if (code <= 0xf7) { return lowTypes.charAt(code) }
    else if (0x590 <= code && code <= 0x5f4) { return "R" }
    else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }
    else if (0x6ee <= code && code <= 0x8ac) { return "r" }
    else if (0x2000 <= code && code <= 0x200b) { return "w" }
    else if (code == 0x200c) { return "b" }
    else { return "L" }
  }

  var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/
  var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/

  function BidiSpan(level, from, to) {
    this.level = level
    this.from = from; this.to = to
  }

  return function(str, direction) {
    var outerType = direction == "ltr" ? "L" : "R"

    if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false }
    var len = str.length, types = []
    for (var i = 0; i < len; ++i)
      { types.push(charType(str.charCodeAt(i))) }

    // W1. Examine each non-spacing mark (NSM) in the level run, and
    // change the type of the NSM to the type of the previous
    // character. If the NSM is at the start of the level run, it will
    // get the type of sor.
    for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {
      var type = types[i$1]
      if (type == "m") { types[i$1] = prev }
      else { prev = type }
    }

    // W2. Search backwards from each instance of a European number
    // until the first strong type (R, L, AL, or sor) is found. If an
    // AL is found, change the type of the European number to Arabic
    // number.
    // W3. Change all ALs to R.
    for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {
      var type$1 = types[i$2]
      if (type$1 == "1" && cur == "r") { types[i$2] = "n" }
      else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R" } }
    }

    // W4. A single European separator between two European numbers
    // changes to a European number. A single common separator between
    // two numbers of the same type changes to that type.
    for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {
      var type$2 = types[i$3]
      if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1" }
      else if (type$2 == "," && prev$1 == types[i$3+1] &&
               (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1 }
      prev$1 = type$2
    }

    // W5. A sequence of European terminators adjacent to European
    // numbers changes to all European numbers.
    // W6. Otherwise, separators and terminators change to Other
    // Neutral.
    for (var i$4 = 0; i$4 < len; ++i$4) {
      var type$3 = types[i$4]
      if (type$3 == ",") { types[i$4] = "N" }
      else if (type$3 == "%") {
        var end = (void 0)
        for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {}
        var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"
        for (var j = i$4; j < end; ++j) { types[j] = replace }
        i$4 = end - 1
      }
    }

    // W7. Search backwards from each instance of a European number
    // until the first strong type (R, L, or sor) is found. If an L is
    // found, then change the type of the European number to L.
    for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {
      var type$4 = types[i$5]
      if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L" }
      else if (isStrong.test(type$4)) { cur$1 = type$4 }
    }

    // N1. A sequence of neutrals takes the direction of the
    // surrounding strong text if the text on both sides has the same
    // direction. European and Arabic numbers act as if they were R in
    // terms of their influence on neutrals. Start-of-level-run (sor)
    // and end-of-level-run (eor) are used at level run boundaries.
    // N2. Any remaining neutrals take the embedding direction.
    for (var i$6 = 0; i$6 < len; ++i$6) {
      if (isNeutral.test(types[i$6])) {
        var end$1 = (void 0)
        for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}
        var before = (i$6 ? types[i$6-1] : outerType) == "L"
        var after = (end$1 < len ? types[end$1] : outerType) == "L"
        var replace$1 = before == after ? (before ? "L" : "R") : outerType
        for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 }
        i$6 = end$1 - 1
      }
    }

    // Here we depart from the documented algorithm, in order to avoid
    // building up an actual levels array. Since there are only three
    // levels (0, 1, 2) in an implementation that doesn't take
    // explicit embedding into account, we can build up the order on
    // the fly, without following the level-based algorithm.
    var order = [], m
    for (var i$7 = 0; i$7 < len;) {
      if (countsAsLeft.test(types[i$7])) {
        var start = i$7
        for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}
        order.push(new BidiSpan(0, start, i$7))
      } else {
        var pos = i$7, at = order.length
        for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {}
        for (var j$2 = pos; j$2 < i$7;) {
          if (countsAsNum.test(types[j$2])) {
            if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) }
            var nstart = j$2
            for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}
            order.splice(at, 0, new BidiSpan(2, nstart, j$2))
            pos = j$2
          } else { ++j$2 }
        }
        if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) }
      }
    }
    if (order[0].level == 1 && (m = str.match(/^\s+/))) {
      order[0].from = m[0].length
      order.unshift(new BidiSpan(0, 0, m[0].length))
    }
    if (lst(order).level == 1 && (m = str.match(/\s+$/))) {
      lst(order).to -= m[0].length
      order.push(new BidiSpan(0, len - m[0].length, len))
    }

    return direction == "rtl" ? order.reverse() : order
  }
})()

// Get the bidi ordering for the given line (and cache it). Returns
// false for lines that are fully left-to-right, and an array of
// BidiSpan objects otherwise.
function getOrder(line, direction) {
  var order = line.order
  if (order == null) { order = line.order = bidiOrdering(line.text, direction) }
  return order
}

function moveCharLogically(line, ch, dir) {
  var target = skipExtendingChars(line.text, ch + dir, dir)
  return target < 0 || target > line.text.length ? null : target
}

function moveLogically(line, start, dir) {
  var ch = moveCharLogically(line, start.ch, dir)
  return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before")
}

function endOfLine(visually, cm, lineObj, lineNo, dir) {
  if (visually) {
    var order = getOrder(lineObj, cm.doc.direction)
    if (order) {
      var part = dir < 0 ? lst(order) : order[0]
      var moveInStorageOrder = (dir < 0) == (part.level == 1)
      var sticky = moveInStorageOrder ? "after" : "before"
      var ch
      // With a wrapped rtl chunk (possibly spanning multiple bidi parts),
      // it could be that the last bidi part is not on the last visual line,
      // since visual lines contain content order-consecutive chunks.
      // Thus, in rtl, we are looking for the first (content-order) character
      // in the rtl chunk that is on the last line (that is, the same line
      // as the last (content-order) character).
      if (part.level > 0) {
        var prep = prepareMeasureForLine(cm, lineObj)
        ch = dir < 0 ? lineObj.text.length - 1 : 0
        var targetTop = measureCharPrepared(cm, prep, ch).top
        ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch)
        if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1) }
      } else { ch = dir < 0 ? part.to : part.from }
      return new Pos(lineNo, ch, sticky)
    }
  }
  return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after")
}

function moveVisually(cm, line, start, dir) {
  var bidi = getOrder(line, cm.doc.direction)
  if (!bidi) { return moveLogically(line, start, dir) }
  if (start.ch >= line.text.length) {
    start.ch = line.text.length
    start.sticky = "before"
  } else if (start.ch <= 0) {
    start.ch = 0
    start.sticky = "after"
  }
  var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]
  if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {
    // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,
    // nothing interesting happens.
    return moveLogically(line, start, dir)
  }

  var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }
  var prep
  var getWrappedLineExtent = function (ch) {
    if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }
    prep = prep || prepareMeasureForLine(cm, line)
    return wrappedLineExtentChar(cm, line, prep, ch)
  }
  var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch)

  if (cm.doc.direction == "rtl" || part.level == 1) {
    var moveInStorageOrder = (part.level == 1) == (dir < 0)
    var ch = mv(start, moveInStorageOrder ? 1 : -1)
    if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {
      // Case 2: We move within an rtl part or in an rtl editor on the same visual line
      var sticky = moveInStorageOrder ? "before" : "after"
      return new Pos(start.line, ch, sticky)
    }
  }

  // Case 3: Could not move within this bidi part in this visual line, so leave
  // the current bidi part

  var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {
    var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder
      ? new Pos(start.line, mv(ch, 1), "before")
      : new Pos(start.line, ch, "after"); }

    for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {
      var part = bidi[partPos]
      var moveInStorageOrder = (dir > 0) == (part.level != 1)
      var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1)
      if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }
      ch = moveInStorageOrder ? part.from : mv(part.to, -1)
      if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }
    }
  }

  // Case 3a: Look for other bidi parts on the same visual line
  var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent)
  if (res) { return res }

  // Case 3b: Look for other bidi parts on the next visual line
  var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1)
  if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {
    res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh))
    if (res) { return res }
  }

  // Case 4: Nowhere to move
  return null
}

// EVENT HANDLING

// Lightweight event framework. on/off also work on DOM nodes,
// registering native DOM handlers.

var noHandlers = []

var on = function(emitter, type, f) {
  if (emitter.addEventListener) {
    emitter.addEventListener(type, f, false)
  } else if (emitter.attachEvent) {
    emitter.attachEvent("on" + type, f)
  } else {
    var map = emitter._handlers || (emitter._handlers = {})
    map[type] = (map[type] || noHandlers).concat(f)
  }
}

function getHandlers(emitter, type) {
  return emitter._handlers && emitter._handlers[type] || noHandlers
}

function off(emitter, type, f) {
  if (emitter.removeEventListener) {
    emitter.removeEventListener(type, f, false)
  } else if (emitter.detachEvent) {
    emitter.detachEvent("on" + type, f)
  } else {
    var map = emitter._handlers, arr = map && map[type]
    if (arr) {
      var index = indexOf(arr, f)
      if (index > -1)
        { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)) }
    }
  }
}

function signal(emitter, type /*, values...*/) {
  var handlers = getHandlers(emitter, type)
  if (!handlers.length) { return }
  var args = Array.prototype.slice.call(arguments, 2)
  for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) }
}

// The DOM events that CodeMirror handles can be overridden by
// registering a (non-DOM) handler on the editor for the event name,
// and preventDefault-ing the event in that handler.
function signalDOMEvent(cm, e, override) {
  if (typeof e == "string")
    { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} }
  signal(cm, override || e.type, cm, e)
  return e_defaultPrevented(e) || e.codemirrorIgnore
}

function signalCursorActivity(cm) {
  var arr = cm._handlers && cm._handlers.cursorActivity
  if (!arr) { return }
  var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = [])
  for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)
    { set.push(arr[i]) } }
}

function hasHandler(emitter, type) {
  return getHandlers(emitter, type).length > 0
}

// Add on and off methods to a constructor's prototype, to make
// registering events on such objects more convenient.
function eventMixin(ctor) {
  ctor.prototype.on = function(type, f) {on(this, type, f)}
  ctor.prototype.off = function(type, f) {off(this, type, f)}
}

// Due to the fact that we still support jurassic IE versions, some
// compatibility wrappers are needed.

function e_preventDefault(e) {
  if (e.preventDefault) { e.preventDefault() }
  else { e.returnValue = false }
}
function e_stopPropagation(e) {
  if (e.stopPropagation) { e.stopPropagation() }
  else { e.cancelBubble = true }
}
function e_defaultPrevented(e) {
  return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false
}
function e_stop(e) {e_preventDefault(e); e_stopPropagation(e)}

function e_target(e) {return e.target || e.srcElement}
function e_button(e) {
  var b = e.which
  if (b == null) {
    if (e.button & 1) { b = 1 }
    else if (e.button & 2) { b = 3 }
    else if (e.button & 4) { b = 2 }
  }
  if (mac && e.ctrlKey && b == 1) { b = 3 }
  return b
}

// Detect drag-and-drop
var dragAndDrop = function() {
  // There is *some* kind of drag-and-drop support in IE6-8, but I
  // couldn't get it to work yet.
  if (ie && ie_version < 9) { return false }
  var div = elt('div')
  return "draggable" in div || "dragDrop" in div
}()

var zwspSupported
function zeroWidthElement(measure) {
  if (zwspSupported == null) {
    var test = elt("span", "\u200b")
    removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]))
    if (measure.firstChild.offsetHeight != 0)
      { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) }
  }
  var node = zwspSupported ? elt("span", "\u200b") :
    elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px")
  node.setAttribute("cm-text", "")
  return node
}

// Feature-detect IE's crummy client rect reporting for bidi text
var badBidiRects
function hasBadBidiRects(measure) {
  if (badBidiRects != null) { return badBidiRects }
  var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA"))
  var r0 = range(txt, 0, 1).getBoundingClientRect()
  var r1 = range(txt, 1, 2).getBoundingClientRect()
  removeChildren(measure)
  if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)
  return badBidiRects = (r1.right - r0.right < 3)
}

// See if "".split is the broken IE version, if so, provide an
// alternative way to split lines.
var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) {
  var pos = 0, result = [], l = string.length
  while (pos <= l) {
    var nl = string.indexOf("\n", pos)
    if (nl == -1) { nl = string.length }
    var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl)
    var rt = line.indexOf("\r")
    if (rt != -1) {
      result.push(line.slice(0, rt))
      pos += rt + 1
    } else {
      result.push(line)
      pos = nl + 1
    }
  }
  return result
} : function (string) { return string.split(/\r\n?|\n/); }

var hasSelection = window.getSelection ? function (te) {
  try { return te.selectionStart != te.selectionEnd }
  catch(e) { return false }
} : function (te) {
  var range
  try {range = te.ownerDocument.selection.createRange()}
  catch(e) {}
  if (!range || range.parentElement() != te) { return false }
  return range.compareEndPoints("StartToEnd", range) != 0
}

var hasCopyEvent = (function () {
  var e = elt("div")
  if ("oncopy" in e) { return true }
  e.setAttribute("oncopy", "return;")
  return typeof e.oncopy == "function"
})()

var badZoomedRects = null
function hasBadZoomedRects(measure) {
  if (badZoomedRects != null) { return badZoomedRects }
  var node = removeChildrenAndAdd(measure, elt("span", "x"))
  var normal = node.getBoundingClientRect()
  var fromRange = range(node, 0, 1).getBoundingClientRect()
  return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1
}

var modes = {};
var mimeModes = {};
// Extra arguments are stored as the mode's dependencies, which is
// used by (legacy) mechanisms like loadmode.js to automatically
// load a mode. (Preferred mechanism is the require/define calls.)
function defineMode(name, mode) {
  if (arguments.length > 2)
    { mode.dependencies = Array.prototype.slice.call(arguments, 2) }
  modes[name] = mode
}

function defineMIME(mime, spec) {
  mimeModes[mime] = spec
}

// Given a MIME type, a {name, ...options} config object, or a name
// string, return a mode config object.
function resolveMode(spec) {
  if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
    spec = mimeModes[spec]
  } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
    var found = mimeModes[spec.name]
    if (typeof found == "string") { found = {name: found} }
    spec = createObj(found, spec)
    spec.name = found.name
  } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
    return resolveMode("application/xml")
  } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) {
    return resolveMode("application/json")
  }
  if (typeof spec == "string") { return {name: spec} }
  else { return spec || {name: "null"} }
}

// Given a mode spec (anything that resolveMode accepts), find and
// initialize an actual mode object.
function getMode(options, spec) {
  spec = resolveMode(spec)
  var mfactory = modes[spec.name]
  if (!mfactory) { return getMode(options, "text/plain") }
  var modeObj = mfactory(options, spec)
  if (modeExtensions.hasOwnProperty(spec.name)) {
    var exts = modeExtensions[spec.name]
    for (var prop in exts) {
      if (!exts.hasOwnProperty(prop)) { continue }
      if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop] }
      modeObj[prop] = exts[prop]
    }
  }
  modeObj.name = spec.name
  if (spec.helperType) { modeObj.helperType = spec.helperType }
  if (spec.modeProps) { for (var prop$1 in spec.modeProps)
    { modeObj[prop$1] = spec.modeProps[prop$1] } }

  return modeObj
}

// This can be used to attach properties to mode objects from
// outside the actual mode definition.
var modeExtensions = {}
function extendMode(mode, properties) {
  var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {})
  copyObj(properties, exts)
}

function copyState(mode, state) {
  if (state === true) { return state }
  if (mode.copyState) { return mode.copyState(state) }
  var nstate = {}
  for (var n in state) {
    var val = state[n]
    if (val instanceof Array) { val = val.concat([]) }
    nstate[n] = val
  }
  return nstate
}

// Given a mode and a state (for that mode), find the inner mode and
// state at the position that the state refers to.
function innerMode(mode, state) {
  var info
  while (mode.innerMode) {
    info = mode.innerMode(state)
    if (!info || info.mode == mode) { break }
    state = info.state
    mode = info.mode
  }
  return info || {mode: mode, state: state}
}

function startState(mode, a1, a2) {
  return mode.startState ? mode.startState(a1, a2) : true
}

// STRING STREAM

// Fed to the mode parsers, provides helper functions to make
// parsers more succinct.

var StringStream = function(string, tabSize, lineOracle) {
  this.pos = this.start = 0
  this.string = string
  this.tabSize = tabSize || 8
  this.lastColumnPos = this.lastColumnValue = 0
  this.lineStart = 0
  this.lineOracle = lineOracle
};

StringStream.prototype.eol = function () {return this.pos >= this.string.length};
StringStream.prototype.sol = function () {return this.pos == this.lineStart};
StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};
StringStream.prototype.next = function () {
  if (this.pos < this.string.length)
    { return this.string.charAt(this.pos++) }
};
StringStream.prototype.eat = function (match) {
  var ch = this.string.charAt(this.pos)
  var ok
  if (typeof match == "string") { ok = ch == match }
  else { ok = ch && (match.test ? match.test(ch) : match(ch)) }
  if (ok) {++this.pos; return ch}
};
StringStream.prototype.eatWhile = function (match) {
  var start = this.pos
  while (this.eat(match)){}
  return this.pos > start
};
StringStream.prototype.eatSpace = function () {
    var this$1 = this;

  var start = this.pos
  while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos }
  return this.pos > start
};
StringStream.prototype.skipToEnd = function () {this.pos = this.string.length};
StringStream.prototype.skipTo = function (ch) {
  var found = this.string.indexOf(ch, this.pos)
  if (found > -1) {this.pos = found; return true}
};
StringStream.prototype.backUp = function (n) {this.pos -= n};
StringStream.prototype.column = function () {
  if (this.lastColumnPos < this.start) {
    this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue)
    this.lastColumnPos = this.start
  }
  return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
};
StringStream.prototype.indentation = function () {
  return countColumn(this.string, null, this.tabSize) -
    (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
};
StringStream.prototype.match = function (pattern, consume, caseInsensitive) {
  if (typeof pattern == "string") {
    var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }
    var substr = this.string.substr(this.pos, pattern.length)
    if (cased(substr) == cased(pattern)) {
      if (consume !== false) { this.pos += pattern.length }
      return true
    }
  } else {
    var match = this.string.slice(this.pos).match(pattern)
    if (match && match.index > 0) { return null }
    if (match && consume !== false) { this.pos += match[0].length }
    return match
  }
};
StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};
StringStream.prototype.hideFirstChars = function (n, inner) {
  this.lineStart += n
  try { return inner() }
  finally { this.lineStart -= n }
};
StringStream.prototype.lookAhead = function (n) {
  var oracle = this.lineOracle
  return oracle && oracle.lookAhead(n)
};

var SavedContext = function(state, lookAhead) {
  this.state = state
  this.lookAhead = lookAhead
};

var Context = function(doc, state, line, lookAhead) {
  this.state = state
  this.doc = doc
  this.line = line
  this.maxLookAhead = lookAhead || 0
};

Context.prototype.lookAhead = function (n) {
  var line = this.doc.getLine(this.line + n)
  if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n }
  return line
};

Context.prototype.nextLine = function () {
  this.line++
  if (this.maxLookAhead > 0) { this.maxLookAhead-- }
};

Context.fromSaved = function (doc, saved, line) {
  if (saved instanceof SavedContext)
    { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }
  else
    { return new Context(doc, copyState(doc.mode, saved), line) }
};

Context.prototype.save = function (copy) {
  var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state
  return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state
};


// Compute a style array (an array starting with a mode generation
// -- for invalidation -- followed by pairs of end positions and
// style strings), which is used to highlight the tokens on the
// line.
function highlightLine(cm, line, context, forceToEnd) {
  // A styles array always starts with a number identifying the
  // mode/overlays that it is based on (for easy invalidation).
  var st = [cm.state.modeGen], lineClasses = {}
  // Compute the base array of styles
  runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },
          lineClasses, forceToEnd)
  var state = context.state

  // Run overlays, adjust style array.
  var loop = function ( o ) {
    var overlay = cm.state.overlays[o], i = 1, at = 0
    context.state = true
    runMode(cm, line.text, overlay.mode, context, function (end, style) {
      var start = i
      // Ensure there's a token end at the current position, and that i points at it
      while (at < end) {
        var i_end = st[i]
        if (i_end > end)
          { st.splice(i, 1, end, st[i+1], i_end) }
        i += 2
        at = Math.min(end, i_end)
      }
      if (!style) { return }
      if (overlay.opaque) {
        st.splice(start, i - start, end, "overlay " + style)
        i = start + 2
      } else {
        for (; start < i; start += 2) {
          var cur = st[start+1]
          st[start+1] = (cur ? cur + " " : "") + "overlay " + style
        }
      }
    }, lineClasses)
  };

  for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );
  context.state = state

  return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}
}

function getLineStyles(cm, line, updateFrontier) {
  if (!line.styles || line.styles[0] != cm.state.modeGen) {
    var context = getContextBefore(cm, lineNo(line))
    var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state)
    var result = highlightLine(cm, line, context)
    if (resetState) { context.state = resetState }
    line.stateAfter = context.save(!resetState)
    line.styles = result.styles
    if (result.classes) { line.styleClasses = result.classes }
    else if (line.styleClasses) { line.styleClasses = null }
    if (updateFrontier === cm.doc.highlightFrontier)
      { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier) }
  }
  return line.styles
}

function getContextBefore(cm, n, precise) {
  var doc = cm.doc, display = cm.display
  if (!doc.mode.startState) { return new Context(doc, true, n) }
  var start = findStartLine(cm, n, precise)
  var saved = start > doc.first && getLine(doc, start - 1).stateAfter
  var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start)

  doc.iter(start, n, function (line) {
    processLine(cm, line.text, context)
    var pos = context.line
    line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null
    context.nextLine()
  })
  if (precise) { doc.modeFrontier = context.line }
  return context
}

// Lightweight form of highlight -- proceed over this line and
// update state, but don't save a style array. Used for lines that
// aren't currently visible.
function processLine(cm, text, context, startAt) {
  var mode = cm.doc.mode
  var stream = new StringStream(text, cm.options.tabSize, context)
  stream.start = stream.pos = startAt || 0
  if (text == "") { callBlankLine(mode, context.state) }
  while (!stream.eol()) {
    readToken(mode, stream, context.state)
    stream.start = stream.pos
  }
}

function callBlankLine(mode, state) {
  if (mode.blankLine) { return mode.blankLine(state) }
  if (!mode.innerMode) { return }
  var inner = innerMode(mode, state)
  if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }
}

function readToken(mode, stream, state, inner) {
  for (var i = 0; i < 10; i++) {
    if (inner) { inner[0] = innerMode(mode, state).mode }
    var style = mode.token(stream, state)
    if (stream.pos > stream.start) { return style }
  }
  throw new Error("Mode " + mode.name + " failed to advance stream.")
}

var Token = function(stream, type, state) {
  this.start = stream.start; this.end = stream.pos
  this.string = stream.current()
  this.type = type || null
  this.state = state
};

// Utility for getTokenAt and getLineTokens
function takeToken(cm, pos, precise, asArray) {
  var doc = cm.doc, mode = doc.mode, style
  pos = clipPos(doc, pos)
  var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise)
  var stream = new StringStream(line.text, cm.options.tabSize, context), tokens
  if (asArray) { tokens = [] }
  while ((asArray || stream.pos < pos.ch) && !stream.eol()) {
    stream.start = stream.pos
    style = readToken(mode, stream, context.state)
    if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))) }
  }
  return asArray ? tokens : new Token(stream, style, context.state)
}

function extractLineClasses(type, output) {
  if (type) { for (;;) {
    var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/)
    if (!lineClass) { break }
    type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length)
    var prop = lineClass[1] ? "bgClass" : "textClass"
    if (output[prop] == null)
      { output[prop] = lineClass[2] }
    else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
      { output[prop] += " " + lineClass[2] }
  } }
  return type
}

// Run the given mode's parser over a line, calling f for each token.
function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
  var flattenSpans = mode.flattenSpans
  if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }
  var curStart = 0, curStyle = null
  var stream = new StringStream(text, cm.options.tabSize, context), style
  var inner = cm.options.addModeClass && [null]
  if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses) }
  while (!stream.eol()) {
    if (stream.pos > cm.options.maxHighlightLength) {
      flattenSpans = false
      if (forceToEnd) { processLine(cm, text, context, stream.pos) }
      stream.pos = text.length
      style = null
    } else {
      style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses)
    }
    if (inner) {
      var mName = inner[0].name
      if (mName) { style = "m-" + (style ? mName + " " + style : mName) }
    }
    if (!flattenSpans || curStyle != style) {
      while (curStart < stream.start) {
        curStart = Math.min(stream.start, curStart + 5000)
        f(curStart, curStyle)
      }
      curStyle = style
    }
    stream.start = stream.pos
  }
  while (curStart < stream.pos) {
    // Webkit seems to refuse to render text nodes longer than 57444
    // characters, and returns inaccurate measurements in nodes
    // starting around 5000 chars.
    var pos = Math.min(stream.pos, curStart + 5000)
    f(pos, curStyle)
    curStart = pos
  }
}

// Finds the line to start with when starting a parse. Tries to
// find a line with a stateAfter, so that it can start with a
// valid state. If that fails, it returns the line with the
// smallest indentation, which tends to need the least context to
// parse correctly.
function findStartLine(cm, n, precise) {
  var minindent, minline, doc = cm.doc
  var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)
  for (var search = n; search > lim; --search) {
    if (search <= doc.first) { return doc.first }
    var line = getLine(doc, search - 1), after = line.stateAfter
    if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))
      { return search }
    var indented = countColumn(line.text, null, cm.options.tabSize)
    if (minline == null || minindent > indented) {
      minline = search - 1
      minindent = indented
    }
  }
  return minline
}

function retreatFrontier(doc, n) {
  doc.modeFrontier = Math.min(doc.modeFrontier, n)
  if (doc.highlightFrontier < n - 10) { return }
  var start = doc.first
  for (var line = n - 1; line > start; line--) {
    var saved = getLine(doc, line).stateAfter
    // change is on 3
    // state on line 1 looked ahead 2 -- so saw 3
    // test 1 + 2 < 3 should cover this
    if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {
      start = line + 1
      break
    }
  }
  doc.highlightFrontier = Math.min(doc.highlightFrontier, start)
}

// LINE DATA STRUCTURE

// Line objects. These hold state related to a line, including
// highlighting info (the styles array).
var Line = function(text, markedSpans, estimateHeight) {
  this.text = text
  attachMarkedSpans(this, markedSpans)
  this.height = estimateHeight ? estimateHeight(this) : 1
};

Line.prototype.lineNo = function () { return lineNo(this) };
eventMixin(Line)

// Change the content (text, markers) of a line. Automatically
// invalidates cached information and tries to re-estimate the
// line's height.
function updateLine(line, text, markedSpans, estimateHeight) {
  line.text = text
  if (line.stateAfter) { line.stateAfter = null }
  if (line.styles) { line.styles = null }
  if (line.order != null) { line.order = null }
  detachMarkedSpans(line)
  attachMarkedSpans(line, markedSpans)
  var estHeight = estimateHeight ? estimateHeight(line) : 1
  if (estHeight != line.height) { updateLineHeight(line, estHeight) }
}

// Detach a line from the document tree and its markers.
function cleanUpLine(line) {
  line.parent = null
  detachMarkedSpans(line)
}

// Convert a style as returned by a mode (either null, or a string
// containing one or more styles) to a CSS style. This is cached,
// and also looks for line-wide styles.
var styleToClassCache = {};
var styleToClassCacheWithMode = {};
function interpretTokenStyle(style, options) {
  if (!style || /^\s*$/.test(style)) { return null }
  var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache
  return cache[style] ||
    (cache[style] = style.replace(/\S+/g, "cm-$&"))
}

// Render the DOM representation of the text of a line. Also builds
// up a 'line map', which points at the DOM nodes that represent
// specific stretches of text, and is used by the measuring code.
// The returned object contains the DOM node, this map, and
// information about line-wide styles that were set by the mode.
function buildLineContent(cm, lineView) {
  // The padding-right forces the element to have a 'border', which
  // is needed on Webkit to be able to get line-level bounding
  // rectangles for it (in measureChar).
  var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null)
  var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content,
                 col: 0, pos: 0, cm: cm,
                 trailingSpace: false,
                 splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}
  lineView.measure = {}

  // Iterate over the logical lines that make up this visual line.
  for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {
    var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)
    builder.pos = 0
    builder.addToken = buildToken
    // Optionally wire in some hacks into the token-rendering
    // algorithm, to deal with browser quirks.
    if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))
      { builder.addToken = buildTokenBadBidi(builder.addToken, order) }
    builder.map = []
    var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)
    insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))
    if (line.styleClasses) {
      if (line.styleClasses.bgClass)
        { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || "") }
      if (line.styleClasses.textClass)
        { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || "") }
    }

    // Ensure at least a single node is present, for measuring.
    if (builder.map.length == 0)
      { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }

    // Store the map and a cache object for the current logical line
    if (i == 0) {
      lineView.measure.map = builder.map
      lineView.measure.cache = {}
    } else {
      ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)
      ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})
    }
  }

  // See issue #2901
  if (webkit) {
    var last = builder.content.lastChild
    if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab")))
      { builder.content.className = "cm-tab-wrap-hack" }
  }

  signal(cm, "renderLine", cm, lineView.line, builder.pre)
  if (builder.pre.className)
    { builder.textClass = joinClasses(builder.pre.className, builder.textClass || "") }

  return builder
}

function defaultSpecialCharPlaceholder(ch) {
  var token = elt("span", "\u2022", "cm-invalidchar")
  token.title = "\\u" + ch.charCodeAt(0).toString(16)
  token.setAttribute("aria-label", token.title)
  return token
}

// Build up the DOM representation for a single token, and add it to
// the line map. Takes care to render special characters separately.
function buildToken(builder, text, style, startStyle, endStyle, title, css) {
  if (!text) { return }
  var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text
  var special = builder.cm.state.specialChars, mustWrap = false
  var content
  if (!special.test(text)) {
    builder.col += text.length
    content = document.createTextNode(displayText)
    builder.map.push(builder.pos, builder.pos + text.length, content)
    if (ie && ie_version < 9) { mustWrap = true }
    builder.pos += text.length
  } else {
    content = document.createDocumentFragment()
    var pos = 0
    while (true) {
      special.lastIndex = pos
      var m = special.exec(text)
      var skipped = m ? m.index - pos : text.length - pos
      if (skipped) {
        var txt = document.createTextNode(displayText.slice(pos, pos + skipped))
        if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])) }
        else { content.appendChild(txt) }
        builder.map.push(builder.pos, builder.pos + skipped, txt)
        builder.col += skipped
        builder.pos += skipped
      }
      if (!m) { break }
      pos += skipped + 1
      var txt$1 = (void 0)
      if (m[0] == "\t") {
        var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize
        txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab"))
        txt$1.setAttribute("role", "presentation")
        txt$1.setAttribute("cm-text", "\t")
        builder.col += tabWidth
      } else if (m[0] == "\r" || m[0] == "\n") {
        txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar"))
        txt$1.setAttribute("cm-text", m[0])
        builder.col += 1
      } else {
        txt$1 = builder.cm.options.specialCharPlaceholder(m[0])
        txt$1.setAttribute("cm-text", m[0])
        if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])) }
        else { content.appendChild(txt$1) }
        builder.col += 1
      }
      builder.map.push(builder.pos, builder.pos + 1, txt$1)
      builder.pos++
    }
  }
  builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32
  if (style || startStyle || endStyle || mustWrap || css) {
    var fullStyle = style || ""
    if (startStyle) { fullStyle += startStyle }
    if (endStyle) { fullStyle += endStyle }
    var token = elt("span", [content], fullStyle, css)
    if (title) { token.title = title }
    return builder.content.appendChild(token)
  }
  builder.content.appendChild(content)
}

function splitSpaces(text, trailingBefore) {
  if (text.length > 1 && !/  /.test(text)) { return text }
  var spaceBefore = trailingBefore, result = ""
  for (var i = 0; i < text.length; i++) {
    var ch = text.charAt(i)
    if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))
      { ch = "\u00a0" }
    result += ch
    spaceBefore = ch == " "
  }
  return result
}

// Work around nonsense dimensions being reported for stretches of
// right-to-left text.
function buildTokenBadBidi(inner, order) {
  return function (builder, text, style, startStyle, endStyle, title, css) {
    style = style ? style + " cm-force-border" : "cm-force-border"
    var start = builder.pos, end = start + text.length
    for (;;) {
      // Find the part that overlaps with the start of this text
      var part = (void 0)
      for (var i = 0; i < order.length; i++) {
        part = order[i]
        if (part.to > start && part.from <= start) { break }
      }
      if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) }
      inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css)
      startStyle = null
      text = text.slice(part.to - start)
      start = part.to
    }
  }
}

function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
  var widget = !ignoreWidget && marker.widgetNode
  if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) }
  if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {
    if (!widget)
      { widget = builder.content.appendChild(document.createElement("span")) }
    widget.setAttribute("cm-marker", marker.id)
  }
  if (widget) {
    builder.cm.display.input.setUneditable(widget)
    builder.content.appendChild(widget)
  }
  builder.pos += size
  builder.trailingSpace = false
}

// Outputs a number of spans to make up a line, taking highlighting
// and marked text into account.
function insertLineContent(line, builder, styles) {
  var spans = line.markedSpans, allText = line.text, at = 0
  if (!spans) {
    for (var i$1 = 1; i$1 < styles.length; i$1+=2)
      { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }
    return
  }

  var len = allText.length, pos = 0, i = 1, text = "", style, css
  var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed
  for (;;) {
    if (nextChange == pos) { // Update current marker set
      spanStyle = spanEndStyle = spanStartStyle = title = css = ""
      collapsed = null; nextChange = Infinity
      var foundBookmarks = [], endStyles = (void 0)
      for (var j = 0; j < spans.length; ++j) {
        var sp = spans[j], m = sp.marker
        if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
          foundBookmarks.push(m)
        } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {
          if (sp.to != null && sp.to != pos && nextChange > sp.to) {
            nextChange = sp.to
            spanEndStyle = ""
          }
          if (m.className) { spanStyle += " " + m.className }
          if (m.css) { css = (css ? css + ";" : "") + m.css }
          if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle }
          if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }
          if (m.title && !title) { title = m.title }
          if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
            { collapsed = sp }
        } else if (sp.from > pos && nextChange > sp.from) {
          nextChange = sp.from
        }
      }
      if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)
        { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1] } } }

      if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)
        { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }
      if (collapsed && (collapsed.from || 0) == pos) {
        buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
                           collapsed.marker, collapsed.from == null)
        if (collapsed.to == null) { return }
        if (collapsed.to == pos) { collapsed = false }
      }
    }
    if (pos >= len) { break }

    var upto = Math.min(len, nextChange)
    while (true) {
      if (text) {
        var end = pos + text.length
        if (!collapsed) {
          var tokenText = end > upto ? text.slice(0, upto - pos) : text
          builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,
                           spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css)
        }
        if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}
        pos = end
        spanStartStyle = ""
      }
      text = allText.slice(at, at = styles[i++])
      style = interpretTokenStyle(styles[i++], builder.cm.options)
    }
  }
}


// These objects are used to represent the visible (currently drawn)
// part of the document. A LineView may correspond to multiple
// logical lines, if those are connected by collapsed ranges.
function LineView(doc, line, lineN) {
  // The starting line
  this.line = line
  // Continuing lines, if any
  this.rest = visualLineContinued(line)
  // Number of logical lines in this visual line
  this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1
  this.node = this.text = null
  this.hidden = lineIsHidden(doc, line)
}

// Create a range of LineView objects for the given lines.
function buildViewArray(cm, from, to) {
  var array = [], nextPos
  for (var pos = from; pos < to; pos = nextPos) {
    var view = new LineView(cm.doc, getLine(cm.doc, pos), pos)
    nextPos = pos + view.size
    array.push(view)
  }
  return array
}

var operationGroup = null

function pushOperation(op) {
  if (operationGroup) {
    operationGroup.ops.push(op)
  } else {
    op.ownsGroup = operationGroup = {
      ops: [op],
      delayedCallbacks: []
    }
  }
}

function fireCallbacksForOps(group) {
  // Calls delayed callbacks and cursorActivity handlers until no
  // new ones appear
  var callbacks = group.delayedCallbacks, i = 0
  do {
    for (; i < callbacks.length; i++)
      { callbacks[i].call(null) }
    for (var j = 0; j < group.ops.length; j++) {
      var op = group.ops[j]
      if (op.cursorActivityHandlers)
        { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)
          { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } }
    }
  } while (i < callbacks.length)
}

function finishOperation(op, endCb) {
  var group = op.ownsGroup
  if (!group) { return }

  try { fireCallbacksForOps(group) }
  finally {
    operationGroup = null
    endCb(group)
  }
}

var orphanDelayedCallbacks = null

// Often, we want to signal events at a point where we are in the
// middle of some work, but don't want the handler to start calling
// other methods on the editor, which might be in an inconsistent
// state or simply not expect any other events to happen.
// signalLater looks whether there are any handlers, and schedules
// them to be executed when the last operation ends, or, if no
// operation is active, when a timeout fires.
function signalLater(emitter, type /*, values...*/) {
  var arr = getHandlers(emitter, type)
  if (!arr.length) { return }
  var args = Array.prototype.slice.call(arguments, 2), list
  if (operationGroup) {
    list = operationGroup.delayedCallbacks
  } else if (orphanDelayedCallbacks) {
    list = orphanDelayedCallbacks
  } else {
    list = orphanDelayedCallbacks = []
    setTimeout(fireOrphanDelayed, 0)
  }
  var loop = function ( i ) {
    list.push(function () { return arr[i].apply(null, args); })
  };

  for (var i = 0; i < arr.length; ++i)
    loop( i );
}

function fireOrphanDelayed() {
  var delayed = orphanDelayedCallbacks
  orphanDelayedCallbacks = null
  for (var i = 0; i < delayed.length; ++i) { delayed[i]() }
}

// When an aspect of a line changes, a string is added to
// lineView.changes. This updates the relevant part of the line's
// DOM structure.
function updateLineForChanges(cm, lineView, lineN, dims) {
  for (var j = 0; j < lineView.changes.length; j++) {
    var type = lineView.changes[j]
    if (type == "text") { updateLineText(cm, lineView) }
    else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims) }
    else if (type == "class") { updateLineClasses(cm, lineView) }
    else if (type == "widget") { updateLineWidgets(cm, lineView, dims) }
  }
  lineView.changes = null
}

// Lines with gutter elements, widgets or a background class need to
// be wrapped, and have the extra elements added to the wrapper div
function ensureLineWrapped(lineView) {
  if (lineView.node == lineView.text) {
    lineView.node = elt("div", null, null, "position: relative")
    if (lineView.text.parentNode)
      { lineView.text.parentNode.replaceChild(lineView.node, lineView.text) }
    lineView.node.appendChild(lineView.text)
    if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 }
  }
  return lineView.node
}

function updateLineBackground(cm, lineView) {
  var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass
  if (cls) { cls += " CodeMirror-linebackground" }
  if (lineView.background) {
    if (cls) { lineView.background.className = cls }
    else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null }
  } else if (cls) {
    var wrap = ensureLineWrapped(lineView)
    lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild)
    cm.display.input.setUneditable(lineView.background)
  }
}

// Wrapper around buildLineContent which will reuse the structure
// in display.externalMeasured when possible.
function getLineContent(cm, lineView) {
  var ext = cm.display.externalMeasured
  if (ext && ext.line == lineView.line) {
    cm.display.externalMeasured = null
    lineView.measure = ext.measure
    return ext.built
  }
  return buildLineContent(cm, lineView)
}

// Redraw the line's text. Interacts with the background and text
// classes because the mode may output tokens that influence these
// classes.
function updateLineText(cm, lineView) {
  var cls = lineView.text.className
  var built = getLineContent(cm, lineView)
  if (lineView.text == lineView.node) { lineView.node = built.pre }
  lineView.text.parentNode.replaceChild(built.pre, lineView.text)
  lineView.text = built.pre
  if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {
    lineView.bgClass = built.bgClass
    lineView.textClass = built.textClass
    updateLineClasses(cm, lineView)
  } else if (cls) {
    lineView.text.className = cls
  }
}

function updateLineClasses(cm, lineView) {
  updateLineBackground(cm, lineView)
  if (lineView.line.wrapClass)
    { ensureLineWrapped(lineView).className = lineView.line.wrapClass }
  else if (lineView.node != lineView.text)
    { lineView.node.className = "" }
  var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass
  lineView.text.className = textClass || ""
}

function updateLineGutter(cm, lineView, lineN, dims) {
  if (lineView.gutter) {
    lineView.node.removeChild(lineView.gutter)
    lineView.gutter = null
  }
  if (lineView.gutterBackground) {
    lineView.node.removeChild(lineView.gutterBackground)
    lineView.gutterBackground = null
  }
  if (lineView.line.gutterClass) {
    var wrap = ensureLineWrapped(lineView)
    lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass,
                                    ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px"))
    cm.display.input.setUneditable(lineView.gutterBackground)
    wrap.insertBefore(lineView.gutterBackground, lineView.text)
  }
  var markers = lineView.line.gutterMarkers
  if (cm.options.lineNumbers || markers) {
    var wrap$1 = ensureLineWrapped(lineView)
    var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"))
    cm.display.input.setUneditable(gutterWrap)
    wrap$1.insertBefore(gutterWrap, lineView.text)
    if (lineView.line.gutterClass)
      { gutterWrap.className += " " + lineView.line.gutterClass }
    if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
      { lineView.lineNumber = gutterWrap.appendChild(
        elt("div", lineNumberFor(cm.options, lineN),
            "CodeMirror-linenumber CodeMirror-gutter-elt",
            ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))) }
    if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {
      var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]
      if (found)
        { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt",
                                   ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))) }
    } }
  }
}

function updateLineWidgets(cm, lineView, dims) {
  if (lineView.alignable) { lineView.alignable = null }
  for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {
    next = node.nextSibling
    if (node.className == "CodeMirror-linewidget")
      { lineView.node.removeChild(node) }
  }
  insertLineWidgets(cm, lineView, dims)
}

// Build a line's DOM representation from scratch
function buildLineElement(cm, lineView, lineN, dims) {
  var built = getLineContent(cm, lineView)
  lineView.text = lineView.node = built.pre
  if (built.bgClass) { lineView.bgClass = built.bgClass }
  if (built.textClass) { lineView.textClass = built.textClass }

  updateLineClasses(cm, lineView)
  updateLineGutter(cm, lineView, lineN, dims)
  insertLineWidgets(cm, lineView, dims)
  return lineView.node
}

// A lineView may contain multiple logical lines (when merged by
// collapsed spans). The widgets for all of them need to be drawn.
function insertLineWidgets(cm, lineView, dims) {
  insertLineWidgetsFor(cm, lineView.line, lineView, dims, true)
  if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
    { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } }
}

function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
  if (!line.widgets) { return }
  var wrap = ensureLineWrapped(lineView)
  for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
    var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget")
    if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true") }
    positionLineWidget(widget, node, lineView, dims)
    cm.display.input.setUneditable(node)
    if (allowAbove && widget.above)
      { wrap.insertBefore(node, lineView.gutter || lineView.text) }
    else
      { wrap.appendChild(node) }
    signalLater(widget, "redraw")
  }
}

function positionLineWidget(widget, node, lineView, dims) {
  if (widget.noHScroll) {
    ;(lineView.alignable || (lineView.alignable = [])).push(node)
    var width = dims.wrapperWidth
    node.style.left = dims.fixedPos + "px"
    if (!widget.coverGutter) {
      width -= dims.gutterTotalWidth
      node.style.paddingLeft = dims.gutterTotalWidth + "px"
    }
    node.style.width = width + "px"
  }
  if (widget.coverGutter) {
    node.style.zIndex = 5
    node.style.position = "relative"
    if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px" }
  }
}

function widgetHeight(widget) {
  if (widget.height != null) { return widget.height }
  var cm = widget.doc.cm
  if (!cm) { return 0 }
  if (!contains(document.body, widget.node)) {
    var parentStyle = "position: relative;"
    if (widget.coverGutter)
      { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;" }
    if (widget.noHScroll)
      { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;" }
    removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle))
  }
  return widget.height = widget.node.parentNode.offsetHeight
}

// Return true when the given mouse event happened in a widget
function eventInWidget(display, e) {
  for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {
    if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") ||
        (n.parentNode == display.sizer && n != display.mover))
      { return true }
  }
}

// POSITION MEASUREMENT

function paddingTop(display) {return display.lineSpace.offsetTop}
function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}
function paddingH(display) {
  if (display.cachedPaddingH) { return display.cachedPaddingH }
  var e = removeChildrenAndAdd(display.measure, elt("pre", "x"))
  var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle
  var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}
  if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data }
  return data
}

function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }
function displayWidth(cm) {
  return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth
}
function displayHeight(cm) {
  return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight
}

// Ensure the lineView.wrapping.heights array is populated. This is
// an array of bottom offsets for the lines that make up a drawn
// line. When lineWrapping is on, there might be more than one
// height.
function ensureLineHeights(cm, lineView, rect) {
  var wrapping = cm.options.lineWrapping
  var curWidth = wrapping && displayWidth(cm)
  if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {
    var heights = lineView.measure.heights = []
    if (wrapping) {
      lineView.measure.width = curWidth
      var rects = lineView.text.firstChild.getClientRects()
      for (var i = 0; i < rects.length - 1; i++) {
        var cur = rects[i], next = rects[i + 1]
        if (Math.abs(cur.bottom - next.bottom) > 2)
          { heights.push((cur.bottom + next.top) / 2 - rect.top) }
      }
    }
    heights.push(rect.bottom - rect.top)
  }
}

// Find a line map (mapping character offsets to text nodes) and a
// measurement cache for the given line number. (A line view might
// contain multiple lines when collapsed ranges are present.)
function mapFromLineView(lineView, line, lineN) {
  if (lineView.line == line)
    { return {map: lineView.measure.map, cache: lineView.measure.cache} }
  for (var i = 0; i < lineView.rest.length; i++)
    { if (lineView.rest[i] == line)
      { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
  for (var i$1 = 0; i$1 < lineView.rest.length; i$1+
Download .txt
gitextract_cbtgvdd3/

├── .gitignore
├── CITATION.cff
├── LICENSE.md
├── README.md
├── bin/
│   └── urdujs.js
├── docs/
│   ├── README.md
│   ├── _config.yml
│   ├── contribute.md
│   └── editor/
│       ├── addon/
│       │   └── edit/
│       │       └── matchbrackets.js
│       ├── css/
│       │   ├── base16-light.css
│       │   ├── codemirror.css
│       │   └── style.css
│       ├── index.html
│       ├── mode/
│       │   ├── javascript/
│       │   │   ├── index.html
│       │   │   ├── javascript.js
│       │   │   └── typescript.html
│       │   └── urduscript/
│       │       └── urduscript.js
│       └── scripts/
│           ├── codemirror.js
│           ├── codes.js
│           ├── editor.js
│           ├── escodegen.js
│           ├── expander.js
│           ├── jquery.js
│           ├── parser.js
│           ├── patterns.js
│           ├── require.js
│           ├── scopedEval.js
│           ├── sweet.js
│           ├── syntax.js
│           ├── text.js
│           ├── underscore.js
│           └── urdujs/
│               ├── keywords.js
│               └── keywords.js.txt
├── hello.js
├── package.json
└── src/
    └── keywords.js
Download .txt
SYMBOL INDEX (2612 symbols across 13 files)

FILE: docs/editor/addon/edit/matchbrackets.js
  function findMatchingBracket (line 19) | function findMatchingBracket(cm, where, config) {
  function scanForBracket (line 49) | function scanForBracket(cm, where, dir, style, config) {
  function matchBrackets (line 76) | function matchBrackets(cm, autoclear, config) {
  function doMatchBrackets (line 106) | function doMatchBrackets(cm) {

FILE: docs/editor/mode/javascript/javascript.js
  function expressionAllowed (line 14) | function expressionAllowed(stream, state, backUp) {
  function kw (line 30) | function kw(type) {return {type: type, style: "keyword"};}
  function readRegexp (line 79) | function readRegexp(stream) {
  function ret (line 94) | function ret(tp, style, cont) {
  function tokenBase (line 98) | function tokenBase(stream, state) {
  function tokenString (line 163) | function tokenString(quote) {
  function tokenComment (line 179) | function tokenComment(stream, state) {
  function tokenQuasi (line 191) | function tokenQuasi(stream, state) {
  function findFatArrow (line 211) | function findFatArrow(stream, state) {
  function JSLexical (line 246) | function JSLexical(indented, column, type, align, prev, info) {
  function inScope (line 255) | function inScope(state, varname) {
  function parseJS (line 264) | function parseJS(state, style, type, content, stream) {
  function pass (line 288) | function pass() {
  function cont (line 291) | function cont() {
  function register (line 295) | function register(varname) {
  function pushcontext (line 316) | function pushcontext() {
  function popcontext (line 320) | function popcontext() {
  function pushlex (line 324) | function pushlex(type, info) {
  function poplex (line 335) | function poplex() {
  function expect (line 345) | function expect(wanted) {
  function statement (line 354) | function statement(type, value) {
  function expression (line 389) | function expression(type) {
  function expressionNoComma (line 392) | function expressionNoComma(type) {
  function parenExpr (line 395) | function parenExpr(type) {
  function expressionInner (line 399) | function expressionInner(type, noComma) {
  function maybeexpression (line 419) | function maybeexpression(type) {
  function maybeexpressionNoComma (line 423) | function maybeexpressionNoComma(type) {
  function maybeoperatorComma (line 428) | function maybeoperatorComma(type, value) {
  function maybeoperatorNoComma (line 432) | function maybeoperatorNoComma(type, value, noComma) {
  function quasi (line 448) | function quasi(type, value) {
  function continueQuasi (line 453) | function continueQuasi(type) {
  function arrowBody (line 460) | function arrowBody(type) {
  function arrowBodyNoComma (line 464) | function arrowBodyNoComma(type) {
  function maybeTarget (line 468) | function maybeTarget(noComma) {
  function target (line 474) | function target(_, value) {
  function targetNoComma (line 477) | function targetNoComma(_, value) {
  function maybelabel (line 480) | function maybelabel(type) {
  function property (line 484) | function property(type) {
  function objprop (line 487) | function objprop(type, value) {
  function getterSetter (line 510) | function getterSetter(type) {
  function afterprop (line 515) | function afterprop(type) {
  function commasep (line 519) | function commasep(what, end, sep) {
  function contCommasep (line 537) | function contCommasep(what, end, info) {
  function block (line 542) | function block(type) {
  function maybetype (line 546) | function maybetype(type, value) {
  function typeexpr (line 552) | function typeexpr(type) {
  function maybeReturnType (line 558) | function maybeReturnType(type) {
  function typeprop (line 561) | function typeprop(type, value) {
  function typearg (line 573) | function typearg(type) {
  function afterType (line 577) | function afterType(type, value) {
  function vardef (line 583) | function vardef() {
  function pattern (line 586) | function pattern(type, value) {
  function proppattern (line 593) | function proppattern(type, value) {
  function maybeAssign (line 603) | function maybeAssign(_type, value) {
  function vardefCont (line 606) | function vardefCont(type) {
  function maybeelse (line 609) | function maybeelse(type, value) {
  function forspec (line 612) | function forspec(type) {
  function forspec1 (line 615) | function forspec1(type) {
  function formaybeinof (line 621) | function formaybeinof(_type, value) {
  function forspec2 (line 625) | function forspec2(type, value) {
  function forspec3 (line 630) | function forspec3(type) {
  function functiondef (line 633) | function functiondef(type, value) {
  function funarg (line 639) | function funarg(type) {
  function classExpression (line 643) | function classExpression(type, value) {
  function className (line 648) | function className(type, value) {
  function classNameAfter (line 651) | function classNameAfter(type, value) {
  function classBody (line 657) | function classBody(type, value) {
  function classfield (line 678) | function classfield(type, value) {
  function afterExport (line 684) | function afterExport(type, value) {
  function exportField (line 690) | function exportField(type, value) {
  function afterImport (line 694) | function afterImport(type) {
  function importSpec (line 698) | function importSpec(type, value) {
  function maybeMoreImports (line 704) | function maybeMoreImports(type) {
  function maybeAs (line 707) | function maybeAs(_type, value) {
  function maybeFrom (line 710) | function maybeFrom(_type, value) {
  function arrayLiteral (line 713) | function arrayLiteral(type) {
  function isContinuedStatement (line 718) | function isContinuedStatement(state, textAfter) {

FILE: docs/editor/mode/urduscript/urduscript.js
  function expressionAllowed (line 14) | function expressionAllowed(stream, state, backUp) {
  function kw (line 30) | function kw(type) {return {type: type, style: "keyword"};}
  function readRegexp (line 85) | function readRegexp(stream) {
  function ret (line 100) | function ret(tp, style, cont) {
  function tokenBase (line 104) | function tokenBase(stream, state) {
  function tokenString (line 169) | function tokenString(quote) {
  function tokenComment (line 185) | function tokenComment(stream, state) {
  function tokenQuasi (line 197) | function tokenQuasi(stream, state) {
  function findFatArrow (line 217) | function findFatArrow(stream, state) {
  function JSLexical (line 252) | function JSLexical(indented, column, type, align, prev, info) {
  function inScope (line 261) | function inScope(state, varname) {
  function parseJS (line 270) | function parseJS(state, style, type, content, stream) {
  function pass (line 294) | function pass() {
  function cont (line 297) | function cont() {
  function register (line 301) | function register(varname) {
  function pushcontext (line 322) | function pushcontext() {
  function popcontext (line 326) | function popcontext() {
  function pushlex (line 330) | function pushlex(type, info) {
  function poplex (line 341) | function poplex() {
  function expect (line 351) | function expect(wanted) {
  function statement (line 360) | function statement(type, value) {
  function expression (line 395) | function expression(type) {
  function expressionNoComma (line 398) | function expressionNoComma(type) {
  function parenExpr (line 401) | function parenExpr(type) {
  function expressionInner (line 405) | function expressionInner(type, noComma) {
  function maybeexpression (line 425) | function maybeexpression(type) {
  function maybeexpressionNoComma (line 429) | function maybeexpressionNoComma(type) {
  function maybeoperatorComma (line 434) | function maybeoperatorComma(type, value) {
  function maybeoperatorNoComma (line 438) | function maybeoperatorNoComma(type, value, noComma) {
  function quasi (line 454) | function quasi(type, value) {
  function continueQuasi (line 459) | function continueQuasi(type) {
  function arrowBody (line 466) | function arrowBody(type) {
  function arrowBodyNoComma (line 470) | function arrowBodyNoComma(type) {
  function maybeTarget (line 474) | function maybeTarget(noComma) {
  function target (line 480) | function target(_, value) {
  function targetNoComma (line 483) | function targetNoComma(_, value) {
  function maybelabel (line 486) | function maybelabel(type) {
  function property (line 490) | function property(type) {
  function objprop (line 493) | function objprop(type, value) {
  function getterSetter (line 516) | function getterSetter(type) {
  function afterprop (line 521) | function afterprop(type) {
  function commasep (line 525) | function commasep(what, end, sep) {
  function contCommasep (line 543) | function contCommasep(what, end, info) {
  function block (line 548) | function block(type) {
  function maybetype (line 552) | function maybetype(type, value) {
  function typeexpr (line 558) | function typeexpr(type) {
  function maybeReturnType (line 564) | function maybeReturnType(type) {
  function typeprop (line 567) | function typeprop(type, value) {
  function typearg (line 579) | function typearg(type) {
  function afterType (line 583) | function afterType(type, value) {
  function vardef (line 589) | function vardef() {
  function pattern (line 592) | function pattern(type, value) {
  function proppattern (line 599) | function proppattern(type, value) {
  function maybeAssign (line 609) | function maybeAssign(_type, value) {
  function vardefCont (line 612) | function vardefCont(type) {
  function maybeelse (line 615) | function maybeelse(type, value) {
  function forspec (line 618) | function forspec(type) {
  function forspec1 (line 621) | function forspec1(type) {
  function formaybeinof (line 627) | function formaybeinof(_type, value) {
  function forspec2 (line 631) | function forspec2(type, value) {
  function forspec3 (line 636) | function forspec3(type) {
  function functiondef (line 639) | function functiondef(type, value) {
  function funarg (line 645) | function funarg(type) {
  function classExpression (line 649) | function classExpression(type, value) {
  function className (line 654) | function className(type, value) {
  function classNameAfter (line 657) | function classNameAfter(type, value) {
  function classBody (line 663) | function classBody(type, value) {
  function classfield (line 684) | function classfield(type, value) {
  function afterExport (line 690) | function afterExport(type, value) {
  function exportField (line 696) | function exportField(type, value) {
  function afterImport (line 700) | function afterImport(type) {
  function importSpec (line 704) | function importSpec(type, value) {
  function maybeMoreImports (line 710) | function maybeMoreImports(type) {
  function maybeAs (line 713) | function maybeAs(_type, value) {
  function maybeFrom (line 716) | function maybeFrom(_type, value) {
  function arrayLiteral (line 719) | function arrayLiteral(type) {
  function isContinuedStatement (line 724) | function isContinuedStatement(state, textAfter) {

FILE: docs/editor/scripts/codemirror.js
  function classTest (line 50) | function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)...
  function removeChildren (line 61) | function removeChildren(e) {
  function removeChildrenAndAdd (line 67) | function removeChildrenAndAdd(parent, e) {
  function elt (line 71) | function elt(tag, content, className, style) {
  function eltP (line 80) | function eltP(tag, content, className, style) {
  function contains (line 103) | function contains(parent, child) {
  function activeElt (line 114) | function activeElt() {
  function addClass (line 129) | function addClass(node, cls) {
  function joinClasses (line 133) | function joinClasses(a, b) {
  function bind (line 146) | function bind(f) {
  function copyObj (line 151) | function copyObj(obj, target, overwrite) {
  function countColumn (line 161) | function countColumn(string, end, tabSize, startIndex, startValue) {
  function indexOf (line 182) | function indexOf(array, elt) {
  function findColumn (line 201) | function findColumn(string, goal, tabSize) {
  function spaceStr (line 216) | function spaceStr(n) {
  function lst (line 222) | function lst(arr) { return arr[arr.length-1] }
  function map (line 224) | function map(array, f) {
  function insertSorted (line 230) | function insertSorted(array, value, score) {
  function nothing (line 236) | function nothing() {}
  function createObj (line 238) | function createObj(base, props) {
  function isWordCharBasic (line 251) | function isWordCharBasic(ch) {
  function isWordChar (line 255) | function isWordChar(ch, helper) {
  function isEmpty (line 261) | function isEmpty(obj) {
  function isExtendingChar (line 272) | function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendi...
  function skipExtendingChars (line 275) | function skipExtendingChars(str, pos, dir) {
  function findFirst (line 282) | function findFirst(pred, from, to) {
  function Display (line 295) | function Display(place, doc, input) {
  function getLine (line 395) | function getLine(doc, n) {
  function getBetween (line 411) | function getBetween(doc, start, end) {
  function getLines (line 423) | function getLines(doc, from, to) {
  function updateLineHeight (line 431) | function updateLineHeight(line, height) {
  function lineNo (line 438) | function lineNo(line) {
  function lineAtHeight (line 452) | function lineAtHeight(chunk, h) {
  function isLine (line 472) | function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}
  function lineNumberFor (line 474) | function lineNumberFor(options, i) {
  function Pos (line 479) | function Pos(line, ch, sticky) {
  function cmp (line 490) | function cmp(a, b) { return a.line - b.line || a.ch - b.ch }
  function equalCursorPos (line 492) | function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b)...
  function copyPos (line 494) | function copyPos(x) {return Pos(x.line, x.ch)}
  function maxPos (line 495) | function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }
  function minPos (line 496) | function minPos(a, b) { return cmp(a, b) < 0 ? a : b }
  function clipLine (line 500) | function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.fi...
  function clipPos (line 501) | function clipPos(doc, pos) {
  function clipToLen (line 507) | function clipToLen(pos, linelen) {
  function clipPosArray (line 513) | function clipPosArray(doc, array) {
  function seeReadOnlySpans (line 522) | function seeReadOnlySpans() {
  function seeCollapsedSpans (line 526) | function seeCollapsedSpans() {
  function MarkedSpan (line 532) | function MarkedSpan(marker, from, to) {
  function getMarkedSpanFor (line 538) | function getMarkedSpanFor(spans, marker) {
  function removeMarkedSpan (line 546) | function removeMarkedSpan(spans, span) {
  function addMarkedSpan (line 553) | function addMarkedSpan(line, span) {
  function markedSpansBefore (line 562) | function markedSpansBefore(old, startCh, isInsert) {
  function markedSpansAfter (line 574) | function markedSpansAfter(old, endCh, isInsert) {
  function stretchSpansOverChange (line 594) | function stretchSpansOverChange(doc, change) {
  function clearEmptySpans (line 656) | function clearEmptySpans(spans) {
  function removeReadOnlyRanges (line 667) | function removeReadOnlyRanges(doc, from, to) {
  function detachMarkedSpans (line 696) | function detachMarkedSpans(line) {
  function attachMarkedSpans (line 703) | function attachMarkedSpans(line, spans) {
  function extraLeft (line 712) | function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }
  function extraRight (line 713) | function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }
  function compareCollapsedMarkers (line 718) | function compareCollapsedMarkers(a, b) {
  function collapsedSpanAtSide (line 731) | function collapsedSpanAtSide(line, start) {
  function collapsedSpanAtStart (line 741) | function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, t...
  function collapsedSpanAtEnd (line 742) | function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, fal...
  function conflictingCollapsedRange (line 747) | function conflictingCollapsedRange(doc, lineNo, from, to, marker) {
  function visualLine (line 767) | function visualLine(line) {
  function visualLineEnd (line 774) | function visualLineEnd(line) {
  function visualLineContinued (line 783) | function visualLineContinued(line) {
  function visualLineNo (line 794) | function visualLineNo(doc, lineN) {
  function visualLineEndNo (line 802) | function visualLineEndNo(doc, lineN) {
  function lineIsHidden (line 814) | function lineIsHidden(doc, line) {
  function lineIsHiddenInner (line 825) | function lineIsHiddenInner(doc, line, span) {
  function heightAtLine (line 842) | function heightAtLine(lineObj) {
  function lineLength (line 864) | function lineLength(line) {
  function findMaxLine (line 883) | function findMaxLine(cm) {
  function iterateBidiSections (line 899) | function iterateBidiSections(order, from, to, f) {
  function getBidiPartAt (line 913) | function getBidiPartAt(order, ch, sticky) {
  function charType (line 959) | function charType(code) {
  function BidiSpan (line 972) | function BidiSpan(level, from, to) {
  function getOrder (line 1102) | function getOrder(line, direction) {
  function moveCharLogically (line 1108) | function moveCharLogically(line, ch, dir) {
  function moveLogically (line 1113) | function moveLogically(line, start, dir) {
  function endOfLine (line 1118) | function endOfLine(visually, cm, lineObj, lineNo, dir) {
  function moveVisually (line 1145) | function moveVisually(cm, line, start, dir) {
  function getHandlers (line 1232) | function getHandlers(emitter, type) {
  function off (line 1236) | function off(emitter, type, f) {
  function signal (line 1251) | function signal(emitter, type /*, values...*/) {
  function signalDOMEvent (line 1261) | function signalDOMEvent(cm, e, override) {
  function signalCursorActivity (line 1268) | function signalCursorActivity(cm) {
  function hasHandler (line 1276) | function hasHandler(emitter, type) {
  function eventMixin (line 1282) | function eventMixin(ctor) {
  function e_preventDefault (line 1290) | function e_preventDefault(e) {
  function e_stopPropagation (line 1294) | function e_stopPropagation(e) {
  function e_defaultPrevented (line 1298) | function e_defaultPrevented(e) {
  function e_stop (line 1301) | function e_stop(e) {e_preventDefault(e); e_stopPropagation(e)}
  function e_target (line 1303) | function e_target(e) {return e.target || e.srcElement}
  function e_button (line 1304) | function e_button(e) {
  function zeroWidthElement (line 1325) | function zeroWidthElement(measure) {
  function hasBadBidiRects (line 1340) | function hasBadBidiRects(measure) {
  function hasBadZoomedRects (line 1389) | function hasBadZoomedRects(measure) {
  function defineMode (line 1402) | function defineMode(name, mode) {
  function defineMIME (line 1408) | function defineMIME(mime, spec) {
  function resolveMode (line 1414) | function resolveMode(spec) {
  function getMode (line 1433) | function getMode(options, spec) {
  function extendMode (line 1457) | function extendMode(mode, properties) {
  function copyState (line 1462) | function copyState(mode, state) {
  function innerMode (line 1476) | function innerMode(mode, state) {
  function startState (line 1487) | function startState(mode, a1, a2) {
  function highlightLine (line 1614) | function highlightLine(cm, line, context, forceToEnd) {
  function getLineStyles (line 1656) | function getLineStyles(cm, line, updateFrontier) {
  function getContextBefore (line 1672) | function getContextBefore(cm, n, precise) {
  function processLine (line 1692) | function processLine(cm, text, context, startAt) {
  function callBlankLine (line 1703) | function callBlankLine(mode, state) {
  function readToken (line 1710) | function readToken(mode, stream, state, inner) {
  function takeToken (line 1727) | function takeToken(cm, pos, precise, asArray) {
  function extractLineClasses (line 1741) | function extractLineClasses(type, output) {
  function runMode (line 1756) | function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
  function findStartLine (line 1800) | function findStartLine(cm, n, precise) {
  function retreatFrontier (line 1817) | function retreatFrontier(doc, n) {
  function updateLine (line 1850) | function updateLine(line, text, markedSpans, estimateHeight) {
  function cleanUpLine (line 1862) | function cleanUpLine(line) {
  function interpretTokenStyle (line 1872) | function interpretTokenStyle(style, options) {
  function buildLineContent (line 1884) | function buildLineContent(cm, lineView) {
  function defaultSpecialCharPlaceholder (line 1942) | function defaultSpecialCharPlaceholder(ch) {
  function buildToken (line 1951) | function buildToken(builder, text, style, startStyle, endStyle, title, c...
  function splitSpaces (line 2013) | function splitSpaces(text, trailingBefore) {
  function buildTokenBadBidi (line 2028) | function buildTokenBadBidi(inner, order) {
  function buildCollapsedSpan (line 2048) | function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
  function insertLineContent (line 2066) | function insertLineContent(line, builder, styles) {
  function LineView (line 2138) | function LineView(doc, line, lineN) {
  function buildViewArray (line 2150) | function buildViewArray(cm, from, to) {
  function pushOperation (line 2162) | function pushOperation(op) {
  function fireCallbacksForOps (line 2173) | function fireCallbacksForOps(group) {
  function finishOperation (line 2189) | function finishOperation(op, endCb) {
  function signalLater (line 2209) | function signalLater(emitter, type /*, values...*/) {
  function fireOrphanDelayed (line 2229) | function fireOrphanDelayed() {
  function updateLineForChanges (line 2238) | function updateLineForChanges(cm, lineView, lineN, dims) {
  function ensureLineWrapped (line 2251) | function ensureLineWrapped(lineView) {
  function updateLineBackground (line 2262) | function updateLineBackground(cm, lineView) {
  function getLineContent (line 2277) | function getLineContent(cm, lineView) {
  function updateLineText (line 2290) | function updateLineText(cm, lineView) {
  function updateLineClasses (line 2305) | function updateLineClasses(cm, lineView) {
  function updateLineGutter (line 2315) | function updateLineGutter(cm, lineView, lineN, dims) {
  function updateLineWidgets (line 2353) | function updateLineWidgets(cm, lineView, dims) {
  function buildLineElement (line 2364) | function buildLineElement(cm, lineView, lineN, dims) {
  function insertLineWidgets (line 2378) | function insertLineWidgets(cm, lineView, dims) {
  function insertLineWidgetsFor (line 2384) | function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
  function positionLineWidget (line 2400) | function positionLineWidget(widget, node, lineView, dims) {
  function widgetHeight (line 2418) | function widgetHeight(widget) {
  function eventInWidget (line 2434) | function eventInWidget(display, e) {
  function paddingTop (line 2444) | function paddingTop(display) {return display.lineSpace.offsetTop}
  function paddingVert (line 2445) | function paddingVert(display) {return display.mover.offsetHeight - displ...
  function paddingH (line 2446) | function paddingH(display) {
  function scrollGap (line 2455) | function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }
  function displayWidth (line 2456) | function displayWidth(cm) {
  function displayHeight (line 2459) | function displayHeight(cm) {
  function ensureLineHeights (line 2467) | function ensureLineHeights(cm, lineView, rect) {
  function mapFromLineView (line 2488) | function mapFromLineView(lineView, line, lineN) {
  function updateExternalMeasurement (line 2501) | function updateExternalMeasurement(cm, line) {
  function measureChar (line 2514) | function measureChar(cm, line, ch, bias) {
  function findViewForLine (line 2519) | function findViewForLine(cm, lineN) {
  function prepareMeasureForLine (line 2532) | function prepareMeasureForLine(cm, line) {
  function measureCharPrepared (line 2554) | function measureCharPrepared(cm, prepared, ch, bias, varHeight) {
  function nodeAndOffsetInLineMap (line 2576) | function nodeAndOffsetInLineMap(map, ch, bias) {
  function getUsefulRect (line 2614) | function getUsefulRect(rects, bias) {
  function measureCharInner (line 2624) | function measureCharInner(cm, prepared, ch, bias) {
  function maybeUpdateRectForZooming (line 2677) | function maybeUpdateRectForZooming(measure, rect) {
  function clearLineMeasurementCacheFor (line 2687) | function clearLineMeasurementCacheFor(lineView) {
  function clearLineMeasurementCache (line 2696) | function clearLineMeasurementCache(cm) {
  function clearCaches (line 2703) | function clearCaches(cm) {
  function pageScrollX (line 2710) | function pageScrollX() {
  function pageScrollY (line 2717) | function pageScrollY() {
  function intoCoordSystem (line 2726) | function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {
  function fromCoordSystem (line 2748) | function fromCoordSystem(cm, coords, context) {
  function charCoords (line 2765) | function charCoords(cm, pos, context, lineObj, bias) {
  function cursorCoords (line 2786) | function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHei...
  function estimateCoords (line 2817) | function estimateCoords(cm, pos) {
  function PosWithInfo (line 2832) | function PosWithInfo(line, ch, sticky, outside, xRel) {
  function coordsChar (line 2841) | function coordsChar(cm, x, y) {
  function wrappedLineExtent (line 2862) | function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {
  function wrappedLineExtentChar (line 2870) | function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {
  function coordsCharInner (line 2875) | function coordsCharInner(cm, lineObj, lineNo, x, y) {
  function textHeight (line 2938) | function textHeight(display) {
  function charWidth (line 2958) | function charWidth(display) {
  function getDimensions (line 2970) | function getDimensions(cm) {
  function compensateForHScroll (line 2987) | function compensateForHScroll(display) {
  function estimateHeight (line 2994) | function estimateHeight(cm) {
  function estimateLineHeights (line 3012) | function estimateLineHeights(cm) {
  function posFromMouse (line 3025) | function posFromMouse(cm, e, liberal, forRect) {
  function findViewIndex (line 3043) | function findViewIndex(cm, n) {
  function updateSelection (line 3054) | function updateSelection(cm) {
  function prepareSelection (line 3058) | function prepareSelection(cm, primary) {
  function drawSelectionCursor (line 3077) | function drawSelectionCursor(cm, head, output) {
  function drawSelectionRange (line 3096) | function drawSelectionRange(cm, range, output) {
  function restartBlink (line 3169) | function restartBlink(cm) {
  function ensureFocus (line 3182) | function ensureFocus(cm) {
  function delayBlurEvent (line 3186) | function delayBlurEvent(cm) {
  function onFocus (line 3194) | function onFocus(cm, e) {
  function onBlur (line 3213) | function onBlur(cm, e) {
  function updateHeightsInViewport (line 3227) | function updateHeightsInViewport(cm) {
  function updateWidgetHeight (line 3254) | function updateWidgetHeight(line) {
  function visibleLines (line 3262) | function visibleLines(display, doc, viewport) {
  function alignHorizontally (line 3285) | function alignHorizontally(cm) {
  function maybeUpdateLineNumberWidth (line 3308) | function maybeUpdateLineNumberWidth(cm) {
  function maybeScrollWindow (line 3330) | function maybeScrollWindow(cm, rect) {
  function scrollPosIntoView (line 3347) | function scrollPosIntoView(cm, pos, end, margin) {
  function scrollIntoView (line 3381) | function scrollIntoView(cm, rect) {
  function calculateScrollPos (line 3391) | function calculateScrollPos(cm, rect) {
  function addToScrollTop (line 3421) | function addToScrollTop(cm, top) {
  function ensureCursorVisible (line 3429) | function ensureCursorVisible(cm) {
  function scrollToCoords (line 3435) | function scrollToCoords(cm, x, y) {
  function scrollToRange (line 3441) | function scrollToRange(cm, range) {
  function resolveScrollToPos (line 3450) | function resolveScrollToPos(cm) {
  function scrollToCoordsRange (line 3459) | function scrollToCoordsRange(cm, from, to, margin) {
  function updateScrollTop (line 3471) | function updateScrollTop(cm, val) {
  function setScrollTop (line 3479) | function setScrollTop(cm, val, forceScroll) {
  function setScrollLeft (line 3489) | function setScrollLeft(cm, val, isScroller, forceScroll) {
  function measureForScrollbars (line 3502) | function measureForScrollbars(cm) {
  function maybeDisable (line 3593) | function maybeDisable() {
  function updateScrollbars (line 3622) | function updateScrollbars(cm, measure) {
  function updateScrollbarsInner (line 3636) | function updateScrollbarsInner(cm, measure) {
  function initScrollbars (line 3658) | function initScrollbars(cm) {
  function startOperation (line 3688) | function startOperation(cm) {
  function endOperation (line 3710) | function endOperation(cm) {
  function endOperations (line 3721) | function endOperations(group) {
  function endOperation_R1 (line 3735) | function endOperation_R1(op) {
  function endOperation_W1 (line 3748) | function endOperation_W1(op) {
  function endOperation_R2 (line 3752) | function endOperation_R2(op) {
  function endOperation_W2 (line 3773) | function endOperation_W2(op) {
  function endOperation_finish (line 3798) | function endOperation_finish(op) {
  function runInOp (line 3837) | function runInOp(cm, f) {
  function operation (line 3844) | function operation(cm, f) {
  function methodOp (line 3854) | function methodOp(f) {
  function docMethodOp (line 3862) | function docMethodOp(f) {
  function regChange (line 3878) | function regChange(cm, from, to, lendiff) {
  function regLineChange (line 3943) | function regLineChange(cm, line, type) {
  function resetView (line 3957) | function resetView(cm) {
  function viewCuttingPoint (line 3963) | function viewCuttingPoint(cm, oldN, newN, dir) {
  function adjustView (line 3990) | function adjustView(cm, from, to) {
  function countDirtyView (line 4011) | function countDirtyView(cm) {
  function startWorker (line 4022) | function startWorker(cm, time) {
  function highlightWorker (line 4027) | function highlightWorker(cm) {
  function maybeClipScrollbars (line 4097) | function maybeClipScrollbars(cm) {
  function selectionSnapshot (line 4108) | function selectionSnapshot(cm) {
  function restoreSelection (line 4125) | function restoreSelection(snapshot) {
  function updateDisplayIfNeeded (line 4141) | function updateDisplayIfNeeded(cm, update) {
  function postUpdateDisplay (line 4213) | function postUpdateDisplay(cm, update) {
  function updateDisplaySimple (line 4243) | function updateDisplaySimple(cm, viewport) {
  function patchDisplay (line 4260) | function patchDisplay(cm, updateNumbersFrom, dims) {
  function updateGutterSpace (line 4302) | function updateGutterSpace(cm) {
  function setDocumentHeight (line 4307) | function setDocumentHeight(cm, measure) {
  function updateGutters (line 4315) | function updateGutters(cm) {
  function setGuttersForLineNumbers (line 4333) | function setGuttersForLineNumbers(options) {
  function wheelEventDelta (line 4354) | function wheelEventDelta(e) {
  function wheelEventPixels (line 4361) | function wheelEventPixels(e) {
  function onScrollWheel (line 4368) | function onScrollWheel(cm, e) {
  function normalizeSelection (line 4507) | function normalizeSelection(ranges, primIndex) {
  function simpleSelection (line 4523) | function simpleSelection(anchor, head) {
  function changeEnd (line 4529) | function changeEnd(change) {
  function adjustForChange (line 4537) | function adjustForChange(pos, change) {
  function computeSelAfterChange (line 4546) | function computeSelAfterChange(doc, change) {
  function offsetPos (line 4556) | function offsetPos(pos, old, nw) {
  function computeReplacedSel (line 4565) | function computeReplacedSel(doc, changes, hint) {
  function loadMode (line 4586) | function loadMode(cm) {
  function resetModeState (line 4591) | function resetModeState(cm) {
  function isWholeLineUpdate (line 4607) | function isWholeLineUpdate(doc, change) {
  function updateDoc (line 4613) | function updateDoc(doc, change, markedSpans, estimateHeight) {
  function linkedDocs (line 4665) | function linkedDocs(doc, f, sharedHistOnly) {
  function attachDoc (line 4680) | function attachDoc(cm, doc) {
  function setDirectionClass (line 4692) | function setDirectionClass(cm) {
  function directionChanged (line 4696) | function directionChanged(cm) {
  function History (line 4703) | function History(startGen) {
  function historyChangeFromChange (line 4720) | function historyChangeFromChange(doc, change) {
  function clearSelectionEvents (line 4729) | function clearSelectionEvents(array) {
  function lastChangeEvent (line 4739) | function lastChangeEvent(hist, force) {
  function addChangeToHistory (line 4754) | function addChangeToHistory(doc, change, selAfter, opId) {
  function selectionEventCanBeMerged (line 4797) | function selectionEventCanBeMerged(doc, origin, prev, sel) {
  function addSelectionToHistory (line 4810) | function addSelectionToHistory(doc, sel, opId, options) {
  function pushSelectionToHistory (line 4832) | function pushSelectionToHistory(sel, dest) {
  function attachLocalSpans (line 4839) | function attachLocalSpans(doc, change, from, to) {
  function removeClearedSpans (line 4850) | function removeClearedSpans(spans) {
  function getOldSpans (line 4861) | function getOldSpans(doc, change) {
  function mergeOldSpans (line 4874) | function mergeOldSpans(doc, change) {
  function copyHistoryArray (line 4898) | function copyHistoryArray(events, newGroup, instantiateSel) {
  function extendRange (line 4930) | function extendRange(range, head, other, extend) {
  function extendSelection (line 4949) | function extendSelection(doc, head, other, options, extend) {
  function extendSelections (line 4956) | function extendSelections(doc, heads, options) {
  function replaceOneSelection (line 4966) | function replaceOneSelection(doc, i, range, options) {
  function setSimpleSelection (line 4973) | function setSimpleSelection(doc, anchor, head, options) {
  function filterSelectionChange (line 4979) | function filterSelectionChange(doc, sel, options) {
  function setSelectionReplaceHistory (line 4998) | function setSelectionReplaceHistory(doc, sel, options) {
  function setSelection (line 5009) | function setSelection(doc, sel, options) {
  function setSelectionNoUndo (line 5014) | function setSelectionNoUndo(doc, sel, options) {
  function setSelectionInner (line 5026) | function setSelectionInner(doc, sel) {
  function reCheckSelection (line 5040) | function reCheckSelection(doc) {
  function skipAtomicInSelection (line 5046) | function skipAtomicInSelection(doc, sel, bias, mayClear) {
  function skipAtomicInner (line 5061) | function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
  function skipAtomic (line 5094) | function skipAtomic(doc, pos, oldPos, bias, mayClear) {
  function movePos (line 5107) | function movePos(doc, pos, dir, line) {
  function selectAll (line 5119) | function selectAll(cm) {
  function filterChange (line 5126) | function filterChange(doc, change, update) {
  function makeChange (line 5150) | function makeChange(doc, change, ignoreReadOnly) {
  function makeChangeInner (line 5172) | function makeChangeInner(doc, change) {
  function makeChangeFromHistory (line 5190) | function makeChangeFromHistory(doc, type, allowSelectionOnly) {
  function shiftDoc (line 5263) | function shiftDoc(doc, distance) {
  function makeChangeSingleDoc (line 5279) | function makeChangeSingleDoc(doc, change, selAfter, spans) {
  function makeChangeSingleDocInEditor (line 5312) | function makeChangeSingleDocInEditor(cm, change, spans) {
  function replaceRange (line 5370) | function replaceRange(doc, code, from, to, origin) {
  function rebaseHistSelSingle (line 5379) | function rebaseHistSelSingle(pos, from, to, diff) {
  function rebaseHistArray (line 5395) | function rebaseHistArray(array, from, to, diff) {
  function rebaseHist (line 5423) | function rebaseHist(hist, change) {
  function changeLine (line 5432) | function changeLine(doc, handle, changeType, op) {
  function LeafChunk (line 5454) | function LeafChunk(lines) {
  function BranchChunk (line 5507) | function BranchChunk(children) {
  function adjustScrollWhenAboveVisible (line 5670) | function adjustScrollWhenAboveVisible(cm, line, diff) {
  function addLineWidget (line 5675) | function addLineWidget(doc, handle, node, options) {
  function markText (line 5835) | function markText(doc, from, to, options, type) {
  function markTextShared (line 5933) | function markTextShared(doc, from, to, options, type) {
  function findSharedMarkers (line 5948) | function findSharedMarkers(doc) {
  function copySharedMarkers (line 5952) | function copySharedMarkers(doc, markers) {
  function detachSharedMarkers (line 5964) | function detachSharedMarkers(markers) {
  function onDrop (line 6406) | function onDrop(e) {
  function onDragStart (line 6466) | function onDragStart(cm, e) {
  function onDragOver (line 6489) | function onDragOver(cm, e) {
  function clearDragCursor (line 6501) | function clearDragCursor(cm) {
  function forEachCodeMirror (line 6512) | function forEachCodeMirror(f) {
  function ensureGlobalHandlers (line 6522) | function ensureGlobalHandlers() {
  function registerGlobalHandlers (line 6527) | function registerGlobalHandlers() {
  function onResize (line 6540) | function onResize(cm) {
  function normalizeKeyName (line 6613) | function normalizeKeyName(name) {
  function normalizeKeyMap (line 6637) | function normalizeKeyMap(keymap) {
  function lookupKey (line 6664) | function lookupKey(key, map, handle, context) {
  function isModifierKey (line 6683) | function isModifierKey(value) {
  function addModifierNames (line 6688) | function addModifierNames(name, event, noShift) {
  function keyName (line 6698) | function keyName(event, noShift) {
  function getKeyMap (line 6705) | function getKeyMap(val) {
  function deleteNearSelection (line 6711) | function deleteNearSelection(cm, compute) {
  function lineStart (line 6877) | function lineStart(cm, lineN) {
  function lineEnd (line 6883) | function lineEnd(cm, lineN) {
  function lineStartSmart (line 6889) | function lineStartSmart(cm, pos) {
  function doHandleBinding (line 6902) | function doHandleBinding(cm, bound, dropShift) {
  function lookupKeyForEditor (line 6922) | function lookupKeyForEditor(cm, name, handle) {
  function dispatchKey (line 6935) | function dispatchKey(cm, name, e, handle) {
  function handleKeyBinding (line 6967) | function handleKeyBinding(cm, e) {
  function handleCharBinding (line 6986) | function handleCharBinding(cm, e, ch) {
  function onKeyDown (line 6991) | function onKeyDown(e) {
  function showCrossHair (line 7012) | function showCrossHair(cm) {
  function onKeyUp (line 7027) | function onKeyUp(e) {
  function onKeyPress (line 7032) | function onKeyPress(e) {
  function clickRepeat (line 7060) | function clickRepeat(pos, button) {
  function onMouseDown (line 7081) | function onMouseDown(e) {
  function handleMappedButton (line 7118) | function handleMappedButton(cm, button, pos, repeat, event) {
  function configureMouse (line 7138) | function configureMouse(cm, repeat, event) {
  function leftButtonDown (line 7151) | function leftButtonDown(cm, pos, repeat, event) {
  function leftButtonStartDrag (line 7169) | function leftButtonStartDrag(cm, event, pos, behavior) {
  function rangeForUnit (line 7208) | function rangeForUnit(cm, pos, unit) {
  function leftButtonSelect (line 7217) | function leftButtonSelect(cm, event, start, behavior) {
  function gutterEvent (line 7350) | function gutterEvent(cm, e, type, prevent) {
  function clickInGutter (line 7374) | function clickInGutter(cm, e) {
  function onContextMenu (line 7383) | function onContextMenu(cm, e) {
  function contextMenuInGutter (line 7389) | function contextMenuInGutter(cm, e) {
  function themeChanged (line 7394) | function themeChanged(cm) {
  function defineOptions (line 7405) | function defineOptions(CodeMirror) {
  function guttersChanged (line 7538) | function guttersChanged(cm) {
  function dragDropChanged (line 7544) | function dragDropChanged(cm, value, old) {
  function wrappingChanged (line 7557) | function wrappingChanged(cm) {
  function CodeMirror (line 7575) | function CodeMirror(place, options) {
  function registerEventHandlers (line 7651) | function registerEventHandlers(cm) {
  function indentLine (line 7766) | function indentLine(cm, n, how, aggressive) {
  function setLastCopied (line 7830) | function setLastCopied(newLastCopied) {
  function applyTextInput (line 7834) | function applyTextInput(cm, inserted, deleted, sel, origin) {
  function handlePaste (line 7882) | function handlePaste(e, cm) {
  function triggerElectric (line 7892) | function triggerElectric(cm, inserted) {
  function copyableRanges (line 7916) | function copyableRanges(cm) {
  function disableBrowserMagic (line 7927) | function disableBrowserMagic(field, spellcheck) {
  function hiddenTextarea (line 7933) | function hiddenTextarea() {
  function addEditorMethods (line 7956) | function addEditorMethods(CodeMirror) {
  function findPosH (line 8399) | function findPosH(doc, pos, dir, unit, visually) {
  function findPosV (line 8459) | function findPosV(cm, pos, dir, unit) {
  function onCopyCut (line 8522) | function onCopyCut(e) {
  function poll (line 8676) | function poll() {
  function posToDOM (line 8842) | function posToDOM(cm, pos) {
  function isInGutter (line 8858) | function isInGutter(node) {
  function badPos (line 8864) | function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }
  function domTextBetween (line 8866) | function domTextBetween(cm, from, to, fromLine, toLine) {
  function domToPos (line 8913) | function domToPos(cm, node, offset) {
  function locateNodeInLineView (line 8932) | function locateNodeInLineView(lineView, node, offset) {
  function prepareCopyCut (line 9032) | function prepareCopyCut(e) {
  function p (line 9164) | function p() {
  function prepareSelectAllHack (line 9267) | function prepareSelectAllHack() {
  function rehide (line 9280) | function rehide() {
  function fromTextArea (line 9326) | function fromTextArea(textarea, options) {
  function addLegacyProps (line 9383) | function addLegacyProps(CodeMirror) {

FILE: docs/editor/scripts/editor.js
  function replaceAll (line 1) | function replaceAll(find, replace, str) {
  function updateExpand (line 130) | function updateExpand() {

FILE: docs/editor/scripts/escodegen.js
  function require (line 3) | function require(file, parentModule) {
  function getDefaultOptions (line 167) | function getDefaultOptions() {
  function stringRepeat (line 203) | function stringRepeat(str, num) {
  function hasLineTerminator (line 218) | function hasLineTerminator(str) {
  function endsWithLineTerminator (line 221) | function endsWithLineTerminator(str) {
  function updateDeeply (line 225) | function updateDeeply(target, override) {
  function generateNumber (line 246) | function generateNumber(value) {
  function escapeRegExpCharacter (line 293) | function escapeRegExpCharacter(ch, previousIsBackslash) {
  function generateRegExp (line 301) | function generateRegExp(reg) {
  function escapeAllowedCharacter (line 338) | function escapeAllowedCharacter(code, next) {
  function escapeDisallowedCharacter (line 365) | function escapeDisallowedCharacter(code) {
  function escapeDirective (line 388) | function escapeDirective(str) {
  function escapeString (line 405) | function escapeString(str) {
  function flattenToString (line 440) | function flattenToString(arr) {
  function toSourceNodeWhenNeeded (line 448) | function toSourceNodeWhenNeeded(generated, node) {
  function noEmptySpace (line 468) | function noEmptySpace() {
  function join (line 471) | function join(left, right) {
  function addIndent (line 491) | function addIndent(stmt) {
  function withIndent (line 497) | function withIndent(fn) {
  function calculateSpaces (line 505) | function calculateSpaces(str) {
  function adjustMultilineComment (line 514) | function adjustMultilineComment(value, specialBase) {
  function generateComment (line 547) | function generateComment(comment, specialBase) {
  function addCommentsToStatement (line 560) | function addCommentsToStatement(stmt, result) {
  function parenthesize (line 621) | function parenthesize(text, current, should) {
  function maybeBlock (line 631) | function maybeBlock(stmt, semicolonOptional, functionBody) {
  function maybeBlockSuffix (line 654) | function maybeBlockSuffix(stmt, result) {
  function generateVerbatim (line 674) | function generateVerbatim(expr, option) {
  function generateIdentifier (line 683) | function generateIdentifier(node) {
  function generatePattern (line 686) | function generatePattern(node, options) {
  function generateFunctionBody (line 699) | function generateFunctionBody(node) {
  function generateExpression (line 740) | function generateExpression(expr, option) {
  function generateStatement (line 1305) | function generateStatement(stmt, option) {
  function generate (line 1760) | function generate(node, options) {
  function SourceNode (line 1963) | function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
  function addMappingWithCode (line 2023) | function addMappingWithCode(mapping, code) {
  function getArg (line 2191) | function getArg(aArgs, aName, aDefaultValue) {
  function urlParse (line 2203) | function urlParse(aUrl) {
  function urlGenerate (line 2217) | function urlGenerate(aParsedUrl) {
  function join (line 2234) | function join(aRoot, aPath) {
  function toSetString (line 2246) | function toSetString(aStr) {
  function fromSetString (line 2250) | function fromSetString(aStr) {
  function relative (line 2254) | function relative(aRoot, aPath) {
  function strcmp (line 2263) | function strcmp(aStr1, aStr2) {
  function compareByOriginalPositions (line 2268) | function compareByOriginalPositions(mappingA, mappingB, onlyCompareOrigi...
  function compareByGeneratedPositions (line 2294) | function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGene...
  function amdefine (line 2324) | function amdefine(module, requireFn) {
  function SourceMapGenerator (line 2523) | function SourceMapGenerator(aArgs) {
  function ArraySet (line 2753) | function ArraySet() {
  function toVLQSigned (line 2805) | function toVLQSigned(aValue) {
  function fromVLQSigned (line 2808) | function fromVLQSigned(aValue) {
  function SourceMapConsumer (line 2884) | function SourceMapConsumer(aSourceMap) {
  function recursiveSearch (line 3124) | function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {
  function isStrictModeReservedWordES6 (line 3157) | function isStrictModeReservedWordES6(id) {
  function isKeywordES5 (line 3172) | function isKeywordES5(id, strict) {
  function isKeywordES6 (line 3178) | function isKeywordES6(id, strict) {
  function isRestrictedWord (line 3203) | function isRestrictedWord(id) {
  function isIdentifierName (line 3206) | function isIdentifierName(id) {
  function isDecimalDigit (line 3239) | function isDecimalDigit(ch) {
  function isHexDigit (line 3242) | function isHexDigit(ch) {
  function isOctalDigit (line 3245) | function isOctalDigit(ch) {
  function isWhiteSpace (line 3248) | function isWhiteSpace(ch) {
  function isLineTerminator (line 3269) | function isLineTerminator(ch) {
  function isIdentifierStart (line 3272) | function isIdentifierStart(ch) {
  function isIdentifierPart (line 3275) | function isIdentifierPart(ch) {
  function ignoreJSHintError (line 3353) | function ignoreJSHintError() {
  function deepCopy (line 3361) | function deepCopy(obj) {
  function shallowCopy (line 3375) | function shallowCopy(obj) {
  function upperBound (line 3385) | function upperBound(array, func) {
  function lowerBound (line 3401) | function lowerBound(array, func) {
  function Reference (line 3571) | function Reference(parent, key) {
  function Element (line 3578) | function Element(node, path, wrap, ref) {
  function Controller (line 3584) | function Controller() {
  function addToPath (line 3588) | function addToPath(result, path) {
  function traverse (line 3787) | function traverse(root, visitor) {
  function replace (line 3791) | function replace(root, visitor) {
  function extendCommentRange (line 3795) | function extendCommentRange(comment, tokens) {
  function attachComments (line 3813) | function attachComments(tree, providedComments, tokens) {

FILE: docs/editor/scripts/expander.js
  function StringMap (line 52) | function StringMap(o) {
  function remdup (line 83) | function remdup(mark, mlist) {
  function marksof (line 90) | function marksof(ctx, stopName, originalName) {
  function resolve (line 109) | function resolve(stx) {
  function resolveCtx (line 138) | function resolveCtx(originalName, ctx, stop_spine, stop_branch, cache) {
  function resolveCtxFull (line 146) | function resolveCtxFull(originalName, ctx, stop_spine, stop_branch, cach...
  function arraysEqual (line 183) | function arraysEqual(a, b) {
  function renames (line 194) | function renames(defctx, oldctx, originalName) {
  function unionEl (line 203) | function unionEl(arr, el) {
  function fresh (line 213) | function fresh() {
  function wrapDelim (line 218) | function wrapDelim(towrap, delimSyntax) {
  function getParamIdentifiers (line 230) | function getParamIdentifiers(argSyntax) {
  function inherit (line 241) | function inherit(parent, child, methods) {
  function TermTree (line 251) | function TermTree() {
  function EOF (line 330) | function EOF(eof) {
  function Keyword (line 338) | function Keyword(keyword) {
  function Punc (line 346) | function Punc(punc) {
  function Delimiter (line 354) | function Delimiter(delim) {
  function LetMacro (line 362) | function LetMacro(name, body) {
  function Macro (line 374) | function Macro(name, body) {
  function AnonMacro (line 386) | function AnonMacro(body) {
  function OperatorDefinition (line 394) | function OperatorDefinition(type, name, prec, assoc, body) {
  function Module (line 412) | function Module(body, exports$3) {
  function Export (line 424) | function Export(name) {
  function VariableDeclaration (line 432) | function VariableDeclaration(ident, eq, init, comma) {
  function Statement (line 448) | function Statement() {
  function Empty (line 455) | function Empty() {
  function CatchClause (line 462) | function CatchClause(keyword, params, body) {
  function ForStatement (line 476) | function ForStatement(keyword, cond) {
  function Expr (line 488) | function Expr() {
  function UnaryOp (line 495) | function UnaryOp(op, expr) {
  function PostfixOp (line 507) | function PostfixOp(expr, op) {
  function BinOp (line 519) | function BinOp(left, op, right) {
  function AssignmentExpression (line 533) | function AssignmentExpression(left, op, right) {
  function ConditionalExpression (line 547) | function ConditionalExpression(cond, question, tru, colon, fls) {
  function NamedFun (line 565) | function NamedFun(keyword, star, name, params, body) {
  function AnonFun (line 583) | function AnonFun(keyword, star, params, body) {
  function ArrowFun (line 599) | function ArrowFun(params, arrow, body) {
  function Const (line 613) | function Const(keyword, call) {
  function ObjDotGet (line 625) | function ObjDotGet(left, dot, right) {
  function ObjGet (line 639) | function ObjGet(left, right) {
  function YieldExpression (line 651) | function YieldExpression(keyword, expr) {
  function Template (line 663) | function Template(template) {
  function PrimaryExpression (line 671) | function PrimaryExpression() {
  function ThisExpression (line 678) | function ThisExpression(keyword) {
  function Lit (line 686) | function Lit(lit) {
  function Block (line 694) | function Block(body) {
  function ArrayLiteral (line 702) | function ArrayLiteral(array) {
  function ParenExpression (line 710) | function ParenExpression(expr) {
  function Id (line 718) | function Id(id) {
  function Partial (line 726) | function Partial() {
  function PartialOperation (line 733) | function PartialOperation(stx, left) {
  function PartialExpression (line 745) | function PartialExpression(stx, left, combine) {
  function BindingStatement (line 759) | function BindingStatement(keyword, decls) {
  function VariableStatement (line 779) | function VariableStatement(keyword, decls) {
  function LetStatement (line 791) | function LetStatement(keyword, decls) {
  function ConstStatement (line 803) | function ConstStatement(keyword, decls) {
  function Call (line 815) | function Call(fun, args, delim, commas) {
  function stxIsUnaryOp (line 857) | function stxIsUnaryOp(stx) {
  function stxIsBinOp (line 871) | function stxIsBinOp(stx) {
  function getUnaryOpPrec (line 899) | function getUnaryOpPrec(op) {
  function getBinaryOpPrec (line 915) | function getBinaryOpPrec(op) {
  function getBinaryOpAssoc (line 943) | function getBinaryOpAssoc(op) {
  function stxIsAssignOp (line 971) | function stxIsAssignOp(stx) {
  function enforestVarStatement (line 988) | function enforestVarStatement(stx, context, varStx) {
  function enforestAssignment (line 1031) | function enforestAssignment(stx, context, left, prevStx, prevTerms) {
  function adjustLineContext (line 1062) | function adjustLineContext(stx, original, current) {
  function getName (line 1118) | function getName(head, rest) {
  function getMacroInEnv (line 1133) | function getMacroInEnv(head, rest, env) {
  function nameInEnv (line 1162) | function nameInEnv(head, rest, env) {
  function resolveFast (line 1167) | function resolveFast(stx, env) {
  function expandMacro (line 1171) | function expandMacro(stx, context, opCtx, opType, macroObj) {
  function comparePrec (line 1233) | function comparePrec(left, right, assoc) {
  function enforest (line 1241) | function enforest(toks, context, prevStx, prevTerms) {
  function rewindOpCtx (line 1738) | function rewindOpCtx(opCtx, res) {
  function get_expression (line 1789) | function get_expression(stx, context) {
  function tagWithTerm (line 1836) | function tagWithTerm(term, stx) {
  function applyMarkToPatternEnv (line 1852) | function applyMarkToPatternEnv(newMark, env) {
  function loadMacroDef (line 1882) | function loadMacroDef(body, context) {
  function expandToTermTree (line 1974) | function expandToTermTree(stx, context) {
  function addToDefinitionCtx (line 2116) | function addToDefinitionCtx(idents, defscope, skipRep) {
  function expandTermTreeToFinal (line 2149) | function expandTermTreeToFinal(term, context) {
  function expand (line 2305) | function expand(stx, context) {
  function makeExpanderContext (line 2316) | function makeExpanderContext(o) {
  function makeTopLevelExpanderContext (line 2368) | function makeTopLevelExpanderContext(options) {
  function expandTopLevel (line 2377) | function expandTopLevel(stx, moduleContexts, options) {
  function expandModule (line 2395) | function expandModule(stx, moduleContexts, options) {
  function loadModuleExports (line 2428) | function loadModuleExports(stx, newEnv, exports$3, oldEnv) {
  function flatten (line 2441) | function flatten(stx) {

FILE: docs/editor/scripts/jquery.js
  function isArraylike (line 848) | function isArraylike( obj ) {
  function Sizzle (line 1048) | function Sizzle( selector, context, results, seed ) {
  function createCache (line 1163) | function createCache() {
  function markFunction (line 1181) | function markFunction( fn ) {
  function assert (line 1190) | function assert( fn ) {
  function addHandle (line 1212) | function addHandle( attrs, handler ) {
  function siblingCheck (line 1227) | function siblingCheck( a, b ) {
  function createInputPseudo (line 1254) | function createInputPseudo( type ) {
  function createButtonPseudo (line 1265) | function createButtonPseudo( type ) {
  function createPositionalPseudo (line 1276) | function createPositionalPseudo( fn ) {
  function setFilters (line 2259) | function setFilters() {}
  function tokenize (line 2263) | function tokenize( selector, parseOnly ) {
  function toSelector (line 2330) | function toSelector( tokens ) {
  function addCombinator (line 2340) | function addCombinator( matcher, combinator, base ) {
  function elementMatcher (line 2390) | function elementMatcher( matchers ) {
  function condense (line 2404) | function condense( unmatched, map, filter, context, xml ) {
  function setMatcher (line 2425) | function setMatcher( preFilter, selector, matcher, postFilter, postFinde...
  function matcherFromTokens (line 2518) | function matcherFromTokens( tokens ) {
  function matcherFromGroupMatchers (line 2573) | function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  function multipleContexts (line 2701) | function multipleContexts( selector, contexts, results ) {
  function select (line 2710) | function select( selector, context, results, seed ) {
  function createOptions (line 2850) | function createOptions( options ) {
  function Data (line 3312) | function Data() {
  function dataAttr (line 3625) | function dataAttr( elem, key, data ) {
  function returnTrue (line 4305) | function returnTrue() {
  function returnFalse (line 4309) | function returnFalse() {
  function safeActiveElement (line 4313) | function safeActiveElement() {
  function sibling (line 5268) | function sibling( cur, dir ) {
  function winnow (line 5384) | function winnow( elements, qualifier, not ) {
  function manipulationTarget (line 5893) | function manipulationTarget( elem, content ) {
  function disableScript (line 5903) | function disableScript( elem ) {
  function restoreScript (line 5907) | function restoreScript( elem ) {
  function setGlobalEval (line 5920) | function setGlobalEval( elems, refElements ) {
  function cloneCopyEvent (line 5931) | function cloneCopyEvent( src, dest ) {
  function getAll (line 5966) | function getAll( context, tag ) {
  function fixInput (line 5977) | function fixInput( src, dest ) {
  function vendorPropName (line 6078) | function vendorPropName( style, name ) {
  function isHidden (line 6100) | function isHidden( elem, el ) {
  function getStyles (line 6109) | function getStyles( elem ) {
  function showHide (line 6113) | function showHide( elements, show ) {
  function setPositiveNumber (line 6384) | function setPositiveNumber( elem, value, subtract ) {
  function augmentWidthOrHeight (line 6392) | function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
  function getWidthOrHeight (line 6431) | function getWidthOrHeight( elem, name, extra ) {
  function css_defaultDisplay (line 6475) | function css_defaultDisplay( nodeName ) {
  function actualDisplay (line 6507) | function actualDisplay( name, doc ) {
  function buildParams (line 6693) | function buildParams( prefix, obj, traditional, add ) {
  function addToPrefiltersOrTransports (line 6809) | function addToPrefiltersOrTransports( structure ) {
  function inspectPrefiltersOrTransports (line 6841) | function inspectPrefiltersOrTransports( structure, options, originalOpti...
  function ajaxExtend (line 6868) | function ajaxExtend( target, src ) {
  function done (line 7314) | function done( status, nativeStatusText, responses, headers ) {
  function ajaxHandleResponses (line 7461) | function ajaxHandleResponses( s, jqXHR, responses ) {
  function ajaxConvert (line 7517) | function ajaxConvert( s, response, jqXHR, isSuccess ) {
  function createFxNow (line 7912) | function createFxNow() {
  function createTween (line 7919) | function createTween( value, prop, animation ) {
  function Animation (line 7933) | function Animation( elem, properties, options ) {
  function propFilter (line 8037) | function propFilter( props, specialEasing ) {
  function defaultPrefilter (line 8104) | function defaultPrefilter( elem, props, opts ) {
  function Tween (line 8227) | function Tween( elem, options, prop, end, easing ) {
  function genFx (line 8451) | function genFx( type, includeWidth ) {
  function getWindow (line 8749) | function getWindow( elem ) {

FILE: docs/editor/scripts/parser.js
  function assert (line 279) | function assert(condition, message) {
  function isIn (line 284) | function isIn(el, list) {
  function isDecimalDigit (line 287) | function isDecimalDigit(ch) {
  function isHexDigit (line 290) | function isHexDigit(ch) {
  function isOctalDigit (line 293) | function isOctalDigit(ch) {
  function isWhiteSpace (line 297) | function isWhiteSpace(ch) {
  function isLineTerminator (line 301) | function isLineTerminator(ch) {
  function isIdentifierStart (line 305) | function isIdentifierStart(ch) {
  function isIdentifierPart (line 308) | function isIdentifierPart(ch) {
  function isFutureReservedWord (line 312) | function isFutureReservedWord(id) {
  function isStrictModeReservedWord (line 325) | function isStrictModeReservedWord(id) {
  function isRestrictedWord (line 341) | function isRestrictedWord(id) {
  function isKeyword (line 345) | function isKeyword(id) {
  function skipComment (line 374) | function skipComment() {
  function scanHexEscape (line 445) | function scanHexEscape(prefix) {
  function scanUnicodeCodePointEscape (line 458) | function scanUnicodeCodePointEscape() {
  function getEscapedIdentifier (line 484) | function getEscapedIdentifier() {
  function getIdentifier (line 523) | function getIdentifier() {
  function scanIdentifier (line 541) | function scanIdentifier() {
  function scanPunctuator (line 571) | function scanPunctuator() {
  function scanHexLiteral (line 805) | function scanHexLiteral(start) {
  function scanOctalLiteral (line 830) | function scanOctalLiteral(prefix, start) {
  function scanNumericLiteral (line 865) | function scanNumericLiteral() {
  function scanStringLiteral (line 963) | function scanStringLiteral() {
  function scanTemplate (line 1061) | function scanTemplate() {
  function scanTemplateElement (line 1175) | function scanTemplateElement(option) {
  function scanRegExp (line 1187) | function scanRegExp() {
  function isIdentifierName (line 1284) | function isIdentifierName(token) {
  function advanceSlash (line 1287) | function advanceSlash() {
  function advance (line 1338) | function advance() {
  function lex (line 1398) | function lex() {
  function peek (line 1413) | function peek() {
  function lookahead2 (line 1430) | function lookahead2() {
  function peekLineTerminator (line 1869) | function peekLineTerminator() {
  function throwError (line 1873) | function throwError(token, messageFormat) {
  function throwErrorTolerant (line 1900) | function throwErrorTolerant() {
  function throwUnexpected (line 1912) | function throwUnexpected(token) {
  function expect (line 1943) | function expect(value) {
  function expectKeyword (line 1951) | function expectKeyword(keyword) {
  function match (line 1958) | function match(value) {
  function matchKeyword (line 1962) | function matchKeyword(keyword) {
  function matchContextualKeyword (line 1966) | function matchContextualKeyword(keyword) {
  function matchAssign (line 1970) | function matchAssign() {
  function consumeSemicolon (line 1978) | function consumeSemicolon() {
  function isLeftHandSide (line 1998) | function isLeftHandSide(expr) {
  function isAssignableLeftHandSide (line 2001) | function isAssignableLeftHandSide(expr) {
  function parseArrayInitialiser (line 2005) | function parseArrayInitialiser() {
  function parsePropertyFunction (line 2067) | function parsePropertyFunction(options) {
  function parsePropertyMethodFunction (line 2085) | function parsePropertyMethodFunction(options) {
  function parseObjectPropertyKey (line 2102) | function parseObjectPropertyKey() {
  function parseObjectProperty (line 2115) | function parseObjectProperty() {
  function parseObjectInitialiser (line 2169) | function parseObjectInitialiser() {
  function parseTemplateElement (line 2207) | function parseTemplateElement(option) {
  function parseTemplateLiteral (line 2217) | function parseTemplateLiteral() {
  function parseGroupExpression (line 2230) | function parseGroupExpression() {
  function parsePrimaryExpression (line 2239) | function parsePrimaryExpression() {
  function parseArguments (line 2298) | function parseArguments() {
  function parseSpreadOrAssignmentExpression (line 2316) | function parseSpreadOrAssignmentExpression() {
  function parseNonComputedProperty (line 2323) | function parseNonComputedProperty() {
  function parseNonComputedMember (line 2330) | function parseNonComputedMember() {
  function parseComputedMember (line 2334) | function parseComputedMember() {
  function parseNewExpression (line 2341) | function parseNewExpression() {
  function parseLeftHandSideExpressionAllowCall (line 2348) | function parseLeftHandSideExpressionAllowCall() {
  function parseLeftHandSideExpression (line 2365) | function parseLeftHandSideExpression() {
  function parsePostfixExpression (line 2380) | function parsePostfixExpression() {
  function parseUnaryExpression (line 2399) | function parseUnaryExpression() {
  function binaryPrecedence (line 2432) | function binaryPrecedence(token, allowIn) {
  function parseBinaryExpression (line 2495) | function parseBinaryExpression() {
  function parseConditionalExpression (line 2537) | function parseConditionalExpression() {
  function reinterpretAsAssignmentBindingPattern (line 2553) | function reinterpretAsAssignmentBindingPattern(expr) {
  function reinterpretAsDestructuredParameter (line 2587) | function reinterpretAsDestructuredParameter(options, expr) {
  function reinterpretAsCoverFormalsList (line 2614) | function reinterpretAsCoverFormalsList(expressions) {
  function parseArrowFunctionExpression (line 2659) | function parseArrowFunctionExpression(options) {
  function parseAssignmentExpression (line 2676) | function parseAssignmentExpression() {
  function parseExpression (line 2720) | function parseExpression() {
  function parseStatementList (line 2760) | function parseStatementList() {
  function parseBlock (line 2774) | function parseBlock() {
  function parseVariableIdentifier (line 2782) | function parseVariableIdentifier() {
  function parseVariableDeclaration (line 2791) | function parseVariableDeclaration(kind) {
  function parseVariableDeclarationList (line 2818) | function parseVariableDeclarationList(kind) {
  function parseVariableStatement (line 2829) | function parseVariableStatement() {
  function parseConstLetDeclaration (line 2840) | function parseConstLetDeclaration(kind) {
  function parseModuleDeclaration (line 2848) | function parseModuleDeclaration() {
  function parseExportBatchSpecifier (line 2877) | function parseExportBatchSpecifier() {
  function parseExportSpecifier (line 2881) | function parseExportSpecifier() {
  function parseExportDeclaration (line 2890) | function parseExportDeclaration() {
  function parseImportDeclaration (line 2931) | function parseImportDeclaration() {
  function parseImportSpecifier (line 2961) | function parseImportSpecifier() {
  function parseEmptyStatement (line 2971) | function parseEmptyStatement() {
  function parseExpressionStatement (line 2976) | function parseExpressionStatement() {
  function parseIfStatement (line 2982) | function parseIfStatement() {
  function parseDoWhileStatement (line 2998) | function parseDoWhileStatement() {
  function parseWhileStatement (line 3014) | function parseWhileStatement() {
  function parseForVariableDeclaration (line 3026) | function parseForVariableDeclaration() {
  function parseForStatement (line 3030) | function parseForStatement(opts) {
  function parseContinueStatement (line 3106) | function parseContinueStatement() {
  function parseBreakStatement (line 3137) | function parseBreakStatement() {
  function parseReturnStatement (line 3168) | function parseReturnStatement() {
  function parseWithStatement (line 3192) | function parseWithStatement() {
  function parseSwitchCase (line 3205) | function parseSwitchCase() {
  function parseSwitchStatement (line 3227) | function parseSwitchStatement() {
  function parseThrowStatement (line 3260) | function parseThrowStatement() {
  function parseCatchClause (line 3271) | function parseCatchClause() {
  function parseTryStatement (line 3287) | function parseTryStatement() {
  function parseDebuggerStatement (line 3304) | function parseDebuggerStatement() {
  function parseStatement (line 3310) | function parseStatement() {
  function parseConciseBody (line 3380) | function parseConciseBody() {
  function parseFunctionSourceElements (line 3386) | function parseFunctionSourceElements() {
  function validateParam (line 3440) | function validateParam(options, param, name) {
  function parseParam (line 3465) | function parseParam(options) {
  function parseParams (line 3504) | function parseParams(firstRestricted) {
  function parseFunctionDeclaration (line 3529) | function parseFunctionDeclaration() {
  function parseFunctionExpression (line 3576) | function parseFunctionExpression() {
  function parseYieldExpression (line 3625) | function parseYieldExpression() {
  function parseMethodDefinition (line 3645) | function parseMethodDefinition(existingPropNames) {
  function parseClassElement (line 3709) | function parseClassElement(existingProps) {
  function parseClassBody (line 3716) | function parseClassBody() {
  function parseClassExpression (line 3733) | function parseClassExpression() {
  function parseClassDeclaration (line 3748) | function parseClassDeclaration() {
  function matchModuleDeclaration (line 3762) | function matchModuleDeclaration() {
  function parseSourceElement (line 3770) | function parseSourceElement() {
  function parseProgramElement (line 3793) | function parseProgramElement() {
  function parseProgramElements (line 3807) | function parseProgramElements() {
  function parseModuleElement (line 3841) | function parseModuleElement() {
  function parseModuleElements (line 3844) | function parseModuleElements() {
  function parseModuleBlock (line 3858) | function parseModuleBlock() {
  function parseProgram (line 3865) | function parseProgram() {
  function addComment (line 3874) | function addComment(type, value, start, end, loc) {
  function scanComment (line 3895) | function scanComment() {
  function filterCommentLocation (line 4013) | function filterCommentLocation() {
  function collectToken (line 4031) | function collectToken() {
  function collectRegex (line 4061) | function collectRegex() {
  function filterTokenLocation (line 4098) | function filterTokenLocation() {
  function LocationMarker (line 4116) | function LocationMarker() {
  function createLocationMarker (line 4187) | function createLocationMarker() {
  function trackGroupExpression (line 4190) | function trackGroupExpression() {
  function trackLeftHandSideExpression (line 4201) | function trackLeftHandSideExpression() {
  function trackLeftHandSideExpressionAllowCall (line 4223) | function trackLeftHandSideExpressionAllowCall() {
  function filterGroup (line 4250) | function filterGroup(node) {
  function wrapTrackingFunction (line 4265) | function wrapTrackingFunction(range, loc) {
  function patch (line 4339) | function patch() {
  function unpatch (line 4446) | function unpatch() {
  function extend (line 4502) | function extend(object, properties) {
  function tokenize (line 4516) | function tokenize(code, options) {
  function blockAllowed (line 4605) | function blockAllowed(toks, start, inExprDelim, parentIsBlock) {
  function readToken (line 4702) | function readToken(toks, inExprDelim, parentIsBlock) {
  function readDelim (line 4799) | function readDelim(toks, inExprDelim, parentIsBlock) {
  function read (line 4852) | function read(code) {
  function parse (line 4888) | function parse(code, options) {

FILE: docs/editor/scripts/patterns.js
  function freeVarsInPattern (line 26) | function freeVarsInPattern(pattern) {
  function typeIsLiteral (line 37) | function typeIsLiteral(type) {
  function containsPatternVar (line 40) | function containsPatternVar(patterns) {
  function delimIsSeparator (line 48) | function delimIsSeparator(delim) {
  function isPatternVar (line 51) | function isPatternVar(stx) {
  function joinRepeatedMatch (line 55) | function joinRepeatedMatch(tojoin, punc) {
  function takeLineContext (line 65) | function takeLineContext(from, to) {
  function takeLine (line 71) | function takeLine(from, to) {
  function reversePattern (line 153) | function reversePattern(patterns) {
  function loadLiteralGroup (line 167) | function loadLiteralGroup(patterns) {
  function isPrimaryClass (line 177) | function isPrimaryClass(name) {
  function loadPattern (line 187) | function loadPattern(patterns, reverse) {
  function cachedTermMatch (line 258) | function cachedTermMatch(stx, term) {
  function expandWithMacro (line 271) | function expandWithMacro(macroName, stx, env, rec) {
  function matchPatternClass (line 318) | function matchPatternClass(patternObj, stx, env) {
  function matchPatterns (line 366) | function matchPatterns(patterns, stx, env, topLevel) {
  function matchPattern (line 516) | function matchPattern(pattern, stx, env, patternEnv, topLevel) {
  function loadPatternEnv (line 592) | function loadPatternEnv(toEnv, fromEnv, topLevel, repeat, prefix) {
  function matchLookbehind (line 614) | function matchLookbehind(patterns, stx, terms, env) {
  function hasMatch (line 664) | function hasMatch(m) {
  function transcribe (line 675) | function transcribe(macroBody, macroNameStx, env) {
  function cloneMatch (line 806) | function cloneMatch(oldMatch) {
  function makeIdentityRule (line 819) | function makeIdentityRule(pattern, isInfix) {

FILE: docs/editor/scripts/require.js
  function D (line 7) | function D(b){return M.call(b)==="[object Function]"}
  function E (line 7) | function E(b){return M.call(b)==="[object Array]"}
  function t (line 7) | function t(b,c){if(b){var d;for(d=0;d<b.length;d+=1)if(b[d]&&c(b[d],d,b)...
  function N (line 7) | function N(b,c){if(b){var d;for(d=b.length-1;d>-1;d-=1)if(b[d]&&c(b[d],d...
  function A (line 7) | function A(b,c){for(var d in b)if(b.hasOwnProperty(d)&&c(b[d],d))break}
  function O (line 7) | function O(b,c,d,g){c&&A(c,function(c,j){if(d||!F.call(b,j))g&&typeof c!...
  function r (line 7) | function r(b,c){return function(){return c.apply(b,
  function X (line 8) | function X(b){if(!b)return b;var c=W;t(b.split("."),function(b){c=c[b]})...
  function G (line 8) | function G(b,c,d,g){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"...
  function ba (line 8) | function ba(){if(H&&H.readyState==="interactive")return H;N(document.get...
  function c (line 10) | function c(a,
  function d (line 12) | function d(a){v&&t(document.getElementsByTagName("script"),function(f){i...
  function p (line 12) | function p(a){var f=k.paths[a];if(f&&E(f)&&f.length>1)return d(a),f.shif...
  function i (line 12) | function i(a){var f,
  function j (line 13) | function j(a,f,b,e){var m,K,d=null,g=f?f.name:null,j=a,l=!0,k="";a||(l=!...
  function n (line 13) | function n(a){var f=
  function q (line 14) | function q(a,f,b){var e=a.id,m=l[e];if(F.call(o,e)&&(!m||m.defineEmitCom...
  function z (line 14) | function z(a,f){var b=a.requireModules,e=!1;if(f)f(a);else if(t(b,functi...
  function s (line 14) | function s(){P.length&&(fa.apply(C,[C.length-1,0].concat(P)),P=[])}
  function u (line 14) | function u(a,f,b){var e=a.map.id;a.error?a.emit("error",a.error):(f[e]=!...
  function w (line 15) | function w(){var a,f,b,e,m=(b=k.waitSeconds*1E3)&&h.startTime+b<(new Dat...
  function y (line 16) | function y(a){n(j(a[0],null,!0)).init(a[1],a[2])}
  function B (line 16) | function B(a){var a=a.currentTarget||a.srcElement,b=h.onScriptLoad;a.det...
  function I (line 16) | function I(){var a;for(s();C.length;)if(a=C.shift(),a[0]===
  function d (line 27) | function d(e,c,i){var k,p;if(f.enableBuildCallback&&c&&D(c))c.__requireJ...

FILE: docs/editor/scripts/sweet.js
  function __webpack_require__ (line 16) | function __webpack_require__(moduleId) {
  function _interopRequireDefault (line 82) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  class BrowserStoreLoader (line 84) | class BrowserStoreLoader extends _storeLoader2.default {
    method constructor (line 86) | constructor(baseDir, store) {
    method fetch (line 90) | fetch({ name, address }) {
    method freshStore (line 97) | freshStore() {
    method eval (line 101) | eval(source, store) {
  function compile (line 106) | function compile(source, helpers) {
  function compileModule (line 130) | function compileModule(entryPath, loader, refererName) {
  function parse (line 134) | function parse(entryPath, loader, options) {
  function compile (line 142) | function compile(entryPath, loader, options) {
  function _interopRequireDefault (line 189) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  method constructor (line 193) | constructor(baseDir, store, noBabel = false) {
  method fetch (line 198) | fetch({ name, address }) {
  method freshStore (line 205) | freshStore() {
  method eval (line 209) | eval(source, store) {
  function _interopRequireWildcard (line 272) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function _interopRequireDefault (line 274) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  class SweetLoader (line 278) | class SweetLoader {
    method constructor (line 280) | constructor(baseDir, options = {}) {
    method normalize (line 308) | normalize(name, refererName, refererAddress) {
    method locate (line 318) | locate({ name, metadata }) {
    method fetch (line 331) | fetch({
    method translate (line 339) | translate({
    method instantiate (line 354) | instantiate({
    method eval (line 363) | eval(source) {
    method load (line 367) | load(entryPath) {
    method compile (line 377) | compile(entryPath, refererName, enforceLangPragma = true) {
    method get (line 388) | get(entryPath, entryPhase) {
    method read (line 392) | read(source) {
    method freshStore (line 396) | freshStore() {
    method compileSource (line 400) | compileSource(source, metadata) {
  function getLangDirective (line 419) | function getLangDirective(source) {
  function _interopRequireDefault (line 450) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function getSlice (line 454) | function getSlice(stream, startLocation) {
  class ReadError (line 465) | class ReadError extends Error {
    method constructor (line 466) | constructor({
  class TokenReader (line 480) | class TokenReader extends _readtable.Reader {
    method constructor (line 481) | constructor(stream, context) {
    method createError (line 491) | createError(msg) {
    method createILLEGAL (line 502) | createILLEGAL(char) {
    method readToken (line 506) | readToken(stream, ...rest) {
    method readUntil (line 521) | readUntil(close, stream, prefix, exprAllowed) {
    method incrementLine (line 537) | incrementLine() {
  function read (line 543) | function read(source, context) {
  function _interopRequireDefault (line 573) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  class CharStream (line 597) | class CharStream {
    method constructor (line 598) | constructor(source, filename = '') {
    method sourceInfo (line 606) | get sourceInfo() {
    method peek (line 613) | peek(charsToSkip = 0) {
    method readString (line 621) | readString(numChars = 1) {
    method getSlice (line 631) | getSlice(start) {
  function isEOS (line 639) | function isEOS(char) {
  class Reader (line 673) | class Reader {
    method read (line 674) | read(stream, ...rest) {
  function setCurrentReadtable (line 687) | function setCurrentReadtable(readtable) {
  function getCurrentReadtable (line 691) | function getCurrentReadtable() {
  class Readtable (line 716) | class Readtable {
    method constructor (line 717) | constructor(entries = []) {
    method getMapping (line 721) | getMapping(key) {
    method extend (line 729) | extend(...entries) {
  function addEntry (line 736) | function addEntry(table, { key, mode, action }) {
  function isValidKey (line 756) | function isValidKey(key) {
  function isValidMode (line 760) | function isValidMode(mode) {
  function isValidAction (line 764) | function isValidAction(action) {
  function isValidEntry (line 768) | function isValidEntry(entry) {
  function convertKey (line 772) | function convertKey(key) {
  function _interopRequireDefault (line 821) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function eatWhitespace (line 825) | function eatWhitespace(stream) {
  function readPunctuator (line 832) | function readPunctuator(stream) {
  function readDelimiters (line 926) | function readDelimiters(closing, stream, prefix, b) {
  function readClosingDelimiter (line 954) | function readClosingDelimiter(opening, closing, stream, prefix, b) {
  function createClass (line 1045) | function createClass(ctor, superClass) {
  function Iterable (line 1052) | function Iterable(value) {
  function KeyedIterable (line 1058) | function KeyedIterable(value) {
  function IndexedIterable (line 1064) | function IndexedIterable(value) {
  function SetIterable (line 1070) | function SetIterable(value) {
  function isIterable (line 1076) | function isIterable(maybeIterable) {
  function isKeyed (line 1080) | function isKeyed(maybeKeyed) {
  function isIndexed (line 1084) | function isIndexed(maybeIndexed) {
  function isAssociative (line 1088) | function isAssociative(maybeAssociative) {
  function isOrdered (line 1092) | function isOrdered(maybeOrdered) {
  function MakeRef (line 1128) | function MakeRef(ref) {
  function SetRef (line 1133) | function SetRef(ref) {
  function OwnerID (line 1140) | function OwnerID() {}
  function arrCopy (line 1143) | function arrCopy(arr, offset) {
  function ensureSize (line 1153) | function ensureSize(iter) {
  function wrapIndex (line 1160) | function wrapIndex(iter, index) {
  function returnTrue (line 1178) | function returnTrue() {
  function wholeSlice (line 1182) | function wholeSlice(begin, end, size) {
  function resolveBegin (line 1187) | function resolveBegin(begin, size) {
  function resolveEnd (line 1191) | function resolveEnd(end, size) {
  function resolveIndex (line 1195) | function resolveIndex(index, size, defaultIndex) {
  function Iterator (line 1217) | function Iterator(next) {
  function iteratorValue (line 1237) | function iteratorValue(type, k, v, iteratorResult) {
  function iteratorDone (line 1245) | function iteratorDone() {
  function hasIterator (line 1249) | function hasIterator(maybeIterable) {
  function isIterator (line 1253) | function isIterator(maybeIterator) {
  function getIterator (line 1257) | function getIterator(iterable) {
  function getIteratorFn (line 1262) | function getIteratorFn(iterable) {
  function isArrayLike (line 1272) | function isArrayLike(value) {
  function Seq (line 1277) | function Seq(value) {
  function KeyedSeq (line 1317) | function KeyedSeq(value) {
  function IndexedSeq (line 1332) | function IndexedSeq(value) {
  function SetSeq (line 1361) | function SetSeq(value) {
  function ArraySeq (line 1391) | function ArraySeq(array) {
  function ObjectSeq (line 1425) | function ObjectSeq(object) {
  function IterableSeq (line 1473) | function IterableSeq(iterable) {
  function IteratorSeq (line 1515) | function IteratorSeq(iterator) {
  function isSeq (line 1567) | function isSeq(maybeSeq) {
  function emptySequence (line 1573) | function emptySequence() {
  function keyedSeqFromValue (line 1577) | function keyedSeqFromValue(value) {
  function indexedSeqFromValue (line 1593) | function indexedSeqFromValue(value) {
  function seqFromValue (line 1603) | function seqFromValue(value) {
  function maybeIndexedSeqFromValue (line 1614) | function maybeIndexedSeqFromValue(value) {
  function seqIterate (line 1623) | function seqIterate(seq, fn, reverse, useKeys) {
  function seqIterator (line 1638) | function seqIterator(seq, type, reverse, useKeys) {
  function fromJS (line 1653) | function fromJS(json, converter) {
  function fromJSWith (line 1659) | function fromJSWith(converter, json, key, parentJSON) {
  function fromJSDefault (line 1669) | function fromJSDefault(json) {
  function isPlainObj (line 1679) | function isPlainObj(value) {
  function is (line 1737) | function is(valueA, valueB) {
  function deepEqual (line 1763) | function deepEqual(a, b) {
  function Repeat (line 1822) | function Repeat(value, times) {
  function invariant (line 1900) | function invariant(condition, error) {
  function Range (line 1906) | function Range(start, end, step) {
  function Collection (line 2018) | function Collection() {
  function KeyedCollection (line 2023) | function KeyedCollection() {}
  function IndexedCollection (line 2025) | function IndexedCollection() {}
  function SetCollection (line 2027) | function SetCollection() {}
  function smi (line 2050) | function smi(i32) {
  function hash (line 2054) | function hash(o) {
  function cachedHashString (line 2097) | function cachedHashString(string) {
  function hashString (line 2112) | function hashString(string) {
  function hashJSObj (line 2126) | function hashJSObj(obj) {
  function getIENodeHash (line 2206) | function getIENodeHash(node) {
  function assertNotInfinite (line 2236) | function assertNotInfinite(size) {
  function Map (line 2247) | function Map(value) {
  function isMap (line 2426) | function isMap(maybeMap) {
  function ArrayMapNode (line 2444) | function ArrayMapNode(ownerID, entries) {
  function BitmapIndexedNode (line 2510) | function BitmapIndexedNode(ownerID, bitmap, nodes) {
  function HashArrayMapNode (line 2579) | function HashArrayMapNode(ownerID, count, nodes) {
  function HashCollisionNode (line 2637) | function HashCollisionNode(ownerID, keyHash, entries) {
  function ValueNode (line 2713) | function ValueNode(ownerID, keyHash, entry) {
  function MapIterator (line 2780) | function MapIterator(map, type, reverse) {
  function mapIteratorValue (line 2821) | function mapIteratorValue(type, entry) {
  function mapIteratorFrame (line 2825) | function mapIteratorFrame(node, prev) {
  function makeMap (line 2833) | function makeMap(size, root, ownerID, hash) {
  function emptyMap (line 2844) | function emptyMap() {
  function updateMap (line 2848) | function updateMap(map, k, v) {
  function updateNode (line 2876) | function updateNode(node, ownerID, shift, keyHash, key, value, didChange...
  function isLeafNode (line 2888) | function isLeafNode(node) {
  function mergeIntoNode (line 2892) | function mergeIntoNode(node, ownerID, shift, keyHash, entry) {
  function createNodes (line 2908) | function createNodes(ownerID, entries, key, value) {
  function packNodes (line 2920) | function packNodes(ownerID, nodes, count, excluding) {
  function expandNodes (line 2934) | function expandNodes(ownerID, nodes, bitmap, including, node) {
  function mergeIntoMapWith (line 2944) | function mergeIntoMapWith(map, merger, iterables) {
  function deepMerger (line 2957) | function deepMerger(existing, value, key) {
  function deepMergerWith (line 2963) | function deepMergerWith(merger) {
  function mergeIntoCollectionWith (line 2973) | function mergeIntoCollectionWith(collection, merger, iters) {
  function updateInDeepMap (line 2997) | function updateInDeepMap(existing, keyPathIter, notSetValue, updater) {
  function popCount (line 3022) | function popCount(x) {
  function setIn (line 3031) | function setIn(array, idx, val, canEdit) {
  function spliceIn (line 3037) | function spliceIn(array, idx, val, canEdit) {
  function spliceOut (line 3056) | function spliceOut(array, idx, canEdit) {
  function List (line 3081) | function List(value) {
  function isList (line 3256) | function isList(maybeList) {
  function VNode (line 3281) | function VNode(array, ownerID) {
  function iterateList (line 3350) | function iterateList(list, reverse) {
  function makeList (line 3409) | function makeList(origin, capacity, level, root, tail, ownerID, hash) {
  function emptyList (line 3424) | function emptyList() {
  function updateList (line 3428) | function updateList(list, index, value) {
  function updateVNode (line 3468) | function updateVNode(node, ownerID, level, index, value, didAlter) {
  function editableVNode (line 3503) | function editableVNode(node, ownerID) {
  function listNodeFor (line 3510) | function listNodeFor(list, rawIndex) {
  function setListBounds (line 3525) | function setListBounds(list, begin, end) {
  function mergeIntoListWith (line 3648) | function mergeIntoListWith(list, merger, iterables) {
  function getTailOffset (line 3668) | function getTailOffset(size) {
  function OrderedMap (line 3676) | function OrderedMap(value) {
  function isOrderedMap (line 3755) | function isOrderedMap(maybeOrderedMap) {
  function makeOrderedMap (line 3766) | function makeOrderedMap(map, list, ownerID, hash) {
  function emptyOrderedMap (line 3777) | function emptyOrderedMap() {
  function updateOrderedMap (line 3781) | function updateOrderedMap(omap, k, v) {
  function ToKeyedSequence (line 3825) | function ToKeyedSequence(indexed, useKeys) {
  function ToIndexedSequence (line 3887) | function ToIndexedSequence(iter) {
  function ToSetSequence (line 3914) | function ToSetSequence(iter) {
  function FromEntriesSequence (line 3939) | function FromEntriesSequence(entries) {
  function flipFactory (line 3997) | function flipFactory(iterable) {
  function mapFactory (line 4035) | function mapFactory(iterable, mapper, context) {
  function reverseFactory (line 4072) | function reverseFactory(iterable, useKeys) {
  function filterFactory (line 4099) | function filterFactory(iterable, predicate, context, useKeys) {
  function countByFactory (line 4144) | function countByFactory(iterable, grouper, context) {
  function groupByFactory (line 4157) | function groupByFactory(iterable, grouper, context) {
  function sliceFactory (line 4171) | function sliceFactory(iterable, begin, end, useKeys) {
  function takeWhileFactory (line 4276) | function takeWhileFactory(iterable, predicate, context) {
  function skipWhileFactory (line 4317) | function skipWhileFactory(iterable, predicate, context, useKeys) {
  function concatFactory (line 4366) | function concatFactory(iterable, values) {
  function flattenFactory (line 4414) | function flattenFactory(iterable, depth, useKeys) {
  function flatMapFactory (line 4461) | function flatMapFactory(iterable, mapper, context) {
  function interposeFactory (line 4469) | function interposeFactory(iterable, separator) {
  function sortFactory (line 4501) | function sortFactory(iterable, comparator, mapper) {
  function maxFactory (line 4521) | function maxFactory(iterable, comparator, mapper) {
  function maxCompare (line 4535) | function maxCompare(comparator, a, b) {
  function zipWithFactory (line 4543) | function zipWithFactory(keyIter, zipper, iters) {
  function reify (line 4600) | function reify(iter, seq) {
  function validateEntry (line 4604) | function validateEntry(entry) {
  function resolveSize (line 4610) | function resolveSize(iter) {
  function iterableClass (line 4615) | function iterableClass(iterable) {
  function makeSequence (line 4621) | function makeSequence(iterable) {
  function cacheResultThrough (line 4631) | function cacheResultThrough() {
  function defaultComparator (line 4641) | function defaultComparator(a, b) {
  function forceIterator (line 4645) | function forceIterator(keyPath) {
  function Record (line 4660) | function Record(defaultValues, name) {
  function makeRecord (line 4789) | function makeRecord(likeRecord, map, ownerID) {
  function recordName (line 4796) | function recordName(record) {
  function setProps (line 4800) | function setProps(prototype, names) {
  function setProp (line 4808) | function setProp(prototype, name) {
  function Set (line 4824) | function Set(value) {
  function isSet (line 4957) | function isSet(maybeSet) {
  function updateSet (line 4977) | function updateSet(set, newMap) {
  function makeSet (line 4988) | function makeSet(map, ownerID) {
  function emptySet (line 4997) | function emptySet() {
  function OrderedSet (line 5005) | function OrderedSet(value) {
  function isOrderedSet (line 5028) | function isOrderedSet(maybeOrderedSet) {
  function makeOrderedSet (line 5040) | function makeOrderedSet(map, ownerID) {
  function emptyOrderedSet (line 5049) | function emptyOrderedSet() {
  function Stack (line 5057) | function Stack(value) {
  function isStack (line 5238) | function isStack(maybeStack) {
  function makeStack (line 5254) | function makeStack(size, head, ownerID, hash) {
  function emptyStack (line 5265) | function emptyStack() {
  function mixin (line 5272) | function mixin(ctor, methods) {
  function keyMapper (line 5918) | function keyMapper(v, k) {
  function entryMapper (line 5922) | function entryMapper(v, k) {
  function not (line 5926) | function not(predicate) {
  function neg (line 5932) | function neg(predicate) {
  function quoteString (line 5938) | function quoteString(value) {
  function defaultZipper (line 5942) | function defaultZipper() {
  function defaultNegComparator (line 5946) | function defaultNegComparator(a, b) {
  function hashIterable (line 5950) | function hashIterable(iterable) {
  function murmurHashOfSize (line 5969) | function murmurHashOfSize(size, h) {
  function hashMerge (line 5980) | function hashMerge(a, b) {
  function readIdentifier (line 6029) | function readIdentifier(stream) {
  function getEscapedIdentifier (line 6055) | function getEscapedIdentifier(stream) {
  function decodeUtf16 (line 6105) | function decodeUtf16(lead, trail) {
  function _interopRequireWildcard (line 6143) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function getHexValue (line 6163) | function getHexValue(rune) {
  function skipSingleLineComment (line 6176) | function skipSingleLineComment(stream) {
  function scanUnicode (line 6195) | function scanUnicode(stream, start) {
  function readStringEscape (line 6234) | function readStringEscape(str, stream, start, octal) {
  function scanOctal (line 6305) | function scanOctal(str, stream, char, start, octal) {
  function scanHexEscape2 (line 6331) | function scanHexEscape2(stream, idx) {
  function insertSequence (line 6346) | function insertSequence(coll, seq) {
  function retrieveSequenceLength (line 6363) | function retrieveSequenceLength(table, stream, idx) {
  function isNonLiteralKeyword (line 6381) | function isNonLiteralKeyword(t) {
  function isExprReturn (line 6386) | function isExprReturn(l, p) {
  function isTopPunctuator (line 6393) | function isTopPunctuator(p) {
  function isOperator (line 6397) | function isOperator(op) {
  function isTopOperator (line 6405) | function isTopOperator(p) {
  function isExprPrefixKeyword (line 6411) | function isExprPrefixKeyword(kwd) {
  function isTopKeywordExprPrefix (line 6415) | function isTopKeywordExprPrefix(p) {
  function isTopColon (line 6421) | function isTopColon(p) {
  function isExprPrefix (line 6430) | function isExprPrefix(l, b, p) {
  function popMaybe (line 6454) | function popMaybe(p) {
  function isTopStandaloneKeyword (line 6461) | function isTopStandaloneKeyword(prefix) {
  function isTopParensWithKeyword (line 6471) | function isTopParensWithKeyword(prefix) {
  function popRestMaybe (line 6481) | function popRestMaybe(p) {
  function isTopFunctionExpression (line 6490) | function isTopFunctionExpression(prefix, exprAllowed) {
  function isTopObjectLiteral (line 6519) | function isTopObjectLiteral(prefix, exprAllowed) {
  function isTopFunction (line 6533) | function isTopFunction(prefix) {
  function isRegexPrefix (line 6558) | function isRegexPrefix(exprAllowed, prefix) {
  function isExpression (line 6652) | function isExpression(node) {
  function isIterationStatement (line 6676) | function isIterationStatement(node) {
  function isStatement (line 6688) | function isStatement(node) {
  function isSourceElement (line 6714) | function isSourceElement(node) {
  function trailingStatement (line 6718) | function trailingStatement(node) {
  function isProblematicIfStatement (line 6736) | function isProblematicIfStatement(node) {
  function isDecimalDigit (line 6820) | function isDecimalDigit(ch) {
  function isHexDigit (line 6824) | function isHexDigit(ch) {
  function isOctalDigit (line 6830) | function isOctalDigit(ch) {
  function isWhiteSpace (line 6844) | function isWhiteSpace(ch) {
  function isLineTerminator (line 6851) | function isLineTerminator(ch) {
  function fromCodePoint (line 6857) | function fromCodePoint(cp) {
  function isIdentifierStartES5 (line 6881) | function isIdentifierStartES5(ch) {
  function isIdentifierPartES5 (line 6885) | function isIdentifierPartES5(ch) {
  function isIdentifierStartES6 (line 6889) | function isIdentifierStartES6(ch) {
  function isIdentifierPartES6 (line 6893) | function isIdentifierPartES6(ch) {
  function isStrictModeReservedWordES6 (line 6945) | function isStrictModeReservedWordES6(id) {
  function isKeywordES5 (line 6961) | function isKeywordES5(id, strict) {
  function isKeywordES6 (line 6969) | function isKeywordES6(id, strict) {
  function isReservedWordES5 (line 7000) | function isReservedWordES5(id, strict) {
  function isReservedWordES6 (line 7004) | function isReservedWordES6(id, strict) {
  function isRestrictedWord (line 7008) | function isRestrictedWord(id) {
  function isIdentifierNameES5 (line 7012) | function isIdentifierNameES5(id) {
  function decodeUtf16 (line 7031) | function decodeUtf16(lead, trail) {
  function isIdentifierNameES6 (line 7035) | function isIdentifierNameES6(id) {
  function isIdentifierES5 (line 7060) | function isIdentifierES5(id, strict) {
  function isIdentifierES6 (line 7064) | function isIdentifierES6(id, strict) {
  function hasType (line 7319) | function hasType(x, type) {
  function hasKlass (line 7326) | function hasKlass(x, klass) {
  class BaseToken (line 7333) | class BaseToken {
    method constructor (line 7335) | constructor({
  function isString (line 7348) | function isString(x, value) {
  class StringToken (line 7356) | class StringToken {
    method constructor (line 7357) | constructor({ str, octal, slice }) {
  function isIdentifier (line 7378) | function isIdentifier(x, value) {
  class IdentifierToken (line 7386) | class IdentifierToken extends BaseToken {
    method constructor (line 7387) | constructor({ value, slice }) {
  function isKeyword (line 7398) | function isKeyword(x, value) {
  class KeywordToken (line 7410) | class KeywordToken extends BaseToken {
    method constructor (line 7411) | constructor({ value, slice }) {
  function isPunctuator (line 7422) | function isPunctuator(x, value) {
  class PunctuatorToken (line 7429) | class PunctuatorToken extends BaseToken {
    method constructor (line 7430) | constructor({ value, slice }) {
  function isNumeric (line 7441) | function isNumeric(x, value) {
  class NumericToken (line 7448) | class NumericToken extends BaseToken {
    method constructor (line 7450) | constructor({
  function isTemplateElement (line 7468) | function isTemplateElement(x, value) {
  class TemplateElementToken (line 7476) | class TemplateElementToken extends BaseToken {
    method constructor (line 7478) | constructor({
  function isTemplate (line 7496) | function isTemplate(x) {
  class TemplateToken (line 7499) | class TemplateToken extends BaseToken {
    method constructor (line 7501) | constructor({ items, slice }) {
  function isRegExp (line 7508) | function isRegExp(x, value) {
  class RegExpToken (line 7515) | class RegExpToken extends BaseToken {
    method constructor (line 7516) | constructor({ value, slice }) {
  function getKind (line 7536) | function getKind(x) {
  function getLineNumber (line 7540) | function getLineNumber(t) {
  function XWrap (line 7935) | function XWrap(fn) {
  function XAll (line 8152) | function XAll(f, xf) {
  function XAny (line 8177) | function XAny(f, xf) {
  function XAperture (line 8202) | function XAperture(n, xf) {
  function XDrop (line 8234) | function XDrop(n, xf) {
  function XDropLast (line 8253) | function XDropLast(n, xf) {
  function XDropRepeatsWith (line 8285) | function XDropRepeatsWith(pred, xf) {
  function XDropWhile (line 8313) | function XDropWhile(f, xf) {
  function XFilter (line 8334) | function XFilter(f, xf) {
  function XFind (line 8349) | function XFind(f, xf) {
  function XFindIndex (line 8374) | function XFindIndex(f, xf) {
  function XFindLast (line 8401) | function XFindLast(f, xf) {
  function XFindLastIndex (line 8421) | function XFindLastIndex(f, xf) {
  function XMap (line 8444) | function XMap(f, xf) {
  function XReduceBy (line 8459) | function XReduceBy(valueFn, valueAcc, keyFn, xf) {
  function XTake (line 8496) | function XTake(n, xf) {
  function XTakeWhile (line 8514) | function XTakeWhile(f, xf) {
  function _arrayReduce (line 12752) | function _arrayReduce(xf, acc, list) {
  function _iterableReduce (line 12765) | function _iterableReduce(xf, acc, iter) {
  function _methodReduce (line 12777) | function _methodReduce(xf, acc, obj) {
  function XDropLastWhile (line 12842) | function XDropLastWhile(fn, xf) {
  function _Set (line 15520) | function _Set() {
  function hasOrAdd (line 15549) | function hasOrAdd(item, shouldAdd, set) {
  function Either (line 16413) | function Either(left, right) {
  function _Right (line 16459) | function _Right(x) {
  function _Left (line 16497) | function _Left(x) {
  function Ctor (line 16545) | function Ctor() {
  function jail (line 16578) | function jail(handler, f){
  function Future (line 16589) | function Future(f) {
  function addListeners (line 16707) | function addListeners(reject, resolve) {
  function doResolve (line 16711) | function doResolve(reject, resolve) {
  function Identity (line 16753) | function Identity(x) {
  function IO (line 16838) | function IO(fn) {
  function Maybe (line 16918) | function Maybe(x) {
  function Just (line 16924) | function Just(x) {
  function Nothing (line 16932) | function Nothing() {}
  function Tuple (line 17053) | function Tuple(x, y) {
  function _Tuple (line 17066) | function _Tuple(x, y) {
  function ensureConcat (line 17072) | function ensureConcat(xs) {
  function Reader (line 17126) | function Reader(run) {
    method read (line 674) | read(stream, ...rest) {
  function readNumericLiteral (line 17254) | function readNumericLiteral(stream) {
  function addDecimalLiteralSuffixLength (line 17303) | function addDecimalLiteralSuffixLength(stream, idx) {
  function readLegacyOctalLiteral (line 17332) | function readLegacyOctalLiteral(stream) {
  function readOctalLiteral (line 17365) | function readOctalLiteral(stream) {
  function readBinaryLiteral (line 17388) | function readBinaryLiteral(stream) {
  function readHexLiteral (line 17414) | function readHexLiteral(stream) {
  function parseNumeric (line 17439) | function parseNumeric(stream, len, radix, start = 0) {
  function isDecimalChar (line 17444) | function isDecimalChar(char) {
  function readStringLiteral (line 17466) | function readStringLiteral(stream) {
  function readTemplateLiteral (line 17514) | function readTemplateLiteral(stream, prefix) {
  function readTemplateElement (line 17534) | function readTemplateElement(stream) {
  function readRegExp (line 17607) | function readRegExp(stream) {
  function readComment (line 17692) | function readComment(stream) {
  function skipMultiLineComment (line 17719) | function skipMultiLineComment(stream) {
  function readSyntaxTemplate (line 17807) | function readSyntaxTemplate(stream, prefix, exprAllowed, dispatchChar) {
  function updateSyntax (line 17820) | function updateSyntax(prefix, token) {
  function freshScope (line 17844) | function freshScope(name = 'scope') {
  function Scope (line 17849) | function Scope(name) {
  function gensym (line 17868) | function gensym(name) {
  class Symbol (line 17875) | class Symbol {
    method constructor (line 17877) | constructor(name) {
    method toString (line 17880) | toString() {
  function makeSymbol (line 17885) | function makeSymbol(name) {
  class Env (line 17912) | class Env {
    method constructor (line 17913) | constructor() {
    method has (line 17944) | has(key) {
    method get (line 17948) | get(key) {
    method set (line 17952) | set(key, val) {
  function _interopRequireDefault (line 17978) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  class FunctionDeclTransform (line 17980) | class FunctionDeclTransform {}
  class VariableDeclTransform (line 17982) | class VariableDeclTransform {}
  class NewTransform (line 17984) | class NewTransform {}
  class ThrowTransform (line 17986) | class ThrowTransform {}
  class LetDeclTransform (line 17988) | class LetDeclTransform {}
  class ConstDeclTransform (line 17990) | class ConstDeclTransform {}
  class TryTransform (line 17992) | class TryTransform {}
  class WhileTransform (line 17994) | class WhileTransform {}
  class IfTransform (line 17996) | class IfTransform {}
  class ForTransform (line 17998) | class ForTransform {}
  class SwitchTransform (line 18000) | class SwitchTransform {}
  class BreakTransform (line 18002) | class BreakTransform {}
  class ContinueTransform (line 18004) | class ContinueTransform {}
  class DoTransform (line 18006) | class DoTransform {}
  class WithTransform (line 18008) | class WithTransform {}
  class ImportTransform (line 18010) | class ImportTransform {}
  class ExportTransform (line 18012) | class ExportTransform {}
  class SuperTransform (line 18014) | class SuperTransform {}
  class YieldTransform (line 18016) | class YieldTransform {}
  class ThisTransform (line 18018) | class ThisTransform {}
  class ClassTransform (line 18020) | class ClassTransform {}
  class DefaultTransform (line 18022) | class DefaultTransform {}
  class DebuggerTransform (line 18024) | class DebuggerTransform {}
  class SyntaxrecDeclTransform (line 18026) | class SyntaxrecDeclTransform {}
  class SyntaxDeclTransform (line 18028) | class SyntaxDeclTransform {}
  class OperatorDeclTransform (line 18030) | class OperatorDeclTransform {}
  class ReturnStatementTransform (line 18032) | class ReturnStatementTransform {}
  class ModuleNamespaceTransform (line 18034) | class ModuleNamespaceTransform {
    method constructor (line 18036) | constructor(namespace, mod) {
  class VarBindingTransform (line 18042) | class VarBindingTransform {
    method constructor (line 18044) | constructor(id) {
  class CompiletimeTransform (line 18049) | class CompiletimeTransform {
    method constructor (line 18051) | constructor(value) {
  function _interopRequireDefault (line 18094) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function _interopRequireWildcard (line 18096) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function extractNames (line 18107) | function extractNames(term) {
  function wrapStatement (line 18118) | function wrapStatement(declaration) {
  function makeVarDeclStmt (line 18127) | function makeVarDeclStmt(name, expr) {
  class SweetModule (line 18139) | class SweetModule {
    method constructor (line 18141) | constructor(items) {
    method [memoSym] (line 18180) | [memoSym]() {
    method runtimeItems (line 18194) | runtimeItems() {
    method compiletimeItems (line 18202) | compiletimeItems() {
    method parse (line 18210) | parse() {
    method codegen (line 18217) | codegen() {
  class Term (line 18233) | class Term {
    method constructor (line 18234) | constructor(attrs_63, type_64) {
    method _reduceState (line 18240) | _reduceState(reducer_65, state_66 = {}) {
    method _cloneAttrs (line 18243) | _cloneAttrs() {
    method reduce (line 18246) | reduce(reducer_67) {
    method extend (line 18250) | extend(attrs_69) {
    method from (line 18253) | from(type_70, value_71) {
    method fromNull (line 18259) | fromNull() {
    method fromNumber (line 18262) | fromNumber(value_72) {
    method fromString (line 18265) | fromString(value_73) {
    method fromPunctuator (line 18268) | fromPunctuator(value_74) {
    method fromKeyword (line 18271) | fromKeyword(value_75) {
    method fromIdentifier (line 18274) | fromIdentifier(value_76) {
    method fromRegularExpression (line 18277) | fromRegularExpression(value_77) {
    method fromBraces (line 18280) | fromBraces(inner_78) {
    method fromBrackets (line 18283) | fromBrackets(inner_79) {
    method fromParens (line 18286) | fromParens(inner_80) {
  method reduceTerm (line 18291) | reduceTerm(term_81, state_82) {
  class SyntaxTerm (line 18297) | class SyntaxTerm extends Term {
    method constructor (line 18298) | constructor(attrs_83, type_84) {
    method _reduceState (line 18301) | _reduceState(reducer_85, state_86 = {}) {
    method _cloneAttrs (line 18305) | _cloneAttrs() {
    method reduce (line 18308) | reduce(reducer_87) {
    method extend (line 18312) | extend(attrs_89) {
  class RawDelimiter (line 18321) | class RawDelimiter extends SyntaxTerm {
    method constructor (line 18322) | constructor(attrs_92, type_93) {
    method _reduceState (line 18331) | _reduceState(reducer_94, state_95 = {}) {
    method _cloneAttrs (line 18339) | _cloneAttrs() {
    method reduce (line 18342) | reduce(reducer_97) {
    method extend (line 18346) | extend(attrs_99) {
  class RawSyntax (line 18355) | class RawSyntax extends SyntaxTerm {
    method constructor (line 18356) | constructor(attrs_102, type_103) {
    method _reduceState (line 18362) | _reduceState(reducer_104, state_105 = {}) {
    method _cloneAttrs (line 18367) | _cloneAttrs() {
    method reduce (line 18370) | reduce(reducer_106) {
    method extend (line 18374) | extend(attrs_108) {
  class Statement (line 18383) | class Statement extends Term {
    method constructor (line 18384) | constructor(attrs_111, type_112) {
    method _reduceState (line 18387) | _reduceState(reducer_113, state_114 = {}) {
    method _cloneAttrs (line 18391) | _cloneAttrs() {
    method reduce (line 18394) | reduce(reducer_115) {
    method extend (line 18398) | extend(attrs_117) {
  class IterationStatement (line 18407) | class IterationStatement extends Statement {
    method constructor (line 18408) | constructor(attrs_120, type_121) {
    method _reduceState (line 18414) | _reduceState(reducer_122, state_123 = {}) {
    method _cloneAttrs (line 18421) | _cloneAttrs() {
    method reduce (line 18424) | reduce(reducer_124) {
    method extend (line 18428) | extend(attrs_126) {
  class Expression (line 18437) | class Expression extends Term {
    method constructor (line 18438) | constructor(attrs_129, type_130) {
    method _reduceState (line 18441) | _reduceState(reducer_131, state_132 = {}) {
    method _cloneAttrs (line 18445) | _cloneAttrs() {
    method reduce (line 18448) | reduce(reducer_133) {
    method extend (line 18452) | extend(attrs_135) {
  class MemberExpression (line 18461) | class MemberExpression extends Expression {
    method constructor (line 18462) | constructor(attrs_138, type_139) {
    method _reduceState (line 18468) | _reduceState(reducer_140, state_141 = {}) {
    method _cloneAttrs (line 18475) | _cloneAttrs() {
    method reduce (line 18478) | reduce(reducer_142) {
    method extend (line 18482) | extend(attrs_144) {
  class PropertyName (line 18491) | class PropertyName extends Term {
    method constructor (line 18492) | constructor(attrs_147, type_148) {
    method _reduceState (line 18495) | _reduceState(reducer_149, state_150 = {}) {
    method _cloneAttrs (line 18499) | _cloneAttrs() {
    method reduce (line 18502) | reduce(reducer_151) {
    method extend (line 18506) | extend(attrs_153) {
  class ObjectProperty (line 18515) | class ObjectProperty extends Term {
    method constructor (line 18516) | constructor(attrs_156, type_157) {
    method _reduceState (line 18519) | _reduceState(reducer_158, state_159 = {}) {
    method _cloneAttrs (line 18523) | _cloneAttrs() {
    method reduce (line 18526) | reduce(reducer_160) {
    method extend (line 18530) | extend(attrs_162) {
  class NamedObjectProperty (line 18539) | class NamedObjectProperty extends ObjectProperty {
    method constructor (line 18540) | constructor(attrs_165, type_166) {
    method _reduceState (line 18546) | _reduceState(reducer_167, state_168 = {}) {
    method _cloneAttrs (line 18553) | _cloneAttrs() {
    method reduce (line 18556) | reduce(reducer_169) {
    method extend (line 18560) | extend(attrs_171) {
  class MethodDefinition (line 18569) | class MethodDefinition extends NamedObjectProperty {
    method constructor (line 18570) | constructor(attrs_174, type_175) {
    method _reduceState (line 18576) | _reduceState(reducer_176, state_177 = {}) {
    method _cloneAttrs (line 18583) | _cloneAttrs() {
    method reduce (line 18586) | reduce(reducer_178) {
    method extend (line 18590) | extend(attrs_180) {
  class BindingWithDefault (line 18599) | class BindingWithDefault extends Term {
    method constructor (line 18600) | constructor(attrs_183, type_184) {
    method _reduceState (line 18609) | _reduceState(reducer_185, state_186 = {}) {
    method _cloneAttrs (line 18619) | _cloneAttrs() {
    method reduce (line 18622) | reduce(reducer_187) {
    method extend (line 18626) | extend(attrs_189) {
  class BindingIdentifier (line 18635) | class BindingIdentifier extends Term {
    method constructor (line 18636) | constructor(attrs_192, type_193) {
    method _reduceState (line 18642) | _reduceState(reducer_194, state_195 = {}) {
    method _cloneAttrs (line 18647) | _cloneAttrs() {
    method reduce (line 18650) | reduce(reducer_196) {
    method extend (line 18654) | extend(attrs_198) {
  class ArrayBinding (line 18663) | class ArrayBinding extends Term {
    method constructor (line 18664) | constructor(attrs_201, type_202) {
    method _reduceState (line 18673) | _reduceState(reducer_203, state_204 = {}) {
    method _cloneAttrs (line 18683) | _cloneAttrs() {
    method reduce (line 18686) | reduce(reducer_206) {
    method extend (line 18690) | extend(attrs_208) {
  class ObjectBinding (line 18699) | class ObjectBinding extends Term {
    method constructor (line 18700) | constructor(attrs_211, type_212) {
    method _reduceState (line 18706) | _reduceState(reducer_213, state_214 = {}) {
    method _cloneAttrs (line 18713) | _cloneAttrs() {
    method reduce (line 18716) | reduce(reducer_216) {
    method extend (line 18720) | extend(attrs_218) {
  class BindingProperty (line 18729) | class BindingProperty extends Term {
    method constructor (line 18730) | constructor(attrs_221, type_222) {
    method _reduceState (line 18733) | _reduceState(reducer_223, state_224 = {}) {
    method _cloneAttrs (line 18737) | _cloneAttrs() {
    method reduce (line 18740) | reduce(reducer_225) {
    method extend (line 18744) | extend(attrs_227) {
  class BindingPropertyIdentifier (line 18753) | class BindingPropertyIdentifier extends BindingProperty {
    method constructor (line 18754) | constructor(attrs_230, type_231) {
    method _reduceState (line 18763) | _reduceState(reducer_232, state_233 = {}) {
    method _cloneAttrs (line 18773) | _cloneAttrs() {
    method reduce (line 18776) | reduce(reducer_234) {
    method extend (line 18780) | extend(attrs_236) {
  class BindingPropertyProperty (line 18789) | class BindingPropertyProperty extends BindingProperty {
    method constructor (line 18790) | constructor(attrs_239, type_240) {
    method _reduceState (line 18799) | _reduceState(reducer_241, state_242 = {}) {
    method _cloneAttrs (line 18809) | _cloneAttrs() {
    method reduce (line 18812) | reduce(reducer_243) {
    method extend (line 18816) | extend(attrs_245) {
  class ClassExpression (line 18825) | class ClassExpression extends Expression {
    method constructor (line 18826) | constructor(attrs_248, type_249) {
    method _reduceState (line 18838) | _reduceState(reducer_250, state_251 = {}) {
    method _cloneAttrs (line 18851) | _cloneAttrs() {
    method reduce (line 18854) | reduce(reducer_253) {
    method extend (line 18858) | extend(attrs_255) {
  class ClassDeclaration (line 18867) | class ClassDeclaration extends Statement {
    method constructor (line 18868) | constructor(attrs_258, type_259) {
    method _reduceState (line 18880) | _reduceState(reducer_260, state_261 = {}) {
    method _cloneAttrs (line 18893) | _cloneAttrs() {
    method reduce (line 18896) | reduce(reducer_263) {
    method extend (line 18900) | extend(attrs_265) {
  class ClassElement (line 18909) | class ClassElement extends Term {
    method constructor (line 18910) | constructor(attrs_268, type_269) {
    method _reduceState (line 18919) | _reduceState(reducer_270, state_271 = {}) {
    method _cloneAttrs (line 18927) | _cloneAttrs() {
    method reduce (line 18930) | reduce(reducer_272) {
    method extend (line 18934) | extend(attrs_274) {
  class Module (line 18943) | class Module extends Term {
    method constructor (line 18944) | constructor(attrs_277, type_278) {
    method _reduceState (line 18953) | _reduceState(reducer_279, state_280 = {}) {
    method _cloneAttrs (line 18961) | _cloneAttrs() {
    method reduce (line 18964) | reduce(reducer_283) {
    method extend (line 18968) | extend(attrs_285) {
  class ImportDeclaration (line 18977) | class ImportDeclaration extends Term {
    method constructor (line 18978) | constructor(attrs_288, type_289) {
    method _reduceState (line 18987) | _reduceState(reducer_290, state_291 = {}) {
    method _cloneAttrs (line 18993) | _cloneAttrs() {
    method reduce (line 18996) | reduce(reducer_292) {
    method extend (line 19000) | extend(attrs_294) {
  class ExportDeclaration (line 19009) | class ExportDeclaration extends Term {
    method constructor (line 19010) | constructor(attrs_297, type_298) {
    method _reduceState (line 19013) | _reduceState(reducer_299, state_300 = {}) {
    method _cloneAttrs (line 19017) | _cloneAttrs() {
    method reduce (line 19020) | reduce(reducer_301) {
    method extend (line 19024) | extend(attrs_303) {
  class Import (line 19033) | class Import extends ImportDeclaration {
    method constructor (line 19034) | constructor(attrs_306, type_307) {
    method _reduceState (line 19043) | _reduceState(reducer_308, state_309 = {}) {
    method _cloneAttrs (line 19053) | _cloneAttrs() {
    method reduce (line 19056) | reduce(reducer_311) {
    method extend (line 19060) | extend(attrs_313) {
  class ImportNamespace (line 19069) | class ImportNamespace extends ImportDeclaration {
    method constructor (line 19070) | constructor(attrs_316, type_317) {
    method _reduceState (line 19079) | _reduceState(reducer_318, state_319 = {}) {
    method _cloneAttrs (line 19089) | _cloneAttrs() {
    method reduce (line 19092) | reduce(reducer_320) {
    method extend (line 19096) | extend(attrs_322) {
  class ImportSpecifier (line 19105) | class ImportSpecifier extends Term {
    method constructor (line 19106) | constructor(attrs_325, type_326) {
    method _reduceState (line 19115) | _reduceState(reducer_327, state_328 = {}) {
    method _cloneAttrs (line 19123) | _cloneAttrs() {
    method reduce (line 19126) | reduce(reducer_329) {
    method extend (line 19130) | extend(attrs_331) {
  class ExportAllFrom (line 19139) | class ExportAllFrom extends ExportDeclaration {
    method constructor (line 19140) | constructor(attrs_334, type_335) {
    method _reduceState (line 19146) | _reduceState(reducer_336, state_337 = {}) {
    method _cloneAttrs (line 19151) | _cloneAttrs() {
    method reduce (line 19154) | reduce(reducer_338) {
    method extend (line 19158) | extend(attrs_340) {
  class ExportFrom (line 19167) | class ExportFrom extends ExportDeclaration {
    method constructor (line 19168) | constructor(attrs_343, type_344) {
    method _reduceState (line 19177) | _reduceState(reducer_345, state_346 = {}) {
    method _cloneAttrs (line 19185) | _cloneAttrs() {
    method reduce (line 19188) | reduce(reducer_348) {
    method extend (line 19192) | extend(attrs_350) {
  class Export (line 19201) | class Export extends ExportDeclaration {
    method constructor (line 19202) | constructor(attrs_353, type_354) {
    method _reduceState (line 19208) | _reduceState(reducer_355, state_356 = {}) {
    method _cloneAttrs (line 19215) | _cloneAttrs() {
    method reduce (line 19218) | reduce(reducer_357) {
    method extend (line 19222) | extend(attrs_359) {
  class ExportDefault (line 19231) | class ExportDefault extends ExportDeclaration {
    method constructor (line 19232) | constructor(attrs_362, type_363) {
    method _reduceState (line 19238) | _reduceState(reducer_364, state_365 = {}) {
    method _cloneAttrs (line 19245) | _cloneAttrs() {
    method reduce (line 19248) | reduce(reducer_366) {
    method extend (line 19252) | extend(attrs_368) {
  class ExportSpecifier (line 19261) | class ExportSpecifier extends Term {
    method constructor (line 19262) | constructor(attrs_371, type_372) {
    method _reduceState (line 19271) | _reduceState(reducer_373, state_374 = {}) {
    method _cloneAttrs (line 19277) | _cloneAttrs() {
    method reduce (line 19280) | reduce(reducer_375) {
    method extend (line 19284) | extend(attrs_377) {
  class Method (line 19293) | class Method extends MethodDefinition {
    method constructor (line 19294) | constructor(attrs_380, type_381) {
    method _reduceState (line 19303) | _reduceState(reducer_382, state_383 = {}) {
    method _cloneAttrs (line 19311) | _cloneAttrs() {
    method reduce (line 19314) | reduce(reducer_384) {
    method extend (line 19318) | extend(attrs_386) {
  class Getter (line 19327) | class Getter extends MethodDefinition {
    method constructor (line 19328) | constructor(attrs_389, type_390) {
    method _reduceState (line 19331) | _reduceState(reducer_391, state_392 = {}) {
    method _cloneAttrs (line 19335) | _cloneAttrs() {
    method reduce (line 19338) | reduce(reducer_393) {
    method extend (line 19342) | extend(attrs_395) {
  class Setter (line 19351) | class Setter extends MethodDefinition {
    method constructor (line 19352) | constructor(attrs_398, type_399) {
    method _reduceState (line 19358) | _reduceState(reducer_400, state_401 = {}) {
    method _cloneAttrs (line 19365) | _cloneAttrs() {
    method reduce (line 19368) | reduce(reducer_402) {
    method extend (line 19372) | extend(attrs_404) {
  class DataProperty (line 19381) | class DataProperty extends NamedObjectProperty {
    method constructor (line 19382) | constructor(attrs_407, type_408) {
    method _reduceState (line 19388) | _reduceState(reducer_409, state_410 = {}) {
    method _cloneAttrs (line 19395) | _cloneAttrs() {
    method reduce (line 19398) | reduce(reducer_411) {
    method extend (line 19402) | extend(attrs_413) {
  class ShorthandProperty (line 19411) | class ShorthandProperty extends ObjectProperty {
    method constructor (line 19412) | constructor(attrs_416, type_417) {
    method _reduceState (line 19418) | _reduceState(reducer_418, state_419 = {}) {
    method _cloneAttrs (line 19423) | _cloneAttrs() {
    method reduce (line 19426) | reduce(reducer_420) {
    method extend (line 19430) | extend(attrs_422) {
  class StaticPropertyName (line 19439) | class StaticPropertyName extends PropertyName {
    method constructor (line 19440) | constructor(attrs_425, type_426) {
    method _reduceState (line 19446) | _reduceState(reducer_427, state_428 = {}) {
    method _cloneAttrs (line 19451) | _cloneAttrs() {
    method reduce (line 19454) | reduce(reducer_429) {
    method extend (line 19458) | extend(attrs_431) {
  class ComputedPropertyName (line 19467) | class ComputedPropertyName extends PropertyName {
    method constructor (line 19468) | constructor(attrs_434, type_435) {
    method _reduceState (line 19474) | _reduceState(reducer_436, state_437 = {}) {
    method _cloneAttrs (line 19481) | _cloneAttrs() {
    method reduce (line 19484) | reduce(reducer_438) {
    method extend (line 19488) | extend(attrs_440) {
  class LiteralBooleanExpression (line 19497) | class LiteralBooleanExpression extends Expression {
    method constructor (line 19498) | constructor(attrs_443, type_444) {
    method _reduceState (line 19504) | _reduceState(reducer_445, state_446 = {}) {
    method _cloneAttrs (line 19509) | _cloneAttrs() {
    method reduce (line 19512) | reduce(reducer_447) {
    method extend (line 19516) | extend(attrs_449) {
  class LiteralInfinityExpression (line 19525) | class LiteralInfinityExpression extends Expression {
    method constructor (line 19526) | constructor(attrs_452, type_453) {
    method _reduceState (line 19529) | _reduceState(reducer_454, state_455 = {}) {
    method _cloneAttrs (line 19533) | _cloneAttrs() {
    method reduce (line 19536) | reduce(reducer_456) {
    method extend (line 19540) | extend(attrs_458) {
  class LiteralNullExpression (line 19549) | class LiteralNullExpression extends Expression {
    method constructor (line 19550) | constructor(attrs_461, type_462) {
    method _reduceState (line 19553) | _reduceState(reducer_463, state_464 = {}) {
    method _cloneAttrs (line 19557) | _cloneAttrs() {
    method reduce (line 19560) | reduce(reducer_465) {
    method extend (line 19564) | extend(attrs_467) {
  class LiteralNumericExpression (line 19573) | class LiteralNumericExpression extends Expression {
    method constructor (line 19574) | constructor(attrs_470, type_471) {
    method _reduceState (line 19580) | _reduceState(reducer_472, state_473 = {}) {
    method _cloneAttrs (line 19585) | _cloneAttrs() {
    method reduce (line 19588) | reduce(reducer_474) {
    method extend (line 19592) | extend(attrs_476) {
  class LiteralRegExpExpression (line 19601) | class LiteralRegExpExpression extends Expression {
    method constructor (line 19602) | constructor(attrs_479, type_480) {
    method _reduceState (line 19611) | _reduceState(reducer_481, state_482 = {}) {
    method _cloneAttrs (line 19617) | _cloneAttrs() {
    method reduce (line 19620) | reduce(reducer_483) {
    method extend (line 19624) | extend(attrs_485) {
  class LiteralStringExpression (line 19633) | class LiteralStringExpression extends Expression {
    method constructor (line 19634) | constructor(attrs_488, type_489) {
    method _reduceState (line 19640) | _reduceState(reducer_490, state_491 = {}) {
    method _cloneAttrs (line 19645) | _cloneAttrs() {
    method reduce (line 19648) | reduce(reducer_492) {
    method extend (line 19652) | extend(attrs_494) {
  class ArrayExpression (line 19661) | class ArrayExpression extends Expression {
    method constructor (line 19662) | constructor(attrs_497, type_498) {
    method _reduceState (line 19668) | _reduceState(reducer_499, state_500 = {}) {
    method _cloneAttrs (line 19675) | _cloneAttrs() {
    method reduce (line 19678) | reduce(reducer_502) {
    method extend (line 19682) | extend(attrs_504) {
  class ArrowExpression (line 19691) | class ArrowExpression extends Expression {
    method constructor (line 19692) | constructor(attrs_507, type_508) {
    method _reduceState (line 19701) | _reduceState(reducer_509, state_510 = {}) {
    method _cloneAttrs (line 19711) | _cloneAttrs() {
    method reduce (line 19714) | reduce(reducer_511) {
    method extend (line 19718) | extend(attrs_513) {
  class ArrowExpressionE (line 19727) | class ArrowExpressionE extends Expression {
    method constructor (line 19728) | constructor(attrs_516, type_517) {
    method _reduceState (line 19737) | _reduceState(reducer_518, state_519 = {}) {
    method _cloneAttrs (line 19747) | _cloneAttrs() {
    method reduce (line 19750) | reduce(reducer_521) {
    method extend (line 19754) | extend(attrs_523) {
  class AssignmentExpression (line 19763) | class AssignmentExpression extends Expression {
    method constructor (line 19764) | constructor(attrs_526, type_527) {
    method _reduceState (line 19773) | _reduceState(reducer_528, state_529 = {}) {
    method _cloneAttrs (line 19783) | _cloneAttrs() {
    method reduce (line 19786) | reduce(reducer_530) {
    method extend (line 19790) | extend(attrs_532) {
  class BinaryExpression (line 19799) | class BinaryExpression extends Expression {
    method constructor (line 19800) | constructor(attrs_535, type_536) {
    method _reduceState (line 19812) | _reduceState(reducer_537, state_538 = {}) {
    method _cloneAttrs (line 19823) | _cloneAttrs() {
    method reduce (line 19826) | reduce(reducer_539) {
    method extend (line 19830) | extend(attrs_541) {
  class CallExpression (line 19839) | class CallExpression extends Expression {
    method constructor (line 19840) | constructor(attrs_544, type_545) {
    method _reduceState (line 19849) | _reduceState(reducer_546, state_547 = {}) {
    method _cloneAttrs (line 19859) | _cloneAttrs() {
    method reduce (line 19862) | reduce(reducer_549) {
    method extend (line 19866) | extend(attrs_551) {
  class CallExpressionE (line 19875) | class CallExpressionE extends Expression {
    method constructor (line 19876) | constructor(attrs_554, type_555) {
    method _reduceState (line 19885) | _reduceState(reducer_556, state_557 = {}) {
    method _cloneAttrs (line 19895) | _cloneAttrs() {
    method reduce (line 19898) | reduce(reducer_559) {
    method extend (line 19902) | extend(attrs_561) {
  class CompoundAssignmentExpression (line 19911) | class CompoundAssignmentExpression extends Expression {
    method constructor (line 19912) | constructor(attrs_564, type_565) {
    method _reduceState (line 19924) | _reduceState(reducer_566, state_567 = {}) {
    method _cloneAttrs (line 19935) | _cloneAttrs() {
    method reduce (line 19938) | reduce(reducer_568) {
    method extend (line 19942) | extend(attrs_570) {
  class ComputedMemberExpression (line 19951) | class ComputedMemberExpression extends MemberExpression {
    method constructor (line 19952) | constructor(attrs_573, type_574) {
    method _reduceState (line 19958) | _reduceState(reducer_575, state_576 = {}) {
    method _cloneAttrs (line 19965) | _cloneAttrs() {
    method reduce (line 19968) | reduce(reducer_577) {
    method extend (line 19972) | extend(attrs_579) {
  class ConditionalExpression (line 19981) | class ConditionalExpression extends Expression {
    method constructor (line 19982) | constructor(attrs_582, type_583) {
    method _reduceState (line 19994) | _reduceState(reducer_584, state_585 = {}) {
    method _cloneAttrs (line 20007) | _cloneAttrs() {
    method reduce (line 20010) | reduce(reducer_586) {
    method extend (line 20014) | extend(attrs_588) {
  class FunctionExpression (line 20023) | class FunctionExpression extends Expression {
    method constructor (line 20024) | constructor(attrs_591, type_592) {
    method _reduceState (line 20039) | _reduceState(reducer_593, state_594 = {}) {
    method _cloneAttrs (line 20053) | _cloneAttrs() {
    method reduce (line 20056) | reduce(reducer_595) {
    method extend (line 20060) | extend(attrs_597) {
  class FunctionExpressionE (line 20069) | class FunctionExpressionE extends Expression {
    method constructor (line 20070) | constructor(attrs_600, type_601) {
    method _reduceState (line 20085) | _reduceState(reducer_602, state_603 = {}) {
    method _cloneAttrs (line 20099) | _cloneAttrs() {
    method reduce (line 20102) | reduce(reducer_605) {
    method extend (line 20106) | extend(attrs_607) {
  class IdentifierExpression (line 20115) | class IdentifierExpression extends Expression {
    method constructor (line 20116) | constructor(attrs_610, type_611) {
    method _reduceState (line 20122) | _reduceState(reducer_612, state_613 = {}) {
    method _cloneAttrs (line 20127) | _cloneAttrs() {
    method reduce (line 20130) | reduce(reducer_614) {
    method extend (line 20134) | extend(attrs_616) {
  class NewExpression (line 20143) | class NewExpression extends Expression {
    method constructor (line 20144) | constructor(attrs_619, type_620) {
    method _reduceState (line 20153) | _reduceState(reducer_621, state_622 = {}) {
    method _cloneAttrs (line 20163) | _cloneAttrs() {
    method reduce (line 20166) | reduce(reducer_624) {
    method extend (line 20170) | extend(attrs_626) {
  class NewTargetExpression (line 20179) | class NewTargetExpression extends Expression {
    method constructor (line 20180) | constructor(attrs_629, type_630) {
    method _reduceState (line 20183) | _reduceState(reducer_631, state_632 = {}) {
    method _cloneAttrs (line 20187) | _cloneAttrs() {
    method reduce (line 20190) | reduce(reducer_633) {
    method extend (line 20194) | extend(attrs_635) {
  class ObjectExpression (line 20203) | class ObjectExpression extends Expression {
    method constructor (line 20204) | constructor(attrs_638, type_639) {
    method _reduceState (line 20210) | _reduceState(reducer_640, state_641 = {}) {
    method _cloneAttrs (line 20217) | _cloneAttrs() {
    method reduce (line 20220) | reduce(reducer_643) {
    method extend (line 20224) | extend(attrs_645) {
  class UnaryExpression (line 20233) | class UnaryExpression extends Expression {
    method constructor (line 20234) | constructor(attrs_648, type_649) {
    method _reduceState (line 20243) | _reduceState(reducer_650, state_651 = {}) {
    method _cloneAttrs (line 20251) | _cloneAttrs() {
    method reduce (line 20254) | reduce(reducer_652) {
    method extend (line 20258) | extend(attrs_654) {
  class StaticMemberExpression (line 20267) | class StaticMemberExpression extends MemberExpression {
    method constructor (line 20268) | constructor(attrs_657, type_658) {
    method _reduceState (line 20274) | _reduceState(reducer_659, state_660 = {}) {
    method _cloneAttrs (line 20279) | _cloneAttrs() {
    method reduce (line 20282) | reduce(reducer_661) {
    method extend (line 20286) | extend(attrs_663) {
  class TemplateExpression (line 20295) | class TemplateExpression extends Expression {
    method constructor (line 20296) | constructor(attrs_666, type_667) {
    method _reduceState (line 20305) | _reduceState(reducer_668, state_669 = {}) {
    method _cloneAttrs (line 20315) | _cloneAttrs() {
    method reduce (line 20318) | reduce(reducer_671) {
    method extend (line 20322) | extend(attrs_673) {
  class ThisExpression (line 20331) | class ThisExpression extends Expression {
    method constructor (line 20332) | constructor(attrs_676, type_677) {
    method _reduceState (line 20338) | _reduceState(reducer_678, state_679 = {}) {
    method _cloneAttrs (line 20343) | _cloneAttrs() {
    method reduce (line 20346) | reduce(reducer_680) {
    method extend (line 20350) | extend(attrs_682) {
  class UpdateExpression (line 20359) | class UpdateExpression extends Expression {
    method constructor (line 20360) | constructor(attrs_685, type_686) {
    method _reduceState (line 20372) | _reduceState(reducer_687, state_688 = {}) {
    method _cloneAttrs (line 20381) | _cloneAttrs() {
    method reduce (line 20384) | reduce(reducer_689) {
    method extend (line 20388) | extend(attrs_691) {
  class YieldExpression (line 20397) | class YieldExpression extends Expression {
    method constructor (line 20398) | constructor(attrs_694, type_695) {
    method _reduceState (line 20404) | _reduceState(reducer_696, state_697 = {}) {
    method _cloneAttrs (line 20411) | _cloneAttrs() {
    method reduce (line 20414) | reduce(reducer_698) {
    method extend (line 20418) | extend(attrs_700) {
  class YieldGeneratorExpression (line 20427) | class YieldGeneratorExpression extends Expression {
    method constructor (line 20428) | constructor(attrs_703, type_704) {
    method _reduceState (line 20434) | _reduceState(reducer_705, state_706 = {}) {
    method _cloneAttrs (line 20441) | _cloneAttrs() {
    method reduce (line 20444) | reduce(reducer_707) {
    method extend (line 20448) | extend(attrs_709) {
  class ParenthesizedExpression (line 20457) | class ParenthesizedExpression extends Expression {
    method constructor (line 20458) | constructor(attrs_712, type_713) {
    method _reduceState (line 20464) | _reduceState(reducer_714, state_715 = {}) {
    method _cloneAttrs (line 20469) | _cloneAttrs() {
    method reduce (line 20472) | reduce(reducer_716) {
    method extend (line 20476) | extend(attrs_718) {
  class BlockStatement (line 20485) | class BlockStatement extends Statement {
    method constructor (line 20486) | constructor(attrs_721, type_722) {
    method _reduceState (line 20492) | _reduceState(reducer_723, state_724 = {}) {
    method _cloneAttrs (line 20499) | _cloneAttrs() {
    method reduce (line 20502) | reduce(reducer_725) {
    method extend (line 20506) | extend(attrs_727) {
  class BreakStatement (line 20515) | class BreakStatement extends Statement {
    method constructor (line 20516) | constructor(attrs_730, type_731) {
    method _reduceState (line 20522) | _reduceState(reducer_732, state_733 = {}) {
    method _cloneAttrs (line 20527) | _cloneAttrs() {
    method reduce (line 20530) | reduce(reducer_734) {
    method extend (line 20534) | extend(attrs_736) {
  class ContinueStatement (line 20543) | class ContinueStatement extends Statement {
    method constructor (line 20544) | constructor(attrs_739, type_740) {
    method _reduceState (line 20550) | _reduceState(reducer_741, state_742 = {}) {
    method _cloneAttrs (line 20555) | _cloneAttrs() {
    method reduce (line 20558) | reduce(reducer_743) {
    method extend (line 20562) | extend(attrs_745) {
  class DebuggerStatement (line 20571) | class DebuggerStatement extends Statement {
    method constructor (line 20572) | constructor(attrs_748, type_749) {
    method _reduceState (line 20575) | _reduceState(reducer_750, state_751 = {}) {
    method _cloneAttrs (line 20579) | _cloneAttrs() {
    method reduce (line 20582) | reduce(reducer_752) {
    method extend (line 20586) | extend(attrs_754) {
  class DoWhileStatement (line 20595) | class DoWhileStatement extends IterationStatement {
    method constructor (line 20596) | constructor(attrs_757, type_758) {
    method _reduceState (line 20602) | _reduceState(reducer_759, state_760 = {}) {
    method _cloneAttrs (line 20609) | _cloneAttrs() {
    method reduce (line 20612) | reduce(reducer_761) {
    method extend (line 20616) | extend(attrs_763) {
  class EmptyStatement (line 20625) | class EmptyStatement extends Statement {
    method constructor (line 20626) | constructor(attrs_766, type_767) {
    method _reduceState (line 20629) | _reduceState(reducer_768, state_769 = {}) {
    method _cloneAttrs (line 20633) | _cloneAttrs() {
    method reduce (line 20636) | reduce(reducer_770) {
    method extend (line 20640) | extend(attrs_772) {
  class ExpressionStatement (line 20649) | class ExpressionStatement extends Statement {
    method constructor (line 20650) | constructor(attrs_775, type_776) {
    method _reduceState (line 20656) | _reduceState(reducer_777, state_778 = {}) {
    method _cloneAttrs (line 20663) | _cloneAttrs() {
    method reduce (line 20666) | reduce(reducer_779) {
    method extend (line 20670) | extend(attrs_781) {
  class ForInStatement (line 20679) | class ForInStatement extends IterationStatement {
    method constructor (line 20680) | constructor(attrs_784, type_785) {
    method _reduceState (line 20689) | _reduceState(reducer_786, state_787 = {}) {
    method _cloneAttrs (line 20699) | _cloneAttrs() {
    method reduce (line 20702) | reduce(reducer_788) {
    method extend (line 20706) | extend(attrs_790) {
  class ForOfStatement (line 20715) | class ForOfStatement extends IterationStatement {
    method constructor (line 20716) | constructor(attrs_793, type_794) {
    method _reduceState (line 20725) | _reduceState(reducer_795, state_796 = {}) {
    method _cloneAttrs (line 20735) | _cloneAttrs() {
    method reduce (line 20738) | reduce(reducer_797) {
    method extend (line 20742) | extend(attrs_799) {
  class ForStatement (line 20751) | class ForStatement extends IterationStatement {
    method constructor (line 20752) | constructor(attrs_802, type_803) {
    method _reduceState (line 20764) | _reduceState(reducer_804, state_805 = {}) {
    method _cloneAttrs (line 20777) | _cloneAttrs() {
    method reduce (line 20780) | reduce(reducer_806) {
    method extend (line 20784) | extend(attrs_808) {
  class IfStatement (line 20793) | class IfStatement extends Statement {
    method constructor (line 20794) | constructor(attrs_811, type_812) {
    method _reduceState (line 20806) | _reduceState(reducer_813, state_814 = {}) {
    method _cloneAttrs (line 20819) | _cloneAttrs() {
    method reduce (line 20822) | reduce(reducer_815) {
    method extend (line 20826) | extend(attrs_817) {
  class LabeledStatement (line 20835) | class LabeledStatement extends Statement {
    method constructor (line 20836) | constructor(attrs_820, type_821) {
    method _reduceState (line 20845) | _reduceState(reducer_822, state_823 = {}) {
    method _cloneAttrs (line 20853) | _cloneAttrs() {
    method reduce (line 20856) | reduce(reducer_824) {
    method extend (line 20860) | extend(attrs_826) {
  class ReturnStatement (line 20869) | class ReturnStatement extends Statement {
    method constructor (line 20870) | constructor(attrs_829, type_830) {
    method _reduceState (line 20876) | _reduceState(reducer_831, state_832 = {}) {
    method _cloneAttrs (line 20883) | _cloneAttrs() {
    method reduce (line 20886) | reduce(reducer_833) {
    method extend (line 20890) | extend(attrs_835) {
  class SwitchStatement (line 20899) | class SwitchStatement extends Statement {
    method constructor (line 20900) | constructor(attrs_838, type_839) {
    method _reduceState (line 20909) | _reduceState(reducer_840, state_841 = {}) {
    method _cloneAttrs (line 20919) | _cloneAttrs() {
    method reduce (line 20922) | reduce(reducer_843) {
    method extend (line 20926) | extend(attrs_845) {
  class SwitchStatementWithDefault (line 20935) | class SwitchStatementWithDefault extends Statement {
    method constructor (line 20936) | constructor(attrs_848, type_849) {
    method _reduceState (line 20951) | _reduceState(reducer_850, state_851 = {}) {
    method _cloneAttrs (line 20967) | _cloneAttrs() {
    method reduce (line 20970) | reduce(reducer_854) {
    method extend (line 20974) | extend(attrs_856) {
  class ThrowStatement (line 20983) | class ThrowStatement extends Statement {
    method constructor (line 20984) | constructor(attrs_859, type_860) {
    method _reduceState (line 20990) | _reduceState(reducer_861, state_862 = {}) {
    method _cloneAttrs (line 20997) | _cloneAttrs() {
    method reduce (line 21000) | reduce(reducer_863) {
    method extend (line 21004) | extend(attrs_865) {
  class TryCatchStatement (line 21013) | class TryCatchStatement extends Statement {
    method constructor (line 21014) | constructor(attrs_868, type_869) {
    method _reduceState (line 21023) | _reduceState(reducer_870, state_871 = {}) {
    method _cloneAttrs (line 21033) | _cloneAttrs() {
    method reduce (line 21036) | reduce(reducer_872) {
    method extend (line 21040) | extend(attrs_874) {
  class TryFinallyStatement (line 21049) | class TryFinallyStatement extends Statement {
    method constructor (line 21050) | constructor(attrs_877, type_878) {
    method _reduceState (line 21062) | _reduceState(reducer_879, state_880 = {}) {
    method _cloneAttrs (line 21075) | _cloneAttrs() {
    method reduce (line 21078) | reduce(reducer_881) {
    method extend (line 21082) | extend(attrs_883) {
  class VariableDeclarationStatement (line 21091) | class VariableDeclarationStatement extends Statement {
    method constructor (line 21092) | constructor(attrs_886, type_887) {
    method _reduceState (line 21098) | _reduceState(reducer_888, state_889 = {}) {
    method _cloneAttrs (line 21105) | _cloneAttrs() {
    method reduce (line 21108) | reduce(reducer_890) {
    method extend (line 21112) | extend(attrs_892) {
  class WithStatement (line 21121) | class WithStatement extends Statement {
    method constructor (line 21122) | constructor(attrs_895, type_896) {
    method _reduceState (line 21131) | _reduceState(reducer_897, state_898 = {}) {
    method _cloneAttrs (line 21141) | _cloneAttrs() {
    method reduce (line 21144) | reduce(reducer_899) {
    method extend (line 21148) | extend(attrs_901) {
  class WhileStatement (line 21157) | class WhileStatement extends IterationStatement {
    method constructor (line 21158) | constructor(attrs_904, type_905) {
    method _reduceState (line 21164) | _reduceState(reducer_906, state_907 = {}) {
    method _cloneAttrs (line 21171) | _cloneAttrs() {
    method reduce (line 21174) | reduce(reducer_908) {
    method extend (line 21178) | extend(attrs_910) {
  class Pragma (line 21187) | class Pragma extends Term {
    method constructor (line 21188) | constructor(attrs_913, type_914) {
    method _reduceState (line 21197) | _reduceState(reducer_915, state_916 = {}) {
    method _cloneAttrs (line 21203) | _cloneAttrs() {
    method reduce (line 21206) | reduce(reducer_917) {
    method extend (line 21210) | extend(attrs_919) {
  class Block (line 21219) | class Block extends Term {
    method constructor (line 21220) | constructor(attrs_922, type_923) {
    method _reduceState (line 21226) | _reduceState(reducer_924, state_925 = {}) {
    method _cloneAttrs (line 21233) | _cloneAttrs() {
    method reduce (line 21236) | reduce(reducer_927) {
    method extend (line 21240) | extend(attrs_929) {
  class CatchClause (line 21249) | class CatchClause extends Term {
    method constructor (line 21250) | constructor(attrs_932, type_933) {
    method _reduceState (line 21259) | _reduceState(reducer_934, state_935 = {}) {
    method _cloneAttrs (line 21269) | _cloneAttrs() {
    method reduce (line 21272) | reduce(reducer_936) {
    method extend (line 21276) | extend(attrs_938) {
  class Directive (line 21285) | class Directive extends Term {
    method constructor (line 21286) | constructor(attrs_941, type_942) {
    method _reduceState (line 21292) | _reduceState(reducer_943, state_944 = {}) {
    method _cloneAttrs (line 21297) | _cloneAttrs() {
    method reduce (line 21300) | reduce(reducer_945) {
    method extend (line 21304) | extend(attrs_947) {
  class FormalParameters (line 21313) | class FormalParameters extends Term {
    method constructor (line 21314) | constructor(attrs_950, type_951) {
    method _reduceState (line 21323) | _reduceState(reducer_952, state_953 = {}) {
    method _cloneAttrs (line 21333) | _cloneAttrs() {
    method reduce (line 21336) | reduce(reducer_955) {
    method extend (line 21340) | extend(attrs_957) {
  class FunctionBody (line 21349) | class FunctionBody extends Term {
    method constructor (line 21350) | constructor(attrs_960, type_961) {
    method _reduceState (line 21359) | _reduceState(reducer_962, state_963 = {}) {
    method _cloneAttrs (line 21367) | _cloneAttrs() {
    method reduce (line 21370) | reduce(reducer_966) {
    method extend (line 21374) | extend(attrs_968) {
  class FunctionDeclaration (line 21383) | class FunctionDeclaration extends Statement {
    method constructor (line 21384) | constructor(attrs_971, type_972) {
    method _reduceState (line 21399) | _reduceState(reducer_973, state_974 = {}) {
    method _cloneAttrs (line 21413) | _cloneAttrs() {
    method reduce (line 21416) | reduce(reducer_975) {
    method extend (line 21420) | extend(attrs_977) {
  class FunctionDeclarationE (line 21429) | class FunctionDeclarationE extends Statement {
    method constructor (line 21430) | constructor(attrs_980, type_981) {
    method _reduceState (line 21445) | _reduceState(reducer_982, state_983 = {}) {
    method _cloneAttrs (line 21459) | _cloneAttrs() {
    method reduce (line 21462) | reduce(reducer_985) {
    method extend (line 21466) | extend(attrs_987) {
  class Script (line 21475) | class Script extends Term {
    method constructor (line 21476) | constructor(attrs_990, type_991) {
    method _reduceState (line 21485) | _reduceState(reducer_992, state_993 = {}) {
    method _cloneAttrs (line 21493) | _cloneAttrs() {
    method reduce (line 21496) | reduce(reducer_996) {
    method extend (line 21500) | extend(attrs_998) {
  class SpreadElement (line 21509) | class SpreadElement extends Term {
    method constructor (line 21510) | constructor(attrs_1001, type_1002) {
    method _reduceState (line 21516) | _reduceState(reducer_1003, state_1004 = {}) {
    method _cloneAttrs (line 21523) | _cloneAttrs() {
    method reduce (line 21526) | reduce(reducer_1005) {
    method extend (line 21530) | extend(attrs_1007) {
  class Super (line 21539) | class Super extends Term {
    method constructor (line 21540) | constructor(attrs_1010, type_1011) {
    method _reduceState (line 21543) | _reduceState(reducer_1012, state_1013 = {}) {
    method _cloneAttrs (line 21547) | _cloneAttrs() {
    method reduce (line 21550) | reduce(reducer_1014) {
    method extend (line 21554) | extend(attrs_1016) {
  class SwitchCase (line 21563) | class SwitchCase extends Term {
    method constructor (line 21564) | constructor(attrs_1019, type_1020) {
    method _reduceState (line 21573) | _reduceState(reducer_1021, state_1022 = {}) {
    method _cloneAttrs (line 21583) | _cloneAttrs() {
    method reduce (line 21586) | reduce(reducer_1024) {
    method extend (line 21590) | extend(attrs_1026) {
  class SwitchDefault (line 21599) | class SwitchDefault extends Term {
    method constructor (line 21600) | constructor(attrs_1029, type_1030) {
    method _reduceState (line 21606) | _reduceState(reducer_1031, state_1032 = {}) {
    method _cloneAttrs (line 21613) | _cloneAttrs() {
    method reduce (line 21616) | reduce(reducer_1034) {
    method extend (line 21620) | extend(attrs_1036) {
  class TemplateElement (line 21629) | class TemplateElement extends Term {
    method constructor (line 21630) | constructor(attrs_1039, type_1040) {
    method _reduceState (line 21636) | _reduceState(reducer_1041, state_1042 = {}) {
    method _cloneAttrs (line 21641) | _cloneAttrs() {
    method reduce (line 21644) | reduce(reducer_1043) {
    method extend (line 21648) | extend(attrs_1045) {
  class SyntaxTemplate (line 21657) | class SyntaxTemplate extends Expression {
    method constructor (line 21658) | constructor(attrs_1048, type_1049) {
    method _reduceState (line 21664) | _reduceState(reducer_1050, state_1051 = {}) {
    method _cloneAttrs (line 21671) | _cloneAttrs() {
    method reduce (line 21674) | reduce(reducer_1053) {
    method extend (line 21678) | extend(attrs_1055) {
  class SyntaxQuote (line 21687) | class SyntaxQuote extends Term {
    method constructor (line 21688) | constructor(attrs_1058, type_1059) {
    method _reduceState (line 21697) | _reduceState(reducer_1060, state_1061 = {}) {
    method _cloneAttrs (line 21703) | _cloneAttrs() {
    method reduce (line 21706) | reduce(reducer_1062) {
    method extend (line 21710) | extend(attrs_1064) {
  class VariableDeclaration (line 21719) | class VariableDeclaration extends Term {
    method constructor (line 21720) | constructor(attrs_1067, type_1068) {
    method _reduceState (line 21729) | _reduceState(reducer_1069, state_1070 = {}) {
    method _cloneAttrs (line 21737) | _cloneAttrs() {
    method reduce (line 21740) | reduce(reducer_1072) {
    method extend (line 21744) | extend(attrs_1074) {
  class VariableDeclarator (line 21753) | class VariableDeclarator extends Term {
    method constructor (line 21754) | constructor(attrs_1077, type_1078) {
    method _reduceState (line 21763) | _reduceState(reducer_1079, state_1080 = {}) {
    method _cloneAttrs (line 21773) | _cloneAttrs() {
    method reduce (line 21776) | reduce(reducer_1081) {
    method extend (line 21780) | extend(attrs_1083) {
  class OperatorDeclarator (line 21789) | class OperatorDeclarator extends VariableDeclarator {
    method constructor (line 21790) | constructor(attrs_1086, type_1087) {
    method _reduceState (line 21799) | _reduceState(reducer_1088, state_1089 = {}) {
    method _cloneAttrs (line 21805) | _cloneAttrs() {
    method reduce (line 21808) | reduce(reducer_1090) {
    method extend (line 21812) | extend(attrs_1092) {
  function _interopRequireWildcard (line 21841) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function _interopRequireDefault (line 21882) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function codegen (line 21884) | function codegen(modTerm) {
  function _interopRequireDefault (line 22040) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function codeGen (line 22042) | function codeGen(script) {
  function defineProperties (line 22057) | function defineProperties(target, props) { for (var i = 0; i < props.len...
  function _interopRequireDefault (line 22071) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function _toConsumableArray (line 22073) | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i ...
  function _classCallCheck (line 22075) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
  function p (line 22077) | function p(node, precedence, a) {
  function t (line 22081) | function t(token) {
  function paren (line 22085) | function paren(rep) {
  function brace (line 22089) | function brace(rep) {
  function bracket (line 22093) | function bracket(rep) {
  function noIn (line 22097) | function noIn(rep) {
  function markContainsIn (line 22101) | function markContainsIn(state) {
  function seq (line 22105) | function seq() {
  function semi (line 22113) | function semi() {
  function semiOp (line 22117) | function semiOp() {
  function empty (line 22121) | function empty() {
  function commaSep (line 22125) | function commaSep(pieces) {
  function getAssignmentExpr (line 22129) | function getAssignmentExpr(state) {
  function MinimalCodeGen (line 22134) | function MinimalCodeGen() {
  function ToObject (line 23005) | function ToObject(val) {
  function ownEnumerableKeys (line 23013) | function ownEnumerableKeys(obj) {
  function defineProperties (line 23049) | function defineProperties(target, props) { for (var i = 0; i < props.len...
  function _possibleConstructorReturn (line 23057) | function _possibleConstructorReturn(self, call) { if (!self) { throw new...
  function _inherits (line 23059) | function _inherits(subClass, superClass) { if (typeof superClass !== "fu...
  function _classCallCheck (line 23061) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
  function getPrecedence (line 23117) | function getPrecedence(node) {
  function escapeStringLiteral (line 23180) | function escapeStringLiteral(stringValue) {
  function CodeRep (line 23237) | function CodeRep() {
  function Empty (line 23264) | function Empty() {
  function Token (line 23281) | function Token(token) {
  function NumberCodeRep (line 23303) | function NumberCodeRep(number) {
  function Paren (line 23325) | function Paren(expr) {
  function Bracket (line 23355) | function Bracket(expr) {
  function Brace (line 23385) | function Brace(expr) {
  function NoIn (line 23415) | function NoIn(expr) {
  function ContainsIn (line 23443) | function ContainsIn(expr) {
  function Seq (line 23477) | function Seq(children) {
  function Semi (line 23509) | function Semi() {
  function CommaSep (line 23521) | function CommaSep(children) {
  function SemiOp (line 23559) | function SemiOp() {
  function defineProperties (line 23581) | function defineProperties(target, props) { for (var i = 0; i < props.len...
  function _interopRequireDefault (line 23596) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function _possibleConstructorReturn (line 23598) | function _possibleConstructorReturn(self, call) { if (!self) { throw new...
  function _inherits (line 23600) | function _inherits(subClass, superClass) { if (typeof superClass !== "fu...
  function _toConsumableArray (line 23602) | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i ...
  function _classCallCheck (line 23604) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
  function empty (line 23606) | function empty() {
  function noIn (line 23610) | function noIn(rep) {
  function markContainsIn (line 23614) | function markContainsIn(state) {
  function seq (line 23618) | function seq() {
  function isEmpty (line 23626) | function isEmpty(codeRep) {
  function ExtensibleCodeGen (line 23694) | function ExtensibleCodeGen() {
  function Linebreak (line 24635) | function Linebreak() {
  function withoutTrailingLinebreak (line 24657) | function withoutTrailingLinebreak(state) {
  function indent (line 24675) | function indent(rep, includingFinal) {
  function FormattedCodeGen (line 24693) | function FormattedCodeGen() {
  function _interopRequireDefault (line 24929) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function transformWithSpec (line 24931) | function transformWithSpec(transformer, node, spec) {
  function reduce (line 24978) | function reduce(reducer, reducible) {
  function _interopRequireDefault (line 24996) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function _classCallCheck (line 24998) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
  function Maybe (line 25063) | function Maybe(arg) { return { typeName: "Maybe", argument: arg }; }
  function List (line 25064) | function List(arg) { return { typeName: "List", argument: arg }; }
  function Const (line 25065) | function Const(arg) { return { typeName: "Const", argument: arg }; }
  function Union (line 25066) | function Union() { return { typeName: "Union", arguments: [].slice.call(...
  function defineProperties (line 25895) | function defineProperties(target, props) { for (var i = 0; i < props.len...
  function _interopRequireDefault (line 25921) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function _classCallCheck (line 25923) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
  function id (line 25927) | function id(x) {
  function handlerForFieldOfType (line 25931) | function handlerForFieldOfType(type) {
  function MonoidalReducer (line 26008) | function MonoidalReducer(monoid) {
  function defineProperties (line 26042) | function defineProperties(target, props) { for (var i = 0; i < props.len...
  function _classCallCheck (line 26065) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
  function numberDot (line 26067) | function numberDot(fragment) {
  function renderNumber (line 26074) | function renderNumber(n) {
  function TokenStream (line 26095) | function TokenStream() {
  function _interopRequireWildcard (line 26168) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  method constructor (line 26174) | constructor(phase) {
  method reduceModule (line 26179) | reduceModule(t, s) {
  method reduceIdentifierExpression (line 26186) | reduceIdentifierExpression(t, s) {
  method reduceStaticPropertyName (line 26192) | reduceStaticPropertyName(t, s) {
  method reduceBindingIdentifier (line 26198) | reduceBindingIdentifier(t, s) {
  method reduceStaticMemberExpression (line 26204) | reduceStaticMemberExpression(t, s) {
  method reduceFunctionBody (line 26211) | reduceFunctionBody(t, s) {
  method reduceVariableDeclarationStatement (line 26218) | reduceVariableDeclarationStatement(t, s) {
  method reduceVariableDeclaration (line 26227) | reduceVariableDeclaration(t, s) {
  method reduceCallExpression (line 26234) | reduceCallExpression(t, s) {
  method reduceArrayExpression (line 26241) | reduceArrayExpression(t, s) {
  method reduceImport (line 26247) | reduceImport() {
  method reduceBlock (line 26251) | reduceBlock(t, s) {
  function _interopRequireDefault (line 26278) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function _interopRequireWildcard (line 26280) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function _interopRequireWildcard (line 26473) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function _interopRequireDefault (line 26475) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function getFirstSlice (line 26477) | function getFirstSlice(stx) {
  function sizeDecending (line 26486) | function sizeDecending(a, b) {
  class Syntax (line 26682) | class Syntax {
    method constructor (line 26684) | constructor(token, oldstx) {
    method of (line 26696) | static of(token, stx) {
    method from (line 26700) | static from(type, value, stx) {
    method from (line 26714) | from(type, value) {
    method fromNull (line 26723) | fromNull() {
    method fromNumber (line 26727) | fromNumber(value) {
    method fromString (line 26731) | fromString(value) {
    method fromPunctuator (line 26735) | fromPunctuator(value) {
    method fromKeyword (line 26739) | fromKeyword(value) {
    method fromIdentifier (line 26743) | fromIdentifier(value) {
    method fromRegularExpression (line 26747) | fromRegularExpression(value) {
    method fromNull (line 26751) | static fromNull(stx) {
    method fromNumber (line 26755) | static fromNumber(value, stx) {
    method fromString (line 26759) | static fromString(value, stx) {
    method fromPunctuator (line 26763) | static fromPunctuator(value, stx) {
    method fromKeyword (line 26767) | static fromKeyword(value, stx) {
    method fromIdentifier (line 26771) | static fromIdentifier(value, stx) {
    method fromRegularExpression (line 26775) | static fromRegularExpression(value, stx) {
    method resolve (line 26780) | resolve(phase) {
    method val (line 26819) | val() {
    method lineNumber (line 26836) | lineNumber() {
    method setLineNumber (line 26844) | setLineNumber(line) {
    method addScope (line 26864) | addScope(scope, bindings, phase, options = { flip: false }) {
    method removeScope (line 26909) | removeScope(scope, phase) {
    method match (line 26931) | match(type, value) {
    method isIdentifier (line 26938) | isIdentifier(value) {
    method isAssign (line 26942) | isAssign(value) {
    method isBooleanLiteral (line 26946) | isBooleanLiteral(value) {
    method isKeyword (line 26950) | isKeyword(value) {
    method isNullLiteral (line 26954) | isNullLiteral(value) {
    method isNumericLiteral (line 26958) | isNumericLiteral(value) {
    method isPunctuator (line 26962) | isPunctuator(value) {
    method isStringLiteral (line 26966) | isStringLiteral(value) {
    method isRegularExpression (line 26970) | isRegularExpression(value) {
    method isTemplate (line 26974) | isTemplate(value) {
    method isDelimiter (line 26978) | isDelimiter(value) {
    method isParens (line 26982) | isParens(value) {
    method isBraces (line 26986) | isBraces(value) {
    method isBrackets (line 26990) | isBrackets(value) {
    method isSyntaxTemplate (line 26994) | isSyntaxTemplate(value) {
    method isEOF (line 26998) | isEOF(value) {
    method toString (line 27002) | toString() {
  function expect (line 27029) | function expect(cond, message, offendingSyntax, rest) {
  function assert (line 27045) | function assert(cond, message) {
  function _interopRequireDefault (line 27072) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  class BindingMap (line 27074) | class BindingMap {
    method constructor (line 27076) | constructor() {
    method add (line 27083) | add(stx, {
    method addForward (line 27113) | addForward(stx, forwardStx, binding, phase) {
    method get (line 27136) | get(stx) {
  function _interopRequireWildcard (line 27165) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function _interopRequireDefault (line 27167) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  class Compiler (line 27169) | class Compiler {
    method constructor (line 27170) | constructor(phase, env, store, context) {
    method compile (line 27177) | compile(stxl) {
  function _interopRequireDefault (line 27239) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function _interopRequireWildcard (line 27241) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  class TermExpander (line 27243) | class TermExpander extends _astDispatcher2.default {
    method constructor (line 27244) | constructor(context) {
    method expand (line 27249) | expand(term) {
    method expandRawSyntax (line 27253) | expandRawSyntax(term) {
    method expandRawDelimiter (line 27257) | expandRawDelimiter(term) {
    method expandTemplateExpression (line 27261) | expandTemplateExpression(term) {
    method expandBreakStatement (line 27268) | expandBreakStatement(term) {
    method expandDoWhileStatement (line 27274) | expandDoWhileStatement(term) {
    method expandWithStatement (line 27281) | expandWithStatement(term) {
    method expandDebuggerStatement (line 27288) | expandDebuggerStatement(term) {
    method expandContinueStatement (line 27292) | expandContinueStatement(term) {
    method expandSwitchStatementWithDefault (line 27298) | expandSwitchStatementWithDefault(term) {
    method expandComputedMemberExpression (line 27307) | expandComputedMemberExpression(term) {
    method expandSwitchStatement (line 27314) | expandSwitchStatement(term) {
    method expandFormalParameters (line 27321) | expandFormalParameters(term) {
    method expandArrowExpressionE (line 27329) | expandArrowExpressionE(term) {
    method expandArrowExpression (line 27333) | expandArrowExpression(term) {
    method expandSwitchDefault (line 27337) | expandSwitchDefault(term) {
    method expandSwitchCase (line 27343) | expandSwitchCase(term) {
    method expandForInStatement (line 27350) | expandForInStatement(term) {
    method expandTryCatchStatement (line 27358) | expandTryCatchStatement(term) {
    method expandTryFinallyStatement (line 27365) | expandTryFinallyStatement(term) {
    method expandCatchClause (line 27374) | expandCatchClause(term) {
    method expandThrowStatement (line 27381) | expandThrowStatement(term) {
    method expandForOfStatement (line 27387) | expandForOfStatement(term) {
    method expandBindingIdentifier (line 27395) | expandBindingIdentifier(term) {
    method expandBindingPropertyIdentifier (line 27399) | expandBindingPropertyIdentifier(term) {
    method expandBindingPropertyProperty (line 27402) | expandBindingPropertyProperty(term) {
    method expandComputedPropertyName (line 27409) | expandComputedPropertyName(term) {
    method expandObjectBinding (line 27415) | expandObjectBinding(term) {
    method expandArrayBinding (line 27421) | expandArrayBinding(term) {
    method expandBindingWithDefault (line 27429) | expandBindingWithDefault(term) {
    method expandShorthandProperty (line 27436) | expandShorthandProperty(term) {
    method expandForStatement (line 27448) | expandForStatement(term) {
    method expandYieldExpression (line 27456) | expandYieldExpression(term) {
    method expandYieldGeneratorExpression (line 27463) | expandYieldGeneratorExpression(term) {
    method expandWhileStatement (line 27470) | expandWhileStatement(term) {
    method expandIfStatement (line 27477) | expandIfStatement(term) {
    method expandBlockStatement (line 27487) | expandBlockStatement(term) {
    method expandBlock (line 27493) | expandBlock(term) {
    method expandVariableDeclarationStatement (line 27507) | expandVariableDeclarationStatement(term) {
    method expandReturnStatement (line 27512) | expandReturnStatement(term) {
    method expandClassDeclaration (line 27521) | expandClassDeclaration(term) {
    method expandClassExpression (line 27529) | expandClassExpression(term) {
    method expandClassElement (line 27537) | expandClassElement(term) {
    method expandThisExpression (line 27544) | expandThisExpression(term) {
    method expandSyntaxTemplate (line 27548) | expandSyntaxTemplate(term) {
    method expandStaticMemberExpression (line 27570) | expandStaticMemberExpression(term) {
    method expandArrayExpression (line 27577) | expandArrayExpression(term) {
    method expandImport (line 27583) | expandImport(term) {
    method expandImportNamespace (line 27587) | expandImportNamespace(term) {
    method expandExport (line 27591) | expandExport(term) {
    method expandExportDefault (line 27597) | expandExportDefault(term) {
    method expandExportFrom (line 27603) | expandExportFrom(term) {
    method expandExportAllFrom (line 27607) | expandExportAllFrom(term) {
    method expandExportSpecifier (line 27611) | expandExportSpecifier(term) {
    method expandStaticPropertyName (line 27615) | expandStaticPropertyName(term) {
    method expandDataProperty (line 27619) | expandDataProperty(term) {
    method expandObjectExpression (line 27626) | expandObjectExpression(term) {
    method expandVariableDeclarator (line 27632) | expandVariableDeclarator(term) {
    method expandVariableDeclaration (line 27640) | expandVariableDeclaration(term) {
    method expandParenthesizedExpression (line 27650) | expandParenthesizedExpression(term) {
    method expandUnaryExpression (line 27666) | expandUnaryExpression(term) {
    method expandUpdateExpression (line 27673) | expandUpdateExpression(term) {
    method expandBinaryExpression (line 27681) | expandBinaryExpression(term) {
    method expandConditionalExpression (line 27691) | expandConditionalExpression(term) {
    method expandNewTargetExpression (line 27699) | expandNewTargetExpression(term) {
    method expandNewExpression (line 27703) | expandNewExpression(term) {
    method expandSuper (line 27713) | expandSuper(term) {
    method expandCallExpressionE (line 27717) | expandCallExpressionE(term) {
    method expandSpreadElement (line 27727) | expandSpreadElement(term) {
    method expandExpressionStatement (line 27733) | expandExpressionStatement(term) {
    method expandLabeledStatement (line 27740) | expandLabeledStatement(term) {
    method doFunctionExpansion (line 27747) | doFunctionExpansion(term, type) {
    method expandMethod (line 27830) | expandMethod(term) {
    method expandSetter (line 27834) | expandSetter(term) {
    method expandGetter (line 27838) | expandGetter(term) {
    method expandFunctionDeclarationE (line 27842) | expandFunctionDeclarationE(term) {
    method expandFunctionExpressionE (line 27846) | expandFunctionExpressionE(term) {
    method expandCompoundAssignmentExpression (line 27850) | expandCompoundAssignmentExpression(term) {
    method expandAssignmentExpression (line 27858) | expandAssignmentExpression(term) {
    method expandEmptyStatement (line 27865) | expandEmptyStatement(term) {
    method expandLiteralBooleanExpression (line 27869) | expandLiteralBooleanExpression(term) {
    method expandLiteralNumericExpression (line 27873) | expandLiteralNumericExpression(term) {
    method expandLiteralInfinityExpression (line 27876) | expandLiteralInfinityExpression(term) {
    method expandIdentifierExpression (line 27880) | expandIdentifierExpression(term) {
    method expandLiteralNullExpression (line 27890) | expandLiteralNullExpression(term) {
    method expandLiteralStringExpression (line 27894) | expandLiteralStringExpression(term) {
    method expandLiteralRegExpExpression (line 27898) | expandLiteralRegExpExpression(term) {
  function _interopRequireDefault (line 27948) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function _interopRequireWildcard (line 27950) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function getLineNumber (line 27959) | function getLineNumber(x) {
  class Enforester (line 27973) | class Enforester {
    method constructor (line 27975) | constructor(stxl, prev, context) {
    method peek (line 27988) | peek(n = 0) {
    method advance (line 27992) | advance() {
    method enforest (line 28004) | enforest(type = 'Module') {
    method enforestModule (line 28032) | enforestModule() {
    method enforestBody (line 28036) | enforestBody() {
    method enforestModuleItem (line 28040) | enforestModuleItem() {
    method enforestExportDeclaration (line 28053) | enforestExportDeclaration() {
    method enforestExportClause (line 28107) | enforestExportClause() {
    method enforestExportSpecifier (line 28117) | enforestExportSpecifier() {
    method enforestImportDeclaration (line 28130) | enforestImportDeclaration() {
    method enforestNamespaceBinding (line 28200) | enforestNamespaceBinding() {
    method enforestNamedImports (line 28206) | enforestNamedImports() {
    method enforestImportSpecifiers (line 28216) | enforestImportSpecifiers() {
    method enforestFromClause (line 28240) | enforestFromClause() {
    method enforestStatementListItem (line 28247) | enforestStatementListItem() {
    method enforestStatement (line 28259) | enforestStatement() {
    method enforestLabeledStatement (line 28344) | enforestLabeledStatement() {
    method enforestBreakStatement (line 28355) | enforestBreakStatement() {
    method enforestTryStatement (line 28371) | enforestTryStatement() {
    method enforestCatchClause (line 28395) | enforestCatchClause() {
    method enforestThrowStatement (line 28404) | enforestThrowStatement() {
    method enforestWithStatement (line 28411) | enforestWithStatement() {
    method enforestDebuggerStatement (line 28420) | enforestDebuggerStatement() {
    method enforestDoStatement (line 28426) | enforestDoStatement() {
    method enforestContinueStatement (line 28437) | enforestContinueStatement() {
    method enforestSwitchStatement (line 28453) | enforestSwitchStatement() {
    method enforestSwitchCases (line 28482) | enforestSwitchCases() {
    method enforestSwitchCase (line 28490) | enforestSwitchCase() {
    method enforestSwitchCaseBody (line 28498) | enforestSwitchCaseBody() {
    method enforestStatementListInSwitchCaseBody (line 28503) | enforestStatementListInSwitchCaseBody() {
    method enforestSwitchDefault (line 28511) | enforestSwitchDefault() {
    method enforestForStatement (line 28518) | enforestForStatement() {
    method enforestIfStatement (line 28609) | enforestIfStatement() {
    method enforestWhileStatement (line 28627) | enforestWhileStatement() {
    method enforestBlockStatement (line 28641) | enforestBlockStatement() {
    method enforestBlock (line 28647) | enforestBlock() {
    method enforestClass (line 28653) | enforestClass({
    method enforestBindingTarget (line 28705) | enforestBindingTarget({ allowPunctuator = false } = {}) {
    method enforestObjectBinding (line 28717) | enforestObjectBinding() {
    method enforestBindingProperty (line 28737) | enforestBindingProperty() {
    method enforestArrayBinding (line 28762) | enforestArrayBinding() {
    method enforestBindingElement (line 28798) | enforestBindingElement() {
    method enforestBindingIdentifier (line 28809) | enforestBindingIdentifier({ allowPunctuator } = {}) {
    method enforestPunctuator (line 28819) | enforestPunctuator() {
    method enforestIdentifier (line 28827) | enforestIdentifier() {
    method enforestReturnStatement (line 28835) | enforestReturnStatement() {
    method enforestVariableDeclaration (line 28858) | enforestVariableDeclaration() {
    method enforestVariableDeclarator (line 28899) | enforestVariableDeclarator({ isSyntax, isOperator }) {
    method enforestExpressionStatement (line 28936) | enforestExpressionStatement() {
    method enforestExpression (line 28949) | enforestExpression() {
    method enforestExpressionLoop (line 28970) | enforestExpressionLoop() {
    method enforestAssignmentExpression (line 29000) | enforestAssignmentExpression() {
    method enforestPrimaryExpression (line 29126) | enforestPrimaryExpression() {
    method enforestLeftHandSideExpression (line 29169) | enforestLeftHandSideExpression({ allowCall }) {
    method enforestBooleanLiteral (line 29218) | enforestBooleanLiteral() {
    method enforestTemplateLiteral (line 29224) | enforestTemplateLiteral() {
    method enforestStringLiteral (line 29231) | enforestStringLiteral() {
    method enforestNumericLiteral (line 29237) | enforestNumericLiteral() {
    method enforestIdentifierExpression (line 29247) | enforestIdentifierExpression() {
    method enforestRegularExpressionLiteral (line 29253) | enforestRegularExpressionLiteral() {
    method enforestNullLiteral (line 29265) | enforestNullLiteral() {
    method enforestThisExpression (line 29270) | enforestThisExpression() {
    method enforestArgumentList (line 29276) | enforestArgumentList() {
    method enforestNewExpression (line 29296) | enforestNewExpression() {
    method enforestComputedMemberExpression (line 29317) | enforestComputedMemberExpression() {
    method transformDestructuring (line 29325) | transformDestructuring(term) {
    method transformDestructuringWithDefault (line 29381) | transformDestructuringWithDefault(term) {
    method enforestCallExpression (line 29392) | enforestCallExpression() {
    method enforestArrowExpression (line 29400) | enforestArrowExpression() {
    method enforestYieldExpression (line 29423) | enforestYieldExpression() {
    method enforestSyntaxTemplate (line 29444) | enforestSyntaxTemplate() {
    method enforestStaticMemberExpression (line 29450) | enforestStaticMemberExpression() {
    method enforestArrayExpression (line 29461) | enforestArrayExpression() {
    method enforestObjectExpression (line 29498) | enforestObjectExpression() {
    method enforestPropertyDefinition (line 29528) | enforestPropertyDefinition() {
    method enforestMethodDefinition (line 29558) | enforestMethodDefinition() {
    method enforestPropertyName (line 29609) | enforestPropertyName() {
    method enforestFunction (line 29636) | enforestFunction({ isExpr, inDefault }) {
    method enforestFormalParameters (line 29674) | enforestFormalParameters() {
    method enforestParam (line 29693) | enforestParam() {
    method enforestUpdateExpression (line 29697) | enforestUpdateExpression() {
    method enforestUnaryExpression (line 29720) | enforestUnaryExpression() {
    method enforestConditionalExpression (line 29766) | enforestConditionalExpression() {
    method enforestBinaryExpression (line 29790) | enforestBinaryExpression() {
    method enforestTemplateElements (line 29840) | enforestTemplateElements() {
    method expandMacro (line 29854) | expandMacro() {
    method expandOperator (line 29893) | expandOperator(name, operatorTransform, args) {
    method consumeSemicolon (line 29917) | consumeSemicolon() {
    method consumeComma (line 29925) | consumeComma() {
    method safeCheck (line 29933) | safeCheck(obj, type, val = null) {
    method isTerm (line 29944) | isTerm(term) {
    method isEOF (line 29948) | isEOF(obj) {
    method isIdentifier (line 29952) | isIdentifier(obj, val = null) {
    method isPropertyName (line 29956) | isPropertyName(obj) {
    method isNumericLiteral (line 29960) | isNumericLiteral(obj, val = null) {
    method isStringLiteral (line 29964) | isStringLiteral(obj, val = null) {
    method isTemplate (line 29968) | isTemplate(obj, val = null) {
    method isSyntaxTemplate (line 29972) | isSyntaxTemplate(obj) {
    method isBooleanLiteral (line 29976) | isBooleanLiteral(obj, val = null) {
    method isNullLiteral (line 29980) | isNullLiteral(obj, val = null) {
    method isRegularExpression (line 29984) | isRegularExpression(obj, val = null) {
    method isDelimiter (line 29988) | isDelimiter(obj) {
    method isParens (line 29992) | isParens(obj) {
    method isBraces (line 29996) | isBraces(obj) {
    method isBrackets (line 30000) | isBrackets(obj) {
    method isAssign (line 30004) | isAssign(obj, val = null) {
    method isKeyword (line 30008) | isKeyword(obj, val = null) {
    method isPunctuator (line 30012) | isPunctuator(obj, val = null) {
    method isOperator (line 30016) | isOperator(obj) {
    method isCustomPrefixOperator (line 30020) | isCustomPrefixOperator(obj) {
    method isCustomPostfixOperator (line 30028) | isCustomPostfixOperator(obj) {
    method isCustomBinaryOperator (line 30036) | isCustomBinaryOperator(obj) {
    method isUpdateOperator (line 30044) | isUpdateOperator(obj) {
    method safeResolve (line 30048) | safeResolve(obj, phase) {
    method isTransform (line 30057) | isTransform(obj, trans) {
    method isTransformInstance (line 30061) | isTransformInstance(obj, trans) {
    method isFnDeclTransform (line 30065) | isFnDeclTransform(obj) {
    method isVarDeclTransform (line 30069) | isVarDeclTransform(obj) {
    method isLetDeclTransform (line 30073) | isLetDeclTransform(obj) {
    method isConstDeclTransform (line 30077) | isConstDeclTransform(obj) {
    method isSyntaxDeclTransform (line 30081) | isSyntaxDeclTransform(obj) {
    method isSyntaxrecDeclTransform (line 30085) | isSyntaxrecDeclTransform(obj) {
    method isReturnStmtTransform (line 30089) | isReturnStmtTransform(obj) {
    method isWhileTransform (line 30093) | isWhileTransform(obj) {
    method isForTransform (line 30097) | isForTransform(obj) {
    method isSwitchTransform (line 30101) | isSwitchTransform(obj) {
    method isBreakTransform (line 30105) | isBreakTransform(obj) {
    method isContinueTransform (line 30109) | isContinueTransform(obj) {
    method isDoTransform (line 30113) | isDoTransform(obj) {
    method isDebuggerTransform (line 30117) | isDebuggerTransform(obj) {
    method isWithTransform (line 30121) | isWithTransform(obj) {
    method isImportTransform (line 30125) | isImportTransform(obj) {
    method isExportTransform (line 30129) | isExportTransform(obj) {
    method isTryTransform (line 30133) | isTryTransform(obj) {
    method isThrowTransform (line 30137) | isThrowTransform(obj) {
    method isOperatorDeclTransform (line 30141) | isOperatorDeclTransform(obj) {
    method isIfTransform (line 30145) | isIfTransform(obj) {
    method isNewTransform (line 30149) | isNewTransform(obj) {
    method isSuperTransform (line 30153) | isSuperTransform(obj) {
    method isThisTransform (line 30157) | isThisTransform(obj) {
    method isClassTransform (line 30161) | isClassTransform(obj) {
    method isYieldTransform (line 30165) | isYieldTransform(obj) {
    method isDefaultTransform (line 30169) | isDefaultTransform(obj) {
    method isCompiletimeTransform (line 30173) | isCompiletimeTransform(obj) {
    method isModuleNamespaceTransform (line 30177) | isModuleNamespaceTransform(obj) {
    method isVarBindingTransform (line 30181) | isVarBindingTransform(obj) {
    method getFromCompiletimeEnvironment (line 30185) | getFromCompiletimeEnvironment(term) {
    method lineNumberEq (line 30192) | lineNumberEq(a, b) {
    method matchRawDelimiter (line 30199) | matchRawDelimiter() {
    method matchRawSyntax (line 30207) | matchRawSyntax() {
    method matchIdentifier (line 30215) | matchIdentifier(val) {
    method matchKeyword (line 30223) | matchKeyword(val) {
    method matchLiteral (line 30231) | matchLiteral() {
    method matchStringLiteral (line 30239) | matchStringLiteral() {
    method matchTemplate (line 30247) | matchTemplate() {
    method matchParens (line 30255) | matchParens() {
    method matchCurlies (line 30264) | matchCurlies() {
    method matchSquares (line 30273) | matchSquares() {
    method matchUnaryOperator (line 30282) | matchUnaryOperator() {
    method matchPunctuator (line 30290) | matchPunctuator(val) {
    method createError (line 30305) | createError(stx, message) {
  function _interopRequireWildcard (line 30344) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  method constructor (line 30348) | constructor(scopes, bindings) {
  method applyScopes (line 30354) | applyScopes(s) {
  method reduceBindingIdentifier (line 30362) | reduceBindingIdentifier(t, s) {
  method reduceIdentifierExpression (line 30368) | reduceIdentifierExpression(t, s) {
  method reduceRawSyntax (line 30374) | reduceRawSyntax(t, s) {
  function operatorLt (line 30468) | function operatorLt(left, right, assoc) {
  function getOperatorPrec (line 30476) | function getOperatorPrec(op) {
  function getOperatorAssoc (line 30479) | function getOperatorAssoc(op) {
  function isUnaryOperator (line 30483) | function isUnaryOperator(op) {
  function isOperator (line 30487) | function isOperator(op) {
  function _interopRequireDefault (line 30540) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function _interopRequireWildcard (line 30542) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function expandCompiletime (line 30544) | function expandCompiletime(term, context) {
  function sanitizeReplacementValues (line 30556) | function sanitizeReplacementValues(values) {
  function evalCompiletimeValue (line 30570) | function evalCompiletimeValue(expr, context) {
  function _interopRequireWildcard (line 30642) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function _interopRequireDefault (line 30644) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function getLineNumber (line 30700) | function getLineNumber(t) {
  function setLineNumber (line 30707) | function setLineNumber(t, lineNumber) {
  function cloneLineNumber (line 30723) | function cloneLineNumber(to, from) {
  function processTemplate (line 30757) | function processTemplate(temp, interp = (0, _immutable.List)()) {
  function replaceTemplate (line 30761) | function replaceTemplate(temp, rep) {
  function _interopRequireWildcard (line 30803) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function _interopRequireDefault (line 30805) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function wrapInTerms (line 30807) | function wrapInTerms(stx) {
  function cloneEnforester (line 30833) | function cloneEnforester(enf) {
  function Marker (line 30838) | function Marker() {}
  class MacroContext (line 30846) | class MacroContext {
    method constructor (line 30847) | constructor(enf, name, context, useScope, introducedScope) {
    method name (line 30871) | name() {
    method contextify (line 30876) | contextify(delim) {
    method expand (line 30886) | expand(type) {
    method _rest (line 30974) | _rest(enf) {
    method reset (line 30982) | reset(marker) {
    method mark (line 31001) | mark() {
    method next (line 31023) | next() {
  class ASTDispatcher (line 31059) | class ASTDispatcher {
    method constructor (line 31060) | constructor(prefix, errorIfMissing) {
    method dispatch (line 31065) | dispatch(term) {
  function _interopRequireDefault (line 31138) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function _interopRequireWildcard (line 31140) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  class RegisterBindingsReducer (line 31142) | class RegisterBindingsReducer extends S.default.CloneReducer {
    method constructor (line 31144) | constructor(useScope, phase, skipDup, bindings, env) {
    method reduceBindingIdentifier (line 31153) | reduceBindingIdentifier(t, s) {
  class RegisterSyntaxBindingsReducer (line 31168) | class RegisterSyntaxBindingsReducer extends S.default.CloneReducer {
    method constructor (line 31170) | constructor(useScope, phase, bindings, env, val) {
    method reduceBindingIdentifier (line 31179) | reduceBindingIdentifier(t, s) {
  class TokenExpander (line 31195) | class TokenExpander extends _astDispatcher2.default {
    method constructor (line 31196) | constructor(context) {
    method expand (line 31201) | expand(stxl) {
    method expandVariableDeclarationStatement (line 31216) | expandVariableDeclarationStatement(term) {
    method expandFunctionDeclaration (line 31222) | expandFunctionDeclaration(term) {
    method registerImport (line 31228) | registerImport(term) {
    method expandImport (line 31244) | expandImport(term) {
    method expandImportNamespace (line 31248) | expandImportNamespace(term) {
    method expandExport (line 31252) | expandExport(term) {
    method registerFunctionOrClass (line 31265) | registerFunctionOrClass(term) {
    method registerVariableDeclaration (line 31272) | registerVariableDeclaration(term) {
    method registerSyntaxDeclaration (line 31286) | registerSyntaxDeclaration(term) {
  function _interopRequireDefault (line 31387) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function _interopRequireWildcard (line 31389) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function bindImports (line 31391) | function bindImports(impTerm, exModule, phase, context) {
  method constructor (line 31432) | constructor(context) {
  method visit (line 31436) | visit(mod, phase, store) {
  method invoke (line 31456) | invoke(mod, phase, store) {
  method registerSyntaxDeclaration (line 31484) | registerSyntaxDeclaration(term, phase, store) {
  method registerVariableDeclaration (line 31507) | registerVariableDeclaration(term, phase, store) {
  method registerFunctionOrClass (line 31523) | registerFunctionOrClass(term, phase, store) {
  function _interopRequireDefault (line 31556) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  class CollectBindingSyntax (line 31558) | class CollectBindingSyntax extends _astDispatcher2.default {
    method constructor (line 31559) | constructor() {
    method collect (line 31577) | collect(term) {
    method collectBindingIdentifier (line 31581) | collectBindingIdentifier(term) {
    method collectBindingPropertyIdentifier (line 31585) | collectBindingPropertyIdentifier(term) {
    method collectBindingPropertyProperty (line 31589) | collectBindingPropertyProperty(term) {
    method collectArrayBinding (line 31593) | collectArrayBinding(term) {
    method collectObjectBinding (line 31601) | collectObjectBinding() {
  function collectBindings (line 31629) | function collectBindings(term) {
  class Store (line 31643) | class Store extends Map {
    method constructor (line 31644) | constructor(backingObject) {
    method set (line 31649) | set(key, val) {
    method getBackingObject (line 31654) | getBackingObject() {
  function Context (line 31707) | function Context() {}

FILE: docs/editor/scripts/syntax.js
  function assert (line 15) | function assert(condition, message) {
  function Rename (line 27) | function Rename(id, name, ctx, defctx) {
  function Mark (line 36) | function Mark(mark, ctx) {
  function Def (line 41) | function Def(defctx, ctx) {
  function Syntax (line 46) | function Syntax(token, oldstx) {
  function applyContext (line 92) | function applyContext(stxCtx, ctx) {
  function syntaxFromToken (line 129) | function syntaxFromToken(token, oldstx) {
  function mkSyntax (line 132) | function mkSyntax(stx, value, type, inner) {
  function makeValue (line 191) | function makeValue(val, stx) {
  function makeRegex (line 218) | function makeRegex(val, flags, stx) {
  function makeIdent (line 224) | function makeIdent(val, stx) {
  function makeKeyword (line 227) | function makeKeyword(val, stx) {
  function makePunc (line 230) | function makePunc(val, stx) {
  function makeDelim (line 233) | function makeDelim(val, inner, stx) {
  function unwrapSyntax (line 236) | function unwrapSyntax(stx) {
  function syntaxToTokens (line 252) | function syntaxToTokens(stx) {
  function tokensToSyntax (line 261) | function tokensToSyntax(tokens) {
  function joinSyntax (line 273) | function joinSyntax(tojoin, punc) {
  function joinSyntaxArray (line 286) | function joinSyntaxArray(tojoin, punc) {
  function cloneSyntaxArray (line 299) | function cloneSyntaxArray(arr) {
  function MacroSyntaxError (line 308) | function MacroSyntaxError(name, message, stx) {
  function throwSyntaxError (line 313) | function throwSyntaxError(name, message, stx) {
  function SyntaxCaseError (line 319) | function SyntaxCaseError(message) {
  function throwSyntaxCaseError (line 322) | function throwSyntaxCaseError(message) {
  function printSyntaxError (line 325) | function printSyntaxError(code, err) {
  function prettyPrint (line 346) | function prettyPrint(stxarr, shouldResolve) {
Condensed preview — 36 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,603K chars).
[
  {
    "path": ".gitignore",
    "chars": 399,
    "preview": "# Logs\nlogs\n*.log\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nl"
  },
  {
    "path": "CITATION.cff",
    "chars": 197,
    "preview": "cff-version: 1.2.0\nmessage: \"If you use this software, please cite it as below.\"\nauthors:\n  - family-names: Memon\n    gi"
  },
  {
    "path": "LICENSE.md",
    "chars": 1076,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2017 Asad Memon\n\nPermission is hereby granted, free of charge, to any person obtain"
  },
  {
    "path": "README.md",
    "chars": 1773,
    "preview": "# UrduScript\n\n![](docs/head.png?raw=true)\n\nUrduScript is an [Urdish](http://www.urbandictionary.com/define.php?term=Urdi"
  },
  {
    "path": "bin/urdujs.js",
    "chars": 1726,
    "preview": "#!/usr/bin/env node\n\nvar argv = require('yargs')\n  .usage('Usage: urdujs [options] file')\n  .boolean(\"t\")\n  .alias('t', "
  },
  {
    "path": "docs/README.md",
    "chars": 4321,
    "preview": "# UrduScript - Urdu Mein Programming \n![](head.png?raw=true&t=4)\nUrduScript ek programming language hai. Iska goal naye "
  },
  {
    "path": "docs/_config.yml",
    "chars": 205,
    "preview": "theme: jekyll-theme-minimal\ntitle: UrduScript\ndescription: JavaScript ka Urdish dialect.\n\ngems:\n  - jekyll-seo-tag\n\nlogo"
  },
  {
    "path": "docs/contribute.md",
    "chars": 706,
    "preview": "# Contributing\n\nThe goal of UrduScript is to make programming more accessible to beginners from South Asia. \n\nThere are "
  },
  {
    "path": "docs/editor/addon/edit/matchbrackets.js",
    "chars": 6058,
    "preview": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/L"
  },
  {
    "path": "docs/editor/css/base16-light.css",
    "chars": 3310,
    "preview": "/*\n\n    Name:       Base16 Default Light\n    Author:     Chris Kempson (http://chriskempson.com)\n\n    CodeMirror templat"
  },
  {
    "path": "docs/editor/css/codemirror.css",
    "chars": 8240,
    "preview": "/* BASICS */\n\n.CodeMirror {\n  /* Set height, width, borders, and global font properties here */\n  font-family: monospace"
  },
  {
    "path": "docs/editor/css/style.css",
    "chars": 2661,
    "preview": "body {\n  font-family: Droid Sans, Arial, sans-serif;\n  line-height: 1.5;\n  /*max-width: 64.3em;*/\n}\n.CodeMirror {\n  font"
  },
  {
    "path": "docs/editor/index.html",
    "chars": 2300,
    "preview": "<html>\n<head>\n  <meta charset=\"utf-8\">\n  <title>Play UrduScript</title>\n  <meta name=\"viewport\" content=\"width=device-wi"
  },
  {
    "path": "docs/editor/mode/javascript/index.html",
    "chars": 3317,
    "preview": "<!doctype html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <title>CodeMirror: JavaScript mode</title>\n    <link rel="
  },
  {
    "path": "docs/editor/mode/javascript/javascript.js",
    "chars": 31719,
    "preview": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/L"
  },
  {
    "path": "docs/editor/mode/javascript/typescript.html",
    "chars": 1209,
    "preview": "<!doctype html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <title>CodeMirror: TypeScript mode</title>\n    <link rel="
  },
  {
    "path": "docs/editor/mode/urduscript/urduscript.js",
    "chars": 32063,
    "preview": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/L"
  },
  {
    "path": "docs/editor/scripts/codemirror.js",
    "chars": 360530,
    "preview": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/L"
  },
  {
    "path": "docs/editor/scripts/codes.js",
    "chars": 1385,
    "preview": "var CODES = {\n//hello\n\"Hello\" : `/*\nNeche UrduScript likhen.\nCode chalane k liye Run pe click karen.\n*/\n\nlikho(\"Salam, D"
  },
  {
    "path": "docs/editor/scripts/editor.js",
    "chars": 5552,
    "preview": "function replaceAll(find, replace, str) {\n    function escapeRegExp(str) {\n        return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)"
  },
  {
    "path": "docs/editor/scripts/escodegen.js",
    "chars": 148838,
    "preview": "// Generated by CommonJS Everywhere 0.8.1\n(function (global) {\n  function require(file, parentModule) {\n    if ({}.hasOw"
  },
  {
    "path": "docs/editor/scripts/expander.js",
    "chars": 111305,
    "preview": "/*\n  Copyright (C) 2012 Tim Disney <tim@disnet.me>\n\n\n  Redistribution and use in source and binary forms, with or withou"
  },
  {
    "path": "docs/editor/scripts/jquery.js",
    "chars": 242142,
    "preview": "/*!\n * jQuery JavaScript Library v2.0.3\n * http://jquery.com/\n *\n * Includes Sizzle.js\n * http://sizzlejs.com/\n *\n * Cop"
  },
  {
    "path": "docs/editor/scripts/parser.js",
    "chars": 194559,
    "preview": "/*\n  Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>\n  Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>"
  },
  {
    "path": "docs/editor/scripts/patterns.js",
    "chars": 39697,
    "preview": "(function (root, factory) {\n    if (typeof exports === 'object') {\n        // CommonJS\n        factory(exports, require("
  },
  {
    "path": "docs/editor/scripts/require.js",
    "chars": 14423,
    "preview": "/*\n RequireJS 2.1.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.\n Available via the MIT or new BSD "
  },
  {
    "path": "docs/editor/scripts/scopedEval.js",
    "chars": 559,
    "preview": "// thou shalt not macro expand me...all kinds of hygiene hackary\n// with strings and `with`.\n\n\n(function (root, factory)"
  },
  {
    "path": "docs/editor/scripts/sweet.js",
    "chars": 2161021,
    "preview": "(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object"
  },
  {
    "path": "docs/editor/scripts/syntax.js",
    "chars": 16314,
    "preview": "(function (root, factory) {\n    if (typeof exports === 'object') {\n        // CommonJS\n        factory(exports, require("
  },
  {
    "path": "docs/editor/scripts/text.js",
    "chars": 15464,
    "preview": "/**\n * @license RequireJS text 2.0.10 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.\n * Available via"
  },
  {
    "path": "docs/editor/scripts/underscore.js",
    "chars": 40988,
    "preview": "//     Underscore.js 1.4.2\n//     http://underscorejs.org\n//     (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.\n//   "
  },
  {
    "path": "docs/editor/scripts/urdujs/keywords.js",
    "chars": 2063,
    "preview": "'lang sweet.js';\n\n// true\nexport syntax sach = function (ctx) {\n    return #`true`;\n}\n\n// false\nexport syntax galat = fu"
  },
  {
    "path": "docs/editor/scripts/urdujs/keywords.js.txt",
    "chars": 3166,
    "preview": "'lang sweet.js';\n\n// null\nexport syntax khali = ctx => #`null`\nexport syntax khaali = ctx => #`null`\n\n// true\nexport syn"
  },
  {
    "path": "hello.js",
    "chars": 850,
    "preview": "// URDU.js headers\nimport {\n  sach,\n  galat, \n  rakho, \n  agar,\n  jabtak,\n\tlikho,\n\tkaam,\n\thar,\n\tbhejo,\n\tkhali,\n\tpucho,\n\t"
  },
  {
    "path": "package.json",
    "chars": 609,
    "preview": "{\n  \"name\": \"urdu.js\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"bin\": {\n    \"urdujs\": \"bin/urdujs.js\"\n  },\n  \"scrip"
  },
  {
    "path": "src/keywords.js",
    "chars": 3163,
    "preview": "'lang sweet.js';\n\n// null\nexport syntax khali = ctx => #`null`\nexport syntax khaali = ctx => #`null`\n\n// true\nexport syn"
  }
]

About this extraction

This page contains the full source code of the asadm/urduscript GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 36 files (3.3 MB), approximately 867.6k tokens, and a symbol index with 2612 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!