Full Code of kovidgoyal/rapydscript-ng for AI

master a5618c62bbaf cached
108 files
2.0 MB
540.8k tokens
649 symbols
1 requests
Download .txt
Showing preview only (2,184K chars total). Download the full file or copy to clipboard to get everything.
Repository: kovidgoyal/rapydscript-ng
Branch: master
Commit: a5618c62bbaf
Files: 108
Total size: 2.0 MB

Directory structure:
gitextract_5ar8r793/

├── .agignore
├── .github/
│   └── workflows/
│       └── ci.yml
├── .gitignore
├── =template.pyj
├── CHANGELOG.md
├── CONTRIBUTORS
├── HACKING.md
├── LICENSE
├── README.md
├── add-toc-to-readme
├── bin/
│   ├── export
│   ├── rapydscript
│   └── web-repl-export
├── build
├── package.json
├── publish.py
├── release/
│   ├── baselib-plain-pretty.js
│   ├── baselib-plain-ugly.js
│   ├── compiler.js
│   └── signatures.json
├── session.vim
├── setup.cfg
├── src/
│   ├── ast.pyj
│   ├── baselib-builtins.pyj
│   ├── baselib-containers.pyj
│   ├── baselib-errors.pyj
│   ├── baselib-internal.pyj
│   ├── baselib-itertools.pyj
│   ├── baselib-str.pyj
│   ├── compiler.pyj
│   ├── errors.pyj
│   ├── lib/
│   │   ├── aes.pyj
│   │   ├── elementmaker.pyj
│   │   ├── encodings.pyj
│   │   ├── gettext.pyj
│   │   ├── math.pyj
│   │   ├── operator.pyj
│   │   ├── pythonize.pyj
│   │   ├── random.pyj
│   │   ├── re.pyj
│   │   ├── traceback.pyj
│   │   └── uuid.pyj
│   ├── output/
│   │   ├── __init__.pyj
│   │   ├── classes.pyj
│   │   ├── codegen.pyj
│   │   ├── comments.pyj
│   │   ├── exceptions.pyj
│   │   ├── functions.pyj
│   │   ├── literals.pyj
│   │   ├── loops.pyj
│   │   ├── modules.pyj
│   │   ├── operators.pyj
│   │   ├── statements.pyj
│   │   ├── stream.pyj
│   │   └── utils.pyj
│   ├── parse.pyj
│   ├── string_interpolation.pyj
│   ├── tokenizer.pyj
│   ├── unicode_aliases.pyj
│   └── utils.pyj
├── test/
│   ├── _import_one.pyj
│   ├── _import_two/
│   │   ├── __init__.pyj
│   │   ├── level2/
│   │   │   ├── __init__.pyj
│   │   │   └── deep.pyj
│   │   ├── other.pyj
│   │   └── sub.pyj
│   ├── aes_vectors.pyj
│   ├── annotations.pyj
│   ├── baselib.pyj
│   ├── classes.pyj
│   ├── collections.pyj
│   ├── decorators.pyj
│   ├── docstrings.pyj
│   ├── elementmaker_test.pyj
│   ├── functions.pyj
│   ├── generators.pyj
│   ├── generic.pyj
│   ├── imports.pyj
│   ├── internationalization.pyj
│   ├── lint.pyj
│   ├── loops.pyj
│   ├── regexp.pyj
│   ├── repl.pyj
│   ├── scoped_flags.pyj
│   ├── starargs.pyj
│   └── str.pyj
├── tools/
│   ├── cli.js
│   ├── compile.js
│   ├── compiler.js
│   ├── completer.js
│   ├── embedded_compiler.js
│   ├── export.js
│   ├── gettext.js
│   ├── ini.js
│   ├── lint.js
│   ├── msgfmt.js
│   ├── repl.js
│   ├── self.js
│   ├── test.js
│   ├── utils.js
│   └── web_repl.js
├── try
└── web-repl/
    ├── env.js
    ├── index.html
    ├── main.js
    ├── prism.css
    ├── prism.js
    └── sha1.js

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

================================================
FILE: .agignore
================================================
lib/*


================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
on: [push, pull_request]
env:
    CI: 'true'

jobs:
    test:
        name: Test on ${{ matrix.os }} LANG ${{ matrix.lang }}
        runs-on: ${{ matrix.os }}
        env:
          LANG: ${{ matrix.lang }}
          LC_ALL: ${{ matrix.lang }}
        strategy:
            matrix:
                include:
                    - { os: ubuntu-latest, lang: en_US.UTF-8 }
                    - { os: ubuntu-latest, lang: de_DE.UTF-8}
                    - { os: ubuntu-latest, lang: hi_IN.UTF-8 }

                    - { os: macos-latest, lang: en_US.UTF-8 }
                    - { os: windows-latest, lang: en_US.UTF-8 }

        steps:
            - name: Checkout source code
              uses: actions/checkout@master
              with:
                fetch-depth: 10

            - name: Set up Node ${{ matrix.node }}
              uses: actions/setup-node@master

            - name: Install deps
              run:
                npm install --no-optional

            - name: Test
              run:
                npm test


================================================
FILE: .gitignore
================================================
# use glob syntax
*~
*.swp
*.tmp
*.orig
*.pyj-cached
node_modules
dev
self.cpuprofile
package-lock.json


================================================
FILE: =template.pyj
================================================
# vim:fileencoding=utf-8
# License: BSD Copyright: %YEAR%, %USER% <%MAIL%>
from __python__ import hash_literals

%HERE%


================================================
FILE: CHANGELOG.md
================================================
version 0.7.23
=======================

  * Fix consecutive of f-strings without concatenation operator causing a syntax error
 
version 0.7.22
=======================

  * Fix assignment operators other than the plain = not working with overload_getitem
  * Fix dict.popitem() removing the first rather than the last item

version 0.7.21
=======================

  * class decorators are now called after the class prototype is populated
  * Fix len(range()) giving incorrect results
  * Add support for {var=} to format strings
  * Fix unary operators discarding parentheses
  * Add a __module__ property to function objects
  * Get isinstance working for int and float

version 0.7.20
========================

  * lint: Fix using a tuple for destructuring assignment not registering the defined symbols
  * Add head and body and base to elementmaker
  * Make the gettext tools available in the embedded compiler
  * re.pyj: Allow lookbehind assertions since they are supported in modern JS engines

version 0.7.19 
========================

  * Fix calling super-class methods in a method accepting `*args` not working
  * Fix list.pypop() removing the first instead of the last element
  * Fix exponentiation operator being used when js-version >= 6 rather than 7
  * Disallow assignments in while conditionals
  * Avoid unnecessary function annotations for functions that have empty signatures
  * Fix handing of "not in" operator when LHS is also a binary operator with higher precedence
  * Dont accept while statements without a trailing colon
  * msgfmt: fix parsing of escapes in msg strings
  * Fix missing enclosing brackets when translating an assert to an AssertionError
  * Fix comments at the bottom of the file not being output
  * Fix comments before first statement not being output for imported modules
  * Fix outputting top-level comments preventing output of baselib
  * Allow using NaN with the is operator
  * Fix anonymous function definitions inside class definitions hoisting their variables into the class prototype.
  * Fix gettext catalog generation when plurals are present
  * Fix int() not working correctly on floating point numbers which have exponential string representations.
  * Fix encoding of \u00ad
  * Fir repeated calls to random.seed() with the same seed not fully resetting the RNG.
  * Fix an error in handling chained binary operators involving comparison operators and an equality operator.
  * Ensure repr() of set is always correct

version 0.7.18
==================

  * Support the else: clause for try: statements
  * Use the JS ** operator instead of Math.pow() when --js-version > 5
  * Detect syntax errors of the form atomic token followed by atomic token
  * Fix ** operator not working with parenthesized unary expressions
  * Handle changed output from newer version of regenerator
  * Detect missing indentation for blocks as a syntax error
  * Linter: recognize pow() as a global function

version 0.7.17
==================

  * Fix attempts to access calss variables from inside instance methods not
    working
  * Fix stdlib random.random() method not working in the Edge browser

version 0.7.16
==================

  * Fix using function generators not working if installed version of uglify-js >= 3
  * Speedup the compiler slightly by making reading options more efficient

version 0.7.15
==================

  * Fix , flag for str.format thousands grouping not working
  * Fix iteration over TouchList not working in Safari
  * Fix }} escapes not being converted to } in f-strings

version 0.7.14
==================

  * Fix }} escapes not being processed correctly in format strings
  * Fix function definitions inside loops causing errors on ancient JS engines
  * Fix --js-version command line argument not working

version 0.7.13
==================

  * A uuid module for the standard library
  * Implement the full python interface for the min() and max() functions
  * Implement the full python interface for rangeobjects
  * Implement the divmod function from python

version 0.7.12
==================

  * Fix == failing when one of the arguments is None and the other is an object
  * Make the range() function return an object that behaves like the python range() object
  * Fix de-structuring assignment not working with iterators

version 0.7.11
==================

* Fix slice assignment not working
* Implement the global keyword
* Make list.pysort a stable sort on all JS engines
* Fix a typo that broke the REPL when XDG_CACHE_HOME is an absolute path

version 0.7.10
==================

* Fix passing of keyword args to the dict() function not working
* Improve the string representation of dicts and HTMLElements

version 0.7.9
==============

* BACWARDS INCOMPATIBLE: Make the `type()` function behave more like python's
  `type()` function. It now return the class of the passed in argument, instead
  of a string type name. For existing code that use `type()`, replace `type()` by
  `jstype()`

* Fix multiple newlines not being properly escaped in interpolated string literals

version 0.7.8
==============

* Fix --cache-dir option defaulting to current working directory instead of being disabled
* Fix display of option names containing more than a single hyphen
* Fix including backslashes and/or newlines in interpolated string literals
* Fix spurious error message from linter when using interpolated string literals

version 0.7.7
==============

* Implement literal string interpolation (PEP 498)
* Fix incorrect method binding when using the `bound_methods` scoped flag and calling the super-class `__init__()` method
* elementmaker: Ignore kwargs that have types other than bool, string or func
* gettext: Allow registering callbacks for notification when new translation data is installed
* Fix a rare crash in the linter

version 0.7.6
==============

* Fix nested imports beyond two levels not working
* Fix iteration over NodeList/HTMLCollection not working with ES 6 output in Edge and Chrome < 51
* Add WebSocket to the list of known global class names

version 0.7.5
==============

* Add an option to have the compiler generate all its cache files in a central
  directory. Use --cache-dir if you dislike having the `*.pyj-cached` files spread
  throughout your source code

version 0.7.4
==============

* Fix piping data into rapydscript for compilation not working

version 0.7.3
==============

* Fix extra-semicolon after chain assignment, and also avoid using a temp
  variable for non-destructuring chain assignments

* Fix a bug in the compiler cache system that could cause the compiler to
  output incorrect code when re-compiling a previously cached module that was
  imported from more than one other module.

* Add the builtin `pow()` function from python

* Workaround for a bug in the latest release of Chrome that broke the web REPL
  and embedded compiler.

version 0.7.2
==============

* Fix multiline string literals not working in some contexts, such as after
  return or yield keywords

* Add a scoped flag `hash_literals` to control whether `{}` literals generate
  JavaScript arrays or JavaScript hashes. Note that the `dict_literals` scoped
  flag takes precedence over this flag.

* Add a builtin function `get_module()` to get a reference to the module dicts
  for a previously imported module.

* Nicer error messages when web-repl-export is not called correctly

version 0.7.1
==============

* Make importing of non-aliased submodules `import module.submodule` work just
  like in python (the submodule name is bound into the parent namespace at
  the import statement rather than at import time)

* Fix referring to class variables not working. Now there is no need to use 
  `A.prototype.x` one can just do `A.x` and the compiler will handle it automatically,
  provided it knows that A is a class.

* Fix a regression in 0.6.0 that broke using @staticmethod for methods that accept arguments

version 0.7.0
==============

New features
-------------

 * Implement the existential operator, see the README for details.
 * Add the any() and all() builtin functions from python
 * Drop support for the JavaScript form of the conditional ternary operator
   (backwards incompatible). This was done mainly to free up the `?` operator for use
   as the existential operator.
 * Add a traceback module to the standard library that works like the python
   one 
 * Full support for negative indices on lists: `a=-1; b[a] is b[-1]`

Bug fixes
------------
 * Fix local variables in except: blocks not being declared
 * Make defining custom exception classes work just as in python (just subclass
   Exception and you are done)
 * Make the default `__repr__()` method use the base class implementation when available
 * Fix the del operator: Now your can use it to delete slices of arrays,
   variable names, etc.
 * Make the use of javascript reserved words as identifiers a compile time error, instead of a runtime error
 * Fix optimization of range() causing incorrect behavior when the stop expression is dynamic

version 0.6.4
==============

 * Support for docstrings in modules, classes and functions, just like python.
   By default the docstrings are discarded (except in the REPL). There is a
   compiler option to keep the docstrings as the `__doc__` attribute in the
   output JavaScript.

 * Add hexlify()/unhexlify() to the encodings stdlib module

 * Object literals now produce JavaScript objects that have no prototype. This
   makes them more like python dicts, in that there is no need to use
   Object.keys() and Object.hasOwnProperty() to iterate/test their keys.

version 0.6.3
==============

 * Add a module to the standard library to easily add python string methods to the JavaScript String object, if needed.
 * Fix isinstance('a', str) not working
 * Prevent an infinite loop in str.count() when needle is an empty string
 * Fix default values for function args not working when combined with annotations
 * Change the prefix used internally for RapydScript private symbols from `_$rapyd$_` to `ρσ_` as it makes the output JavaScript easier to read

version 0.6.2
==============

 * Support multiple inheritance, just as in python
 * Support method auto-binding for classes, just as in python, via an optional scoped flag. See the Method binding section in the README for details

version 0.6.1
==============

Bug fix release, fixing a couple of regressions in 0.6.0

 * Fix a regression caused by the new kwargs code that caused incorrect construction of classes when called with kwargs
 * Fix a regression when calling super class methods with kwargs

version 0.6.0
==============

New features
--------------------

 * Support for function type annotations, just like in Python 3. You can now
   create optional type annotation in RapydScript, exactly as you would in
   Python 3.

 * Support for *scoped flags* -- a mechanism to change the behavior of the
   compiler in sections of code using simple statements in the code. These work
   like compiler pragmas in C/C++ but have the additional feature that they are
   local to a scope -- i.e. they are automatically reset when leaving the scope
   they are defined in, which could be a function or a module or even a class.

 * Support for python style dicts using the exact same syntax as in python. The
   default syntax still creates JavaScript objects, but you can switch to
   python dicts using a scoped flag:
   ```py
   from __python__ import dict_literals, overload_getitem
   ```
   This will cause the default syntax to generate python dicts.

 * Add an **encodings.pyj** module to the stdlib which is very useful to convert
   between utf-8 bytearrays, base64 encoded strings, and native strings.

 * Implement repeating of string literals with the * operator
   `'a' * 3 == 'aaa'`


Bugfixes
----------

 * Enable use of keyword arguments/values when calling all functions, even if
   they have not been defined with keyword arguments.

 * Fix use of `*args/**kw` when calling functions that are the result of a
   complex expression, causing the expression to be evaluated twice.
 
 * Fix negative const index on expression containing a function call causing
   the function call to be executed twice

 * Fix --import-dirs not being used when recursively processing imports

version 0.5.2
==============

 * New module in stdlib: **aes.pyj** that implements the symmetric encryption
   ciphers: AES-GCM, AES-CBC, AES-CTR

 * Improved support for TypedArrays -- you can now iterate over them just like
   normal arrays and also repr() wors for them.

 * elementmaker.pyj: Allow setting HTML 5 boolean attributes using True/False.
   Fix E.iframe() not working.

 * Make the equality operators also work with javascript dicts (when
   javascript objects are used as dicts)


version 0.5.1
==============

Fix a bug that caused the equality operators to not work for lists. Also,
fix the new equality operators causing their arguments to be evaluated twice
when the arguments are expressions, such as function calls, generators, object
literals, etc.

version 0.5.0
==============

Below are listed all the major new features and backwards incompatible changes
since the creation of the rapydscript-ng fork, up to version 0.5.0

Backwards incompatible changes:
--------------------------------------------------------------

* A new module/import system that works just like python's, with modules in
  ``.pyj`` files and packages in directories with an ``__init__.pyj`` file.

* The equality operators now work with all container types (list/set/dict) as
  well as user defined classes that implement the `__eq__()` method, just as in
  python. 

* Remove the `to` and `til` operators

* Change syntax for embedded JavaScript literals. Now one uses a normal string
  literal, with the **v** prefix, for example:
  ```py
  for v'i = 0; i < 10; i++':
    pass
  ```
  The old compile time magic function `JS()` used for JavaScript literals has been removed.

* String literals now behave exactly like python. You can use raw string
  literal, escapes for unicode such as `\u2122` or `\N{...}` etc.

* Dict literals now do not treat identifiers as strings, so you can use arbitrary expressions as keys.

* Remove the ``@kwargs`` decorator. Keyword arguments now work seamlessly, just
  as in python.

Major new features:
--------------------

* There is now an in browser REPL (Read-Eval-Print-Loop) for RapydScript,
  available at: https://sw.kovidgoyal.net/rapydscript/repl/

* There is now a linter that performs pyflakes style of undefined/unused
  checks.

* Instructions for easily embedding the RapydScript compiler in a webapp are
  now in the README.

* A new stdlib module: **elementmaker.pyj** that allows for easy creation of
  DOM trees within RapydScript code. For example:
  ```py
  from elementmaker import E
  E.div(class_='mydiv', title='A tooltip', data_special='xxx',
	E.a(href='javascript: void(0)', onclick=def():
		# handle the click event
	),
	'Some text'
  )
  ```

* All the python string functions are now available, including `format()`. However, for reasons of
  compatibility with external javascript code, they are not implemented as
  methods on string objects, instead, use the global ```str``` object, for
  example:
  ```py
  str.format('{:02d} {}', 1, "wow") == '01 wow'
  ```
  There is a convenience module in the stdlib to add these functions to the
  JavaScript String object, if needed.

* Support dict and set comprehensions

* Support the python conditional operator syntax: ```a if b else c```

New features
-------------------------

* Implement `str()` and `repr()` functions that work well for JavaScript arrays and
  Objects as well as your own custom classes that define the `__repr__()` and
  `__str__()` methods

* A builtin `sorted()` function that behaves like python's

* A builtin `id()` function that behaves like python's (only for objects
  defined in RapydScript)

* Support for dynamic properties just as in python with the `@property` decorator

* Allow trailing commas in function calls and function definitions

* Allow specifying multiple locations to search for modules to import

* Allow iteration `(for x in ...)` to work for DOM based array like containers
  such as `NodeList` and `NamedNodeMap` even when they come from a different frame.

* Support for internationalization, works just like in python (see README for
  details).

* Linter: Allow suppressing errors at file level as well

* Automatic concantenation of neighboring string literals: '1' '2' == '12'

* Support for arbitrary expressions as decorators

* Support for generator comprehensions

* The stdlib's `re.pyj` module has been greatly enhanced. It's functionality is
  now much closer to python's re module.

* Added support for the with statement (context managers)

* Support for binary number literals

* A builtin set type and set literals

* Support recursive destructuring in assignments and for loop expressions.

* Add a new ES 6 output mode that emits faster code for ES 6 compatible
  runtimes


In addition there have been hundreds of bug fixes.


================================================
FILE: CONTRIBUTORS
================================================
This project is officially supported by Kovid Goyal.

Main Developers
---------------
Kovid Goyal

Other Contributors
------------------
Alexander Tsepkov (main developer of the original RapydScript)
Charles Law
Tobias Weber
Salvatore Di Dio
Tuomas Laakkonen


================================================
FILE: HACKING.md
================================================
Hacking the RapydScript compiler
=================================

The RapydScript compiler is written in RapydScript itself and uses the
RapydScript import system to modularize its code. The compiler source code is
in the `src` directory. The compiled compiler is by default in the `release`
directory. 

In order to start hacking on the compiler, run the command

```
bin/rapydscript self --complete --test
```

This will generate a build of the compiler in the `dev` directory. Now, the
rapydscript command will automatically use this build, rather than the one in
release. If you want to go back to the release build, simply delete the `dev`
directory.


Code organization
-------------------

The way the compiler works, given some RapydScript source code:

* The source code is lexed into a stream of tokens (`src/tokenzier.pyj`)

* The tokens are parsed into a Abstract Syntax Tree (`src/parse.pyj and src/ast.pyj`)

* During parsing any import statement are resolved (this is different from
  python, where imports happen at run-time, not compile time).

* The Abstract Syntax Tree is transformed into the output JavaScript (`src/output/*.pyj`)

* Various bits of functionality in RapydScript depend upon the *Base Library*
  (`src/baselib*.pyj`). This includes things like the basic container types
  (list/set/dict) string functions such as `str.format()`, etc. The baselib
  is automatically inserted into the start of the output JavaScript.

The RapydScript standard library can be found in `src/lib`. The various tools,
such as the linter, gettext support, the REPL, etc. are in the `tools`
directory.

Tests
--------

The tests are in the test directory and can be run using the command:
```
rapydscript test
```

You can run individual test files by providing the name of the file, as

```
rapydscript test classes
```

Modifying the compiler
-------------------------

Edit the files in the `src` directory to make your changes, then use the
`./try` script to test them.  This script will compile an updated version of
the compiler with your changes, if any, and use it to run the snippet of code
you pass to it.

For example:

```
./try 'print("Hello world")'
```

will compile `print ("Hello world")` and show you the output on stdout. You can
tell it to omit the baselib, so you can focus on the output, with the `-m`
switch, like this:

```
./try -m 'print("Hello world")'
```

You can also have it not print out the JavaScript, instead directly executing the output
JavaScript with the `-x` switch, like this

```
./try -x 'print("Hello world")'
```

If you want to test longer sections of code, you can use the `-f` switch to
pass in the path to a RapydScript file to compile, like this:

```
./try -f myfile.pyj
```

Once you are happy with your changes, you can build the compiler and run the
test suite, all with a single command:

```
./build
```

This will build the compiler with the updated version of itself and then run
the test suite. If all test pass you can commit your changes and send a pull
request :)


================================================
FILE: LICENSE
================================================
Copyright (c) 2015-, Kovid Goyal <kovid@kovidgoyal.net>
Copyright (c) 2013-2014, Alexander Tsepkov <atsepkov@pyjeon.com>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


================================================
FILE: README.md
================================================
RapydScript
===========


[![Build Status](https://github.com/ebook-utils/kovidgoyal/rapydscript-ng/CI/badge.svg)](https://github.com/kovidgoyal/rapydscript-ng/actions?query=workflow%3ACI)
[![Downloads](https://img.shields.io/npm/dm/rapydscript-ng.svg)](https://www.npmjs.com/package/rapydscript-ng)
[![Current Release](https://img.shields.io/npm/v/rapydscript-ng.svg)](https://www.npmjs.com/package/rapydscript-ng)
[![Known Vulnerabilities](https://snyk.io/test/github/kovidgoyal/rapydscript-ng/badge.svg)](https://snyk.io/test/github/kovidgoyal/rapydscript-ng)

This is a fork of the original RapydScript that adds many new (not always
backwards compatible) features. For more on the forking, [see the bottom of this file](#reasons-for-the-fork)

[Try RapydScript-ng live via an in-browser REPL!](https://sw.kovidgoyal.net/rapydscript/repl/)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Contents**

- [What is RapydScript?](#what-is-rapydscript)
- [Installation](#installation)
- [Compilation](#compilation)
- [Getting Started](#getting-started)
- [Leveraging other APIs](#leveraging-other-apis)
- [Anonymous Functions](#anonymous-functions)
- [Decorators](#decorators)
- [Self-Executing Functions](#self-executing-functions)
- [Chaining Blocks](#chaining-blocks)
- [Function calling with optional arguments](#function-calling-with-optional-arguments)
- [Inferred Tuple Packing/Unpacking](#inferred-tuple-packingunpacking)
- [Operators and keywords](#operators-and-keywords)
- [Literal JavaScript](#literal-javascript)
- [Containers (lists/sets/dicts)](#containers-listssetsdicts)
  - [Container comparisons](#container-comparisons)
- [Loops](#loops)
- [List/Set/Dict Comprehensions](#listsetdict-comprehensions)
- [Strings](#strings)
- [The Existential Operator](#the-existential-operator)
- [Regular Expressions](#regular-expressions)
- [Creating DOM trees easily](#creating-dom-trees-easily)
- [Classes](#classes)
  - [External Classes](#external-classes)
  - [Method Binding](#method-binding)
- [Iterators](#iterators)
- [Generators](#generators)
- [Modules](#modules)
- [Exception Handling](#exception-handling)
- [Scope Control](#scope-control)
- [Available Libraries](#available-libraries)
- [Linter](#linter)
- [Making RapydScript even more pythonic](#making-rapydscript-even-more-pythonic)
- [Advanced Usage Topics](#advanced-usage-topics)
    - [Browser Compatibility](#browser-compatibility)
    - [Tabs vs Spaces](#tabs-vs-spaces)
    - [External Libraries and Classes](#external-libraries-and-classes)
    - [Embedding the RapydScript compiler in your webpage](#embedding-the-rapydscript-compiler-in-your-webpage)
- [Internationalization](#internationalization)
- [Gotchas](#gotchas)
- [Reasons for the fork](#reasons-for-the-fork)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->


What is RapydScript?
--------------------

RapydScript (pronounced 'RapidScript') is a pre-compiler for JavaScript,
similar to CoffeeScript, but with cleaner, more readable syntax. The syntax is
almost identical to Python, but RapydScript has a focus on performance and
interoperability with external JavaScript libraries. This means that the
JavaScript that RapydScript generates is performant and quite close to hand
written JavaScript.

RapydScript allows to write your front-end in Python without the overhead that
other similar frameworks introduce (the performance is the same as with pure
JavaScript). To those familiar with CoffeeScript, RapydScript is like
CoffeeScript, but inspired by Python's readability rather than Ruby's
cleverness. To those familiar with Pyjamas, RapydScript brings many of the same
features and support for Python syntax without the same overhead. Don't worry
if you've never used either of the above-mentioned compilers, if you've ever
had to write your code in pure JavaScript you'll appreciate RapydScript.
RapydScript combines the best features of Python as well as JavaScript,
bringing you features most other Pythonic JavaScript replacements overlook.
Here are a few features of RapydScript:

- classes that work and feel similar to Python
- an import system for modules/packages that works just like Python's
- optional function arguments that work similar to Python
- inheritance system that's both, more powerful than Python and cleaner than JavaScript
- support for object literals with anonymous functions, like in JavaScript
- ability to invoke any JavaScript/DOM object/function/method as if it's part of the same framework, without the need for special syntax
- variable and object scoping that make sense (no need for repetitive 'var' or 'new' keywords)
- ability to use both, Python's methods/functions and JavaScript's alternatives
- similar to above, ability to use both, Python's and JavaScript's tutorials (as well as widgets)
- it's self-hosting, that means the compiler is itself written in RapydScript and compiles into JavaScript

Let's not waste any more time with the introductions, however. The best way to
learn a new language/framework is to dive in.


Installation
------------

[Try RapydScript-ng live via an in-browser REPL!](https://sw.kovidgoyal.net/rapydscript/repl/)

First make sure you have installed the latest version of [node.js](https://nodejs.org/) (You may need to restart your computer after this step). 

From NPM for use as a command line app:

	npm install rapydscript-ng -g

From NPM for use in your own node project:

	npm install rapydscript-ng

From Git:

	git clone https://github.com/kovidgoyal/rapydscript-ng.git
	cd rapydscript-ng
	sudo npm link .
	npm install  # This will automatically install the dependencies for RapydScript

If you're using OSX, you can probably use the same commands (let me know if
that's not the case). If you're using Windows, you should be able to follow
similar commands after installing node.js, npm and git on your system.


Compilation
-----------
Once you have installed RapydScript, compiling your application is as simple as
running the following command:

	rapydscript [options] <location of main file>

By default this will dump the output to STDOUT, but you can specify the output
file using `--output` option. The generated file can then be referenced in your
html page the same way as you would with a typical JavaScript file. If you're
only using RapydScript for classes and functions, then you're all set. For more
help, use ```rapydscript -h```.

Getting Started
---------------

RapydScript comes with its own Read-Eval-Print-Loop (REPL). Just run
``rapydscript`` without any arguments to get started trying out the code
snippets below.

Like JavaScript, RapydScript can be used to create anything from a quick
function to a complex web-app. RapydScript can access anything regular
JavaScript can, in the same manner. Let's say we want to write a function that
greets us with a "Hello World" pop-up. The following code will do it:

```python
def greet():
	alert("Hello World!")
```

Once compiled, the above code will turn into the following JavaScript:

```javascript
function greet() {
	alert("Hello World!");
}
```

Now you can reference this function from other JavaScript or the page itself
(using "onclick", for example). For our next example, let's say you want a
function that computes factorial of a number:

```python
def factorial(n):
	if n == 0:
		return 1
	return n * factorial(n-1)
```

Now all we need is to tie it into our page so that it's interactive. Let's add an input field to the page body and a cell for displaying the factorial of the number in the input once the input loses focus.

```html
	<input id="user-input" onblur="computeFactorial()"></input>
	<div id="result"></div>
```

**NOTE:** To complement RapydScript, I have also written RapydML (<https://bitbucket.org/pyjeon/rapydml>), which is a pre-compiler for HTML (just like RapydScript is a pre-compiler for JavaScript). 

Now let's implement computeFactorial() function in RapydScript:

```python
def computeFactorial():
	n = document.getElementById("user-input").value
	document.getElementById("result").innerHTML = factorial(n)
```

Again, notice that we have access to everything JavaScript has access to, including direct DOM manipulation. Once compiled, this function will look like this:

```javascript
function computeFactorial() {
	var n;
	n = document.getElementById("user-input").value;
	document.getElementById("result").innerHTML = factorial(n);
}
```

Notice that RapydScript automatically declares variables in local scope when
you try to assign to them. This not only makes your code shorter, but saves you
from making common JavaScript mistake of overwriting a global. For more
information on controlling variable scope, see `Scope Control` section.


Leveraging other APIs
---------------------

Aside from Python-like stdlib, RapydScript does not have any of its own APIs.
Nor does it need to, there are already good options available that we can
leverage instead. If we wanted, for example, to rewrite the above factorial
logic using jQuery, we could easily do so:

```python
def computeFactorial():
	n = $("#user-input").val()
	$("#result").text(factorial(n))
```

Many of these external APIs, however, take object literals as input. Like with
JavaScript, you can easily create those with RapydScript, the same way you
would create a dictionary in Python:

```javascript
styles = {
	'background-color':	'#ffe',
	'border-left':		'5px solid #ccc',
	'width':			50,
}
```

Now you can pass it to jQuery:

```python
$('#element').css(styles)
```

Another feature of RapydScript is ability to have functions as part of your
object literal. JavaScript APIs often take callback/handler functions as part
of their input parameters, and RapydScript lets you create such object literal
without any quirks/hacks:

```js
params = {
	'width':	50,
	'height':	30,
	'onclick':	def(event):
		alert("you clicked me"),
	'onmouseover':	def(event):
		$(this).css('background', 'red')
	,
	'onmouseout':	def(event):
		# reset the background
		$(this).css('background', '')
}
```

Note the comma on a new line following a function declaration, it needs to be
there to let the compiler know there are more attributes in this object
literal, yet it can't go on the same line as the function since it would get
parsed as part of the function block. Like Python, however, RapydScript
supports new-line shorthand using a `;`, which you could use to place the comma
on the same line:

```js
hash = {
	'foo':	def():
		print('foo');,
	'bar':	def():
		print('bar')
}
```

It is because of easy integration with JavaScript's native libraries that RapydScript keeps its own libraries to a minimum. 

Anonymous Functions
-------------------

Like JavaScript, RapydScript allows the use of anonymous functions. In fact,
you've already seen the use of anonymous functions in previous section when
creating an object literal ('onmouseover' and 'onmouseout' assignments). This
is similar to Python's lambda function, except that the syntax isn't awkward
like lambda, and the function isn't limited to one line. The following two
function declarations are equivalent:

```js
def factorial(n):
	if n == 0:
		return 1
	return n * factorial(n-1)

factorial = def(n):
	if n == 0:
		return 1
	return n * factorial(n-1)
```

This might not seem like much at first, but if you're familiar with JavaScript,
you know that this can be extremely useful to the programmer, especially when
dealing with nested functions, which are a bit syntactically awkward in Python
(it's not immediately obvious that those can be copied and assigned to other
objects). To illustrate the usefulness, let's create a method that creates and
returns an element that changes color while the user keeps the mouse pressed on
it.

```js
def makeDivThatTurnsGreen():
	div = $('<div></div>')
	turnGreen = def(event):
		div.css('background', 'green')
	div.mousedown(turnGreen)
	resetColor = def(event):
		div.css('background', '')
	div.mouseup(resetColor)
	return div
```

At first glance, anonymous functions might not seem that useful. We could have
easily created nested functions and assigned them instead. By using anonymous
functions, however, we can quickly identify that these functions will be bound
to a different object. They belong to the div, not the main function that
created them, nor the logic that invoked it. The best use case for these is
creating an element inside another function/object without getting confused
which object the function belongs to.

Additionally, as you already noticed in the previous section, anonymous
functions can be used to avoid creating excessive temporary variables and make
your code cleaner:

```js
math_ops = {
	'add':	def(a, b): return a+b;,
	'sub':	def(a, b): return a-b;,
	'mul':	def(a, b): return a*b;,
	'div':	def(a, b): return a/b;,
	'roots':	def(a, b, c):
		r = Math.sqrt(b*b - 4*a*c)
		d = 2*a
		return (-b + r)/d, (-b - r)/d
}
```

I'm sure you will agree that the above code is cleaner than declaring 5
temporary variables first and assigning them to the object literal keys after.
Note that the example puts the function header (def()) and content on the same
line. I'll refer to it as function inlining. This is meant as a feature of
RapydScript to make the code cleaner in cases like the example above. While you
can use it in longer functions by chaining statements together using `;`, a
good rule of thumb (to keep your code clean) is if your function needs
semi-colons ask yourself whether you should be inlining, and if it needs more
than 2 semi-colons, the answer is probably no (note that you can also use
semi-colons as newline separators within functions that aren't inlined, as in
the example in the previous section).


Decorators
----------
Like Python, RapydScript supports decorators. 

```py
def makebold(fn):
	def wrapped():
		return "<b>" + fn() + "</b>"
	return wrapped

def makeitalic(fn):
	def wrapped():
		return "<i>" + fn() + "</i>"
	return wrapped

@makebold
@makeitalic
def hello():
	return "hello world"

hello() # returns "<b><i>hello world</i></b>"
```

Class decorators are also supported with the caveat that the class properties
must be accessed via the prototype property. For example:

```py

def add_x(cls):
	cls.prototype.x = 1

@add_x
class A:
   pass

print(A.x)  # will print 1
```


Self-Executing Functions
------------------------
RapydScript wouldn't be useful if it required work-arounds for things that
JavaScript handled easily. If you've worked with JavaScript or jQuery before,
you've probably seen the following syntax:

```js
(function(args){
	// some logic here
})(args)
```

This code calls the function immediately after declaring it instead of
assigning it to a variable. Python doesn't have any way of doing this. The
closest work-around is this:

```py
def tmp(args):
	# some logic here
tmp.__call__(args)
```

While it's not horrible, it did litter our namespace with a temporary variable.
If we have to do this repeatedly, this pattern does get annoying. This is where
RapydScript decided to be a little unorthodox and implement the JavaScript-like
solution:

```js
(def(args):
	# some logic here
)()
```

A close cousin of the above is the following code (passing current scope to the function being called):

```js
function(){
	// some logic here
}.call(this);
```

With RapydScript equivalent of:

```js
def():
	# some logic here
.call(this)
```

There is also a third alternative, that will pass the arguments as an array:

```js
def(a, b):
	# some logic here
.apply(this, [a, b])
```


Chaining Blocks
---------------
As seen in previous section, RapydScript will bind any lines beginning with `.` to the outside of the block with the matching indentation. This logic isn't limited to the `.call()` method, you can use it with `.apply()` or any other method/property the function has assigned to it. This can be used for jQuery as well:

```js
$(element)
.css('background-color', 'red')
.show()
```

The only limitation is that the indentation has to match, if you prefer to indent your chained calls, you can still do so by using the `\` delimiter:

```js
$(element)\
	.css('background-color', 'red')\
	.show()
```

Some of you might welcome this feature, some of you might not. RapydScript always aims to make its unique features unobtrusive to regular Python, which means that you don't have to use them if you disagree with them. Recently, we have enhanced this feature to handle `do/while` loops as well:

```js
a = 0
do:
	print(a)
	a += 1
.while a < 1
```

Function calling with optional arguments
-------------------------------------------

RapydScript supports the same function calling format as Python. You can have
named optional arguments, create functions with variable numbers of arguments
and variable numbers of named arguments. Some examples will illustrate this
best:

```py
	def f1(a, b=2):
	   return [a, b]

	f1(1, 3) == f1(1, b=3) == [1, 3]

	def f2(a, *args):
		return [a, args]

	f2(1, 2, 3) == [1, [2, 3]]

	def f3(a, b=2, **kwargs):
	    return [a, b, kwargs]

	f3(1, b=3, c=4) == [1, 3, {c:4}]

	def f4(*args, **kwargs):
		return [args, kwargs]

	f4(1, 2, 3, a=1, b=2):
		return [[1, 2, 3], {a:1, b:2}]
```

One difference between RapydScript and Python is that RapydScript is not as
strict as Python when it comes to validating function arguments. This is both
for performance and to make it easier to interoperate with other JavaScript
libraries. So if you do not pass enough arguments when calling a function, the
extra arguments will be set to undefined instead of raising a TypeError, as in
Python. Similarly, when mixing ``*args`` and optional arguments, RapydScript
will not complain if an optional argument is specified twice.

When creating callbacks to pass to other JavaScript libraries, it is often the
case that the external library expects a function that receives an *options
object* as its last argument. There is a convenient decorator in the standard
library that makes this easy:

```py
@options_object
def callback(a, b, opt1=default1, opt2=default2):
	console.log(opt1, opt2)

callback(1, 2, {'opt1':'x', 'opt2':'y'})  # will print x, y
```

Now when you pass callback into the external library and it is called with an
object containing options, they will be automatically converted by RapydScript
into the names optional parameters you specified in the function definition.


Inferred Tuple Packing/Unpacking
--------------------------------
Like Python, RapydScript allows inferred tuple packing/unpacking and assignment. While inferred/implicit logic is usually bad, it can sometimes make the code cleaner, and based on the order of statements in the Zen of Python, 'beautiful' takes priority over 'explicit'. For example, if you wanted to swap two variables, the following looks cleaner than explicitly declaring a temporary variable:

```py
a, b = b, a
```

Likewise, if a function returns multiple variables, it's cleaner to say:

```py
a, b, c = fun()
```

rather than:

```py
tmp = fun()
a = tmp[0]
b = tmp[1]
c = tmp[2]
```

Since JavaScript doesn't have tuples, RapydScript uses arrays for tuple packing/unpacking behind the scenes, but the functionality stays the same. Note that unpacking only occurs when you're assigning to multiple arguments:

```py
a, b, c = fun()		# gets unpacked
tmp = fun()			# no unpacking, tmp will store an array of length 3
```

Unpacking can also be done in `for` loops (which you can read about in later section):

```py
for index, value in enumerate(items):
	print(index+': '+value)
```

Tuple packing is the reverse operation, and is done to the variables being assigned, rather than the ones being assigned to. This can occur during assignment or function return:

```py
def fun():
	return 1, 2, 3
```

To summarize packing and unpacking, it's basically just syntax sugar to remove obvious assignment logic that would just litter the code. For example, the swap operation shown in the beginning of this section is equivalent to the following code:

```py
tmp = [b, a]
a = tmp[0]
b = tmp[1]
```


Operators and keywords
------------------------

RapydScript uses the python form for operators and keywords. Below is the
mapping from RapydScript to JavaScript.

Keywords:

	RapydScript		JavaScript
	
	None			null
	False			false
	True			true
	undefined		undefined
	this			this

Operators:

	RapydScript		JavaScript
	
	and				&&
	or				||
	not				!
	is				===
	is not			!==
	+=1				++
	-=1				--
	**				Math.pow()
	
Admittedly, `is` is not exactly the same thing in Python as `===` in JavaScript, but JavaScript is quirky when it comes to comparing objects anyway.


Literal JavaScript
-----------------------

In rare cases RapydScript might not allow you to do what you need to, and you
need access to pure JavaScript, this is particularly useful for performance
optimizations in inner loops. When that's the case, you can use a *verbatim
string literal*.  That is simply a normal RapydScript string prefixed with the
```v``` character. Code inside a verbatim string literal is not a sandbox, you
can still interact with it from normal RapydScript:

```py
v'a = {foo: "bar", baz: 1};'
print(a.foo)	# prints "bar"

for v'i = 0; i < arr.length; i++':
   print (arr[i])
```

Containers (lists/sets/dicts)
------------------------------

### Lists

Lists in RapydScript are almost identical to lists in Python, but are also
native JavaScript arrays. The only small caveats are that the ``sort()`` and
``pop()`` methods are renamed to ``pysort()`` and ``pypop()``. This is so that
you can pass RapydScript lists to external JavaScript libraries without any
conflicts. Note that even list literals in RapydScript create python like list
objects, and you can also use the builtin ``list()`` function to create lists
from other iterable objects, just as you would in python.  You can create a
RapydScript list from a plain native JavaScript array by using the ``list_wrap()``
function, like this:

```py
a = v'[1, 2]'
pya = list_wrap(a)
 # Now pya is a python like list object that satisfies pya === a
```

### Sets

Sets in RapydScript are identical to those in python. You can create them using
set literals or comprehensions and all set operations are supported. You can
store any object in a set, the only caveat is that RapydScript does not support
the ``__hash__()`` method, so if you store an arbitrary object as opposed to a
primitive type, object equality will be via the ``is`` operator.

Note that sets are not a subclass of the ES 6 JavaScript Set object, however,
they do use this object as a backend, when available. You can create a set from
any enumerable container, like you would in python

```py
s = set(list or other set or string)
```

You can also wrap an existing JavaScript Set object efficiently, without
creating a copy with:

```py
js_set = Set()
py_set = set_wrap(js_set)
```

Note that using non-primitive objects as set members does not behave the
same way as in Python. For example:

```py
a = [1, 2]
s = {a}
a in s  # True
[1, 2] in s # False
```

This is because, as noted above, object equality is via the ```is```
operator, not hashes.

### Dicts

dicts are the most different in RapydScript, from Python. This is because
RapydScript uses the JavaScript Object as a dict, for compatibility with
external JavaScript libraries and performance. This means there are several
differences between RapydScript dicts and Python dicts.

    - You can only use primitive types (strings/numbers) as keys in the dict
    - If you use numbers as keys, they are auto-converted to strings
    - You can access the keys of the dict as attributes of the dict object
    - Trying to access a non-existent key returns ``undefined`` instead of
      raising a KeyError
    - dict objects do not have the same methods as python dict objects:
      ``items(), keys(), values(), get(), pop(), etc.`` You can however use
      RapydScript dict objects in ```for..in``` loops.

Fortunately, there is a builtin ```dict``` type that behaves just like Python's
```dict``` with all the same methods. The only caveat is that you have to add
a special line to your RapydScript code to use these dicts, as shown below:

```py
from __python__ import dict_literals, overload_getitem
a = {1:1, 2:2}
a[1]  # == 1
a[3] = 3
list(a.keys()) == [1, 2, 3]
a['3'] # raises a KeyError as this is a proper python dict, not a JavaScript object
```

The special line, called a *scoped flag* tells the compiler that from
that point on, you want it to treat dict literals and the getitem operator `[]`
as they are treated in python, not JavaScript. 

The scoped flags are local to each scope, that means that if you use it in a
module, it will only affect code in that module, it you use it in a function,
it will only affect code in that function. In fact, you can even use it to
surround a few lines of code, like this:

```py
from __python__ import dict_literals, overload_getitem
a = {1:1, 2:2}
isinstance(a, dict) == True
from __python__ import no_dict_literals, no_overload_getitem
a = {1:1, 2:2}
isinstance(a, dict) == False # a is a normal JavaScript object
```


### Container comparisons

Container equality (the `==` and `!=` operators) work for lists and sets and
RapydScript dicts (but not arbitrary javascript objects). You can also define
the ``__eq__(self, other)`` method in your classes to have these operators work
for your own types.

RapydScript does not overload the ordering operators ```(>, <, >=,
<=)``` as doing so would be a big performance impact (function calls in
JavaScript are very slow). So using them on containers is useless. 

Loops
-----
RapydScript's loops work like Python, not JavaScript. You can't, for example
use ```for(i=0;i<max;i++)``` syntax. You can, however, loop through arrays
using 'for ... in' syntax without worrying about the extra irrelevant
attributes regular JavaScript returns.

```py
animals = ['cat', 'dog', 'mouse', 'horse']
for animal in animals:
	print('I have a '+animal)
```
		
If you need to use the index in the loop as well, you can do so by using enumerate():

```py
for index, animal in enumerate(animals):
	print("index:"+index, "animal:"+animal)
```

Like in Python, if you just want the index, you can use range:

```py
for index in range(len(animals)):			# or range(animals.length)
	print("animal "+index+" is a "+animals[index])
```

When possible, RapydScript will automatically optimize the loop for you into
JavaScript's basic syntax, so you're not missing much by not being able to call
it directly.


List/Set/Dict Comprehensions
-------------------------------

RapydScript also supports comprehensions, using Python syntax. Instead of the following, for example:

```py
myArray = []
for index in range(1,20):
	if index*index % 3 == 0:
		myArray.append(index*index)
```

You could write this:

```py
myArray = [i*i for i in range(1,20) if i*i%3 == 0]
```

Similarly for set and dict comprehensions:

```py
myDict = {x:x+1 for x in range(20) if x > 2}
mySet = {i*i for i in range(1,20) if i*i%3 == 0}
```

Strings
---------

For reasons of compatibility with external JavaScript and performance,
RapydScript does not make any changes to the native JavaScript string type.
However, all the useful Python string methods are available on the builtin
``str`` object. This is analogous to how the functions are available in the
``string`` module in Python 2.x.  For example,

```py
str.strip(' a ') == 'a'
str.split('a b') == ['a', 'b']
str.format('{0:02d} {n}', 1, n=2) == '01 2'
...
```

However, if you want to make the python string methods available on string
objects, there is a convenience method in the standard library to do so. Use
the following code:

```py
from pythonize import strings
strings()
```

After you call the `strings()` function, all python string methods will be
available on string objects, just as in python. The only caveat is that two
methods: `split()` and `replace()` are left as the native JavaScript versions,
as their behavior is not compatible with that of the python versions. You can
control which methods are not copied to the JavaScript String object by passing
their names to the `strings()` function, like this:

```py
strings('split', 'replace', 'find', ...)
# or
strings(None)  # no methods are excluded
```

One thing to keep in mind is that in JavaScript string are UTF-16, so they
behave like strings in narrow builds of Python 2.x. This means that non-BMP
unicode characters are represented as surrogate pairs. RapydScript includes
some functions to make dealing with non-BMP unicode characters easier:

  - ``str.uchrs(string, [with_positions])`` -- iterate over unicode characters in string, so, for example:

	```py
	list(str.uchrs('s🐱a')) == ['s', "🐱", 'a']
	```

	You can also get positions of individual characters:

	```py
	list(str.uchrs('s🐱a', True)) == [[0, 's'], [1, "🐱"], [3, 'a']]
	```
	Note that any broken surrogate pairs in the underlying string are returned
	as the unicode replacement character U+FFFD

  - ``str.uslice(string, [start, [stop]])`` -- get a slice based on unicode character positions, for example:

	```py
	str.uslice('s🐱a', 2') == 'a'  # even though a is at index 3 in the native string object
	```

  - ``str.ulen(string)`` -- return the number of unicode characters in the string

The Existential Operator
---------------------------

One of the annoying warts of JavaScript is that there are two "null-like"
values: `undefined` and `null`. So if you want to test if a variable is not
null you often have to write a lengthy expression that looks like

```py
(var !== undefined and var !== None)
```

Simply doing `bool(var)` will not work because zero and empty strings are also
False.

Similarly, if you need to access a chain of properties/keys and dont want a
`TypeError` to be raised, if one of them is undefined/null then you have
to do something like:

```py
if a and a.b and a.b.c:
	ans = a.b.c()
else:
	ans = undefined
```

To ease these irritations, RapydScript borrows the *Existential operator* from
CoffeeScript. This can be used to test if a variable is null-like, with a
single character, like this:

```py
yes = True if no? else False
# Which, without the ? operator becomes
yes = True if no is not undefined and no is not None else False
```

When it comes to long chains, the `?` operator will return the expected value
if all parts of the chain are ok, but cause the entire chaning to result in
`undefined` if any of its links are null-like. For example:

```py
ans = a?.b?[1]?()
# Which, without the ? operator becomes
ans = undefined
if a is not undefined and a is not None and a.b is not undefined and a.b is not None and jstype(a.b[1]) is 'function':
	ans = a.b[1]()
```

Finally, you can also use the existential operator as shorthand for the
conditional ternary operator, like this:

```py
a = b ? c
# is the same as
a = c if (b is undefined or b is None) else b
```

Regular Expressions
----------------------

RapydScript includes a ```re``` module that mimics the interface of the Python
re module. However, it uses the JavaScript regular expression functionality
under the hood, which has several differences from the Python regular
expression engine. Most importantly:

  - it does not support lookbehind and group existence assertions
  - it does not support unicode (on ES 6 runtimes, unicode is supported, but
	with a different syntax). You can test for the presence of unicode support with
	```re.supports_unicode```. 
  - The ``MatchObject``'s ``start()`` and ``end()`` method cannot return correct values
    for subgroups for some kinds of regular expressions, for example, those
	with nested captures. This is because the JavaScript regex API does not expose
	this information, so it has to be guessed via a heuristic.

You can use the JavaScript regex literal syntax, including verbose regex
literals, as shown below. In verbose mode, whitespace is ignored and # comments
are allowed (except inside character classes -- verbose mode works in the same
way as in python, except you use the JavaScript Regex literal syntax).

```py
import re
re.match(/a(b)/, 'ab') == re.match('a(b)', 'ab')

re.match(///
  a  # a comment
  b  # Another comment
  ///, 'ab')
```

Creating DOM trees easily
---------------------------------

RapydScript includes a small module in its standard library to create DOM tress
efficiently. It leverages the powerful support for python style function
calling. Best illustrated with an example:

```py
from elementmaker import E

E.div(id="container", class_="xxx",
	E.div('The Heading', data_heading="1"),
	E.p('Some text ',
		E.i('with italics'),
		E('custom', ' and a csutom tag'),
	)
)
```

This is equivalent to:

```html
<div id="container" class="xxx">
	<div data-heading="1">The Heading</div>
	<p>Some text <i>with italics</i><custom> and a custom tag</custom></p>
</div>
```

Basically, you create text nodes and children as positional arguments and
attributes as keyword arguments. Note that if an attribute name is a reserved
keyword in RapydScript, you can postfix it with an underscore. So ```class_```
becomes ```class```. Also, underscores are automatically replaced by hyphens,
so ```data-*``` attributes can be created. Finally, if you need a non-standard
tag, you simply use the ```E()``` function by itself with the first argument
being the tag name.

Another great feature is that you can pass functions as event handlers
directly, so for example:

```py
E.a(onclick=def():
	pass  # do something on the click event
)
```

Classes
-------
This is where RapydScript really starts to shine. JavaScript is known for having really crappy class implementation (it's basically a hack on top of a normal function, most experienced users suggest using external libraries for creating those instead of creating them in pure JavaScript). Luckily RapydScript fixes that. Let's imagine we want a special text field that takes in a user color string and changes color based on it. Let's create such field via a class.

```js
class ColorfulTextField:
	def __init__(self):
		field = $('<input></input>')
		changeColor = def(event):
			field.css('backround', field.val())
		field.keydown(changeColor)
		self.widget = field
```

This class abuses DOM's tolerant behavior, where it will default to the original setting when the passed-in color is invalid (saving us the extra error-checking logic). To append this field to our page we can run the following code:

```py
textfield = ColorfulTextField()
$('body').append(textfield.widget)
```

If you're used to JavaScript, the code above probably set off a few red flags in your head. In pure JavaScript, you can't create an object without using a 'new' operator. Don't worry, the above code will compile to the following:

```js
var textfield;
textfield = new ColorfulTextField()
$('body').append(textfield.widget);
```

RapydScript will automatically handle appending the 'new' keyword for you, assuming you used 'class' to create the class for your object. This also holds when creating an object inside a list or returning it as well. You could easily do the following, for example:

```
fields = [ColorfulTextField(), ColorfulTextField(), ColorfulTextField()]
```

This is very useful for avoiding a common JavaScript error of creating 'undefined' objects by forgetting this keyword. One other point to note here is that regular DOM/JavaScript objects are also covered by this. So if you want to create a DOM image element, you should not use the 'new' keyword either:

```py
myImage = Image()
```

But RapydScript's capability doesn't end here. Like Python, RapydScript allows inheritance. Let's say, for example, we want a new field, which works similar to the one above. But in addition to changing color of the field, it allows us to change the color of a different item, with ID of 'target' after we press the 'apply' button, located right next to it. Not a problem, let's implement this guy:

```js

class TextFieldAffectingOthers(ColorfulTextField):
	def __init__(self):
		ColorfulTextField.__init__(self)
		field = self.widget
		submit = $('<button type="button">apply</button>')
		applyColor = def(event):
			$('#target').css('background', field.val())
		submit.click(applyColor)
		self.widget = $('<div></div>')\
			.append(field)\
			.append(submit)
```

A couple of things to note here. We can invoke methods from the parent class
the same way we would in Python, by using `Parent.method(self, ...)` syntax.
This allows us to control when and how (assuming it requires additional
arguments) the parent method gets executed. Also note the use of `\` operator
to break up a line. This is something Python allows for keeping each line short
and legible. Likewise, RapydScript, being indentation-based, allows the same.

Like Python, RapydScript allows multiple inheritance. The only caveat is that 
the internal semantics of how it works are pretty different from python, since
it is built on JavaScript's prototypical inheritance. For the most part you
wont notice any differences from python, except, if you have a very complex
inheritance hierarchy, especially, one with cycles. In this (rare) case you may
find that the method-resolution-order in RapydScript is different from Python.

Like Python, RapydScript allows static methods. Marking the method static with
`@staticmethod` decorator will compile that method such that it's not bound to
the object instance, and ensure all calls to this method compile into static
method calls:

```py
class Test:
	def normalMethod(self):
		return 1

	@staticmethod
	def staticMethod(a):
		return a+1
```

### External Classes

RapydScript will automatically detect classes declared within the same scope (as long as the declaration occurs before use), as well as classes properly imported into the module (each module making use of a certain class should explicitly import the module containing that class). RapydScript will also properly detect native JavaScript classes (String, Array, Date, etc.). Unfortunately, RapydScript has no way of detecting classes from third-party libraries. In those cases, you could use the `new` keyword every time you create an object from such class. Alternatively, you could mark the class as external.

Marking a class as external is done via `external` decorator. You do not need to fill in the contents of the class, a simple `pass` statement will do:

```py
@external
class Alpha:
	pass
```

RapydScript will now treat `Alpha` as if it was declared within the same scope, auto-prepending the `new` keyword when needed and using `prototype` to access its methods (see `casperjs` example in next section to see how this can be used in practice). You don't need to pre-declare the methods of this class (unless you decide to for personal reference, the compiler will simply ignore them) unless you want to mark certain methods as static:

```py
@external
class Alpha:
	@staticmethod
	def one():
		pass
```

`Alpha.one` is now a static method, every other method invoked on `Alpha` will still be treated as a regular class method. While not mandatory, you could pre-declare other methods you plan to use from `Alpha` class as well, to make your code easier to read for other developers, in which case this `external` declaration would also serve as a table of contents for `Alpha`:

```py
@external
class Alpha:
	def two(): pass
	def three(): pass

	@staticmethod
	def one(): pass
```

As mentioned earlier, this is simply for making your code easier to read. The compiler itself will ignore all method declarations except ones marked with `staticmethod` decorator.

You could also use `external` decorator to bypass improperly imported RapydScript modules. However, if you actually have control of these modules, the better solution would be to fix those imports.


### Method Binding

By default, RapydScript does not bind methods to the classes they're declared under. This behavior is unlike Python, but very much like the rest of JavaScript. For example, consider this code:

```py
class Boy:
	def __init__(self, name):
		self.name = name

	def greet(self):
		if self:
			print('My name is' + self.name)

tod = Boy('Tod')
tod.greet()                 # Hello, my name is Tod
getattr(tod, 'greet')()     # prints nothing
```

In some cases, however, you may wish for the functions in the class to be
automatically bound when the objects of that class are instantiated. In order
to do that, use a *scoped flag*, which is a simple instruction to the compiler
telling it to auto-bind methods, as shown below:

```py

class AutoBound:
	from __python__ import bound_methods

	def __init__(self):
		self.a = 3

	def val(self):
		return self.a

getattr(AutoBound(), 'val')() == 3
```

If you want all classes in a module to be auto-bound simply put the scoped flag
at the top of the module. You can even choose to have only a few methods of the
class auto-bound, like this:

```py
class C:

	def unbound1(self):
		pass # this method will not be auto-bound

	from __python__ import bound_methods
	# Methods below this line will be auto-bound

	def bound(self):
	   pass # This method will be auto-bound

	from __python__ import no_bound_methods
	# Methods below this line will not be auto-bound

	def unbound2(self):
		pass  # this method will be unbound
```

Scoped flags apply only to the scope they are defined in, so if you define them
inside a class declaration, they only apply to that class. If you define it at
the module level, it will only apply to all classes in the module that occur
below that line, and so on.

Iterators
----------

RapydScript supports iterators, just like python, with a few differences to
make interoperating with other JavaScript code nicer. You can make an iterator
from an array or object by simply calling the builtin ``iter()`` function, just
as you would in python. The result of the function is a javascript iterator
object, that works both in RapydScript's for..in loops and ES6 JavaScript
for..of loops. Indeed they will work with any vanilla JavaScript code that
expects an iterable object. You can make your own classes iterable by defining
an ``__iter__`` method, just as you would in python. For example:

```python
	class A:

		def __init__(self):
			self.items = [1, 2, 3]

		def __iter__(self):
			return iter(self.items)

	for x in A():
	   print (x)  # Will print 1, 2, 3
```

Note that unlike python, an iterators ``next()`` method does not return
the next value, but instead an object with two properties: ``done and value``.
``value`` is the next value and done will be ``True`` when the iterator is
exhausted. No ``StopIteration`` exception is raised. These choices were
made so that the iterator works with other JavaScript code.

Generators
------------

RapydScript supports generators (the python yield keyword). For example:

```py
def f():
	for i in range(3):
		yield i

[x for x in f()] == [1, 2, 3]
```

There is full support for generators including the Python 3, ```yield from```
syntax. 

Generators create JavaScript iterator objects. For differences between python
and JavaScript iterators, see the section on iterators above. 

Currently, generators are down-converted to ES 5 switch statements. In the
future, when ES 6 support is widespread, they will be converted to native
JavaScript ES 6 generators.

Modules
-------

RapydScript's module system works almost exactly like Python's. Modules are
files ending with the suffix ```.pyj``` and packages are directories containing
an ```__init__.pyj``` file. The only caveat is that star imports are not
currently supported (this is by design, star imports are easily abused).
You can import things from modules, just like you would in python:

```py
from mypackage.mymodule import something, something_else
```

When you import modules, the RapydScript compiler automatically generates a
single large JavaScript file containing all the imported packages/modules and
their dependencies, recursively. This makes it very easy to integrate the
output of RapydScript into your website.

Modules are searched for by default in the rapydscript builtin modules
directory and the directory of the rapydscript file that you are
compiling. You can add additional directories to the searched locations via
the RAPYDSCRIPT_IMPORT_PATH environment variable or the --import-path option 
to the RapydScript compiler. See the documentation of the option for details.

Exception Handling
------------------

Exception handling in RapydScript works just like it does in python. 

An example:

```py
try:
	somefunc()
except Exception as e:
	import traceback
	traceback.print_exc()
else:
    print('no exception occurred')
finally:
    cleanup()
```

You can create your own Exception classes by inheriting from `Exception`, which
is the JavaScript Error class, for more details on this, see (the MDN documentation)[https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Error]. 

```py
class MyError(Exception):
	def __init__(self, message):
		self.name = 'MyError'
		self.message = message

raise MyError('This is a custom error!')
```

You can lump multiple errors in the same except block as well:

```py
try:
	print(foo)
except ReferenceError, TypeError as e:
	print(e.name + ':' + e.message)
	raise # re-raise the exception
```

Basically, `try/except/finally` in RapydScript works very similar to the way it does in Python 3. 

Scope Control
-------------

Scope refers to the context of a variable. For example, a variable declared inside a function is not seen by the code outside the function. This variable's scope is local to the function. JavaScript controls scope via `var` keyword. Any variable that you start using without declaring with a `var` first will try to reference inner-most variable with the same name, if one doesn't exist, it will create a global variable with that name. For example, the following JavaScript code will not only return `a` incremented by 1, but also overwrite the global variable `a` with `a+1`:

```py
a = 1;
a_plus_1 = function() {
	return ++a;
};
```

Basically, JavaScript defaults to outer or global scope if you omit `var`. This behavior can introduce some very frustrating bugs in large applications. To avoid this problem, RapydScript's scope preference works in reverse (same as Python's). RapydScript will prefer local-most scope, always creating a local variable if you perform any sort of assignment on it in a function (this is called variable shadowing). Shadowing can create another annoyance, however, of function's variable changes getting discarded. For example, at first, it looks like the following code will set `a` to 2:

```py
a = 1
b = 1
increment = def():
	a += b
increment()
```

When executed, however, increment() function will discard any changes to `a`. This is because, like Python, RapydScript will not allow you to edit variables declared in outer scope. As soon as you use any sort of assignment with `a` in the inner scope, RapydScript will declare it as an internal variable, shadowing `a` in the outer scope. One way around this is to use the `global` keyword, declaring `a` as a global variable. This, however, must be done in every function that edits `a`. It also litters global scope, which it frowned upon because it can accidentally overwrite an unrelated variable with the same name (declared by someone else or another library). RapydScript solves this by introducing `nonlocal` keyword (just like Python 3):

```py
a = 1
b = 1
increment = def():
	nonlocal a
	a += b
increment()
```

Note that `b` is not affected by shadowing. It's the assignment operator that triggers shadowing, you can read outer-scope variables without having to use `nonlocal`. You can combine multiple non-local arguments by separating them with a comma: `nonlocal a, b, c`. You can also chain `nonlocal` declarations to escape multiple scopes:

```py
def fun1():
	a = 5
	b = fun2():
		nonlocal a
		a *= 2
		c = fun3():
			nonlocal a
			a += 1
```

Shadowing is preferred in most cases, since it can't accidentally damage outside logic, and if you want to edit an external variable, you're usually better off assigning function's return value to it. There are cases, however, when using `nonlocal` makes the code cleaner. For compatibility with Python code, RapydScript also supports the `global` keyword, with the exception that if a variable is present both in the outer scope and the global scope, the variable from the outer scope will be used, rather than the variable from the global scope. This situation is rare in practice, and implementing it in RapydScript would require significant work, so RapydScript `global` remains a little incompatible with Python `global`.


Available Libraries
-------------------

One of Python's main strengths is the number of libraries available to the developer. This is something very few other `Python-in-a-browser` frameworks understand. In the browser JavaScript is king, and no matter how many libraries the community for the given project will write, the readily-available JavaScript libraries will always outnumber them. This is why RapydScript was designed with JavaScript and DOM integration in mind from the beginning. Indeed, plugging `underscore.js` in place of RapydScript's `stdlib` will work just as well, and some developers may choose to do so, after all, `underscore.js` is very Pythonic and very complete. 

It is for that reason that I try to keep RapydScript bells and whistles to a minimum. RapydScript's main strength is easy integration with JavaScript and DOM, which allows me to stay sane and not rewrite my own versions of the libraries that are already available. That doesn't mean, however, that pythonic libraries can't be written for RapydScript. To prove that, I have implemented lightweight clones of several popular Python libraries and bundled them into RapydScript, you can find them in `src` directory. The following libraries are included:

	math                # replicates almost all of the functionality from Python's math library
	re                  # replicates almost all of the functionality from Python's re library
	random              # replicates most of the functionality from Python's random library
	elementmaker        # easily construct DOM trees
	aes                 # Implement AES symmetric encryption
	encodings           # Convert to/from UTF-8 bytearrays, base64 strings and native strings
	gettext             # Support for internationalization of your RapydScript app
	operator            # a subset of python;s operator module

For the most part, the logic implemented in these libraries functions identically to the Python versions.  I'd be happy to include more libraries, if other members of the community want to implement them (it's fun to do, `re.pyj` is a good example), but I want to reemphasize that unlike most other Python-to-JavaScript compilers, RapydScript doesn't need them to be complete since there are already tons of available JavaScript libraries that it can use natively.

Linter
---------

The RapydScript compiler includes its own, built in linter. The linter is
modeled on pyflakes, it catches instances of unused/undefined variables,
functions, symbols, etc. While this sounds simple, it is surprisingly effective
in practice. To run the linter:

	rapydscript lint file.pyj

It will catch many errors, for example,

```py
def f():
	somevar = 1
	return someva
```

The linter will catch the typo above, saving you from having to discover it at
runtime. Another example:

```py
def f(somevar1):
	somevar2 = somevar1 * 2
	return somevar1
```

Here, you probably meant to return ``somevar2`` not ``somevar1``. The linter
will detect that somevar2 is defined but not used and warn you about it.

The linter is highly configurable, you can add to the list of built-in names
that the linter will not raise undefined errors for. You can turn off
individual checks that you do not find useful. See ``rapydscript lint -h`` for
details.

Making RapydScript even more pythonic
---------------------------------------

RapydScript has three main goals: To be as fast as possible, to be as close to
python as possible, to interoperate with external javascript libraries.
Sometimes these goals conflict and RapydScript chooses to be less pythonic in
service to the other two goals. Fortunately, there are many optional flags you
can use to reverse these compromises. The most important of these are called
*scoped flags*. 

The scoped flags are local to each scope, that means that if you use it in a
module, it will only affect code in that module, it you use it in a function,
it will only affect code in that function. In fact, you can even use it to
surround a few lines of code. There are many scoped flags, described else where
in this document, see the sections on Method Auto-binding and the section on Dicts
in this document.

Another common complaint is that in RapydScript strings dont have all the
string methods that python strings do. Fortunately, there is solution for that
as well, described in the section on strings in this document.


Advanced Usage Topics
---------------------

#### Browser Compatibility

RapydScript compiles your code such that it will work on browsers that are
compatible with the ES 5 JavaScript standard. The compiler has a 
``--js-version`` option that can also be used to output ES 6 only code. This
code is smaller and faster than the ES 5 version, but is not as widely
compatible.

#### Tabs vs Spaces

This seems to be a very old debate. Python code conventions suggest 4-space
indent. The old version of RapydScript relied on tabs, new one uses spaces
since that seems to be more consistent in both Python and JavaScript
communities. Use whichever one you prefer, as long as you stay consistent. If
you intend to submit your code to RapydScript, it must use spaces to be
consistent with the rest of the code in the repository.

#### External Libraries and Classes

RapydScript will pick up any classes you declare yourself as well as native
JavaScript classes. It will not, however, pick up class-like objects created by
outside frameworks. There are two approaches for dealing with those. One is via
`@external` decorator, the other is via `new` operator when declaring such
object. To keep code legible and consistent, I strongly prefer the use of
`@external` decorator over the `new` operator for several reasons, even if it
may be more verbose:

- `@external` decorator makes classes declared externally obvious to anyone looking at your code
- class declaration that uses `@external` decorator can be exported into a reusable module
- developers are much more likely to forget a single instance of `new` operator when declaring an object than to forget an import, the errors due to omitted `new` keyword are also likely to be more subtle and devious to debug

#### Embedding the RapydScript compiler in your webpage

You can embed the RapydScript compiler in your webpage so that you can have
your webapp directly compile user supplied RapydScript code into JavaScript.
To do so, simply include the [embeddable rapydscript compiler](https://sw.kovidgoyal.net/rapydscript/repl/rapydscript.js) 
in your page, and use it to compile arbitrary RapydScript code. 

You create the compiler by calling: `RapydScript.create_embedded_compiler()` and compile
code with `compiler.compile(code)`. You can execute the resulting JavaScript
using the standard `eval()` function. See the sample
HTML below for an example.

```html
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Test embedded RapydScript</title>
        <script charset="UTF-8" src="https://sw.kovidgoyal.net/rapydscript/repl/rapydscript.js"></script>
        <script>
var compiler = RapydScript.create_embedded_compiler();
var js = compiler.compile("def hello_world():\n a='RapydScript is cool!'\n print(a)\n alert(a)");
window.onload = function() {
    document.body.textContent = js;
    eval(js);
    eval('hello_world()');
};
        </script>
    </head>
    <body style="white-space:pre-wrap"></body>
</html>
```

There are a couple of caveats when using the embedded compiler:

* It only works when run in a modern browser (one that supports ES6) so no
  Internet Explorer. You can have it work in an ES 5 runtime by passing
  an option to the compile() method, like this:
  ```
  compiler.compile(code, {js_version:5})
  ```
  Note that doing this means that you cannot use generators and the
  yield keyword in your RapydScript code.

* Importing of modules only works with the standard library modules. There is
  currently no way to make your own modules importable.

* To generate the embedded compiler yourself (rapydscript.js) from a source
  checkout of rapydscript, follow the instructions above for installing from
  source, then run `bin/web-repl-export /path/to/export/directory`

Internationalization
-------------------------

RapydScript includes support for internationalization -- i.e. the translation
of user interface strings defined in the RapydScript source code. The interface
for this is very similar to Python's gettext module.  Suppose you have some
code that needs internalization support, the first step is to mark all
user-viewable strings as translatable:

```py
from gettext import gettext as _
create_button(_('My Button'))
create_button(_('Another Button'))
```

Now we need to extract these string from the source code into a .pot file which
can be used to create translations. To do that, run:

```
rapydscript gettext file.pyj > messages.pot
```

Now send the `messages.pot` file to your translators. Suppose you get back a
`de.po` file from the translators with German translations. You now need to
compile this into a format that can be used by RapydScript (RapydScript uses a
JSON based format for easy operation over HTTP). Simply run:

```
rapydscript msgfmt < messages.pot > messages.json
```

Now, suppose you load up the translation data in your application. Exactly how
you do that is upto you. You can load it via Ajax or using a `<script>` tag. To
activate the loaded data, simply run:

```py
from gettext import install

install(translation_data)
```

Now everywhere in your program that you have calls to the `_()` function, you
will get translated output. So make sure you install the translation data
before building the rest of your user-interface.

Just as in python, you also have a `ngettext()` function for translating
strings that depend on a count.


Gotchas
---------

RapydScript has a couple of mutually conflicting goals: Be as close to python
as possible, while also generating clean, performant JavaScript and making
interop with external JavaScript libraries easy.

As a result, there are some things in RapydScript that might come as surprises
to an experienced Python developer. The most important such gotchas are listed
below:

- Truthiness in JavaScript is very different from Python. Empty lists and dicts
  are ``False`` in Python but ``True`` in JavaScript. The compiler could work
  around that, but not without a significant performance cost, so it is best to
  just get used to checking the length instead of the object directly.

- Operators in JavaScript are very different from Python. ``1 + '1'`` would be
  an error in Python, but results in ``'11'`` in JavaScript. Similarly, ``[1] +
  [1]`` is a new list in Python, but a string in JavaScript. Keep that in mind
  as you write code. RapydScript does not implement operator overloading, as
  method calls in JavaScript are very slow compared to raw operators.

- There are many more keywords than in Python. Because RapydScript compiles
  down to JavaScript, the set of keywords is all the keywords of Python + all
  the keywords of JavaScript. For example, ``default`` and ``switch`` are
  keywords in RapydScript. See [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords)
  for a list of JavaScript keywords.

- Method binding in RS is not automatic. So ``someobj.somemethod()`` will do the
  right thing, but ``x = someobj.somethod; x()`` will not. You can turn method binding on
  via a scoped flag. See the section above on method binding for details.

- Nested comprehensions are not supported. So you cannot do this:
	[a for a in b for b in c]

- RapydScript automatically appends 'new' keyword when using classes generated
  by it, native JavaScript objects like `Image` and `RegExp` and classes from
  other libraries marked as external. However, automatic new insertion depends
  on the compiler being able to detect that a symbol resolves to a class.
  Because of the dynamic nature of JavaScript this is not possible to do with
  100% accuracy. So it is best to get in the habit of using the `new` keyword
  yourself. Similarly, the compiler will try to convert SomeClass.method() into
  SomeClass.prototype.method() for you, but again, this is not 100% reliable.

- The {"a":b} syntax is used to create JavaScript hashes. These do not behave
  like python dictionaries. To create python like dictionary objects, you
  should use a scoped flag. See the section on dictionaries above for details.


Reasons for the fork
----------------------

The fork was initially created because the original developer of RapydScript
did not have the time to keep up with the pace of development. Since then, 
development on the original RapydScript seems to have stalled completely.
Also, there are certain disagreements on the future direction of RapydScript.

Regardless, this fork is not a hostile fork, if development on the original
ever resumes, they are welcome to use the code from this fork. I have kept all
new code under the same license, to make that possible.

See the [Changelog](https://github.com/kovidgoyal/rapydscript-ng/blob/master/CHANGELOG.md)
for a list of changes to rapydscript-ng since the fork.

For some discussion surrounding the fork, see 
[this bug report](https://github.com/kovidgoyal/rapydscript-ng/issues/15)


================================================
FILE: add-toc-to-readme
================================================
#!/bin/sh
exec node_modules/doctoc/doctoc.js --title '**Contents**' README.md


================================================
FILE: bin/export
================================================
#!/usr/bin/env node 
// vim:ft=javascript:ts=4:et

"use strict";

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

var base = path.join(path.dirname(__dirname));
var meta = JSON.parse(fs.readFileSync(path.join(base, 'package.json'), {'encoding':'utf-8'}));
var compiler_dir = path.join(base, 'dev');
if (!path_exists(path.join(compiler_dir, 'compiler.js'))) compiler_dir = path.join(base, 'release');

var manifest = {}, total = 0;
['compiler.js', 'baselib-plain-pretty.js', 'baselib-plain-ugly.js'].forEach(function(x) {
    manifest[x] = fs.readFileSync(path.join(compiler_dir, x), {'encoding':'utf-8'});
    total += manifest[x].length;
});

['web_repl.js', 'repl.js', 'completer.js', 'utils.js', 'gettext.js', 'msgfmt.js'].forEach(function(x) {
    x = 'tools/' + x;
    manifest[x] = fs.readFileSync(path.join(base, x), {'encoding':'utf-8'});
    total += manifest[x].length;
});


var dedup = {};

function path_exists(path) {
    try {
        fs.statSync(path);
        return true;
    } catch(e) {
        if (e.code != 'ENOENT') throw e;
    }
}

function sha1sum(data) { 
    var h = crypto.createHash('sha1');
    h.update(data);
    return h.digest('hex');
}

function process_dir(name) {
    var dpath = path.join(base, name);
    var items = fs.readdirSync(dpath);
    items.forEach(function (x) {
        var iname = name + '/' + x;
        var ipath = path.join(dpath, x);
        var s = fs.statSync(ipath);
        if (s.isDirectory()) return process_dir(iname);
        var raw = fs.readFileSync(ipath, {'encoding':'utf-8'});
        var sig = sha1sum(raw);
        if (dedup.hasOwnProperty(sig)) {
            manifest[iname] = [dedup[sig]];
        } else {
            manifest[iname] = raw;
            dedup[sig] = iname;
            total += s.size;
        }
    });
}

Object.keys(meta.dependencies).forEach(function (x) {
    process_dir('node_modules/' + x);
});
console.log('// vim:fileencoding=utf-8');
console.log('(function() {');
console.log('var rs_version = ' + JSON.stringify(meta.version) + ';');
console.log('var data = ' + JSON.stringify(manifest) + ';');
console.log();
console.log(fs.readFileSync(path.join(base, 'tools', 'export.js'), {'encoding':'utf-8'}));
console.log('})()');
console.error('RapydScript compiler (uncompressed) size: ' + (total/(1024 * 1024)).toFixed(1) + ' MB');


================================================
FILE: bin/rapydscript
================================================
#!/usr/bin/env node 
// vim:ft=javascript:ts=4:et

"use strict";

function load(mod) {
    return require('../tools/' + mod);
}

var utils = load('utils');

// We need ES 6 generators so relaunch with the --harmony flag
if (!utils.generators_available()) {
    if (process.execArgv.indexOf('--harmony') != -1) {
        console.error('RapydScript needs ES 6 generators, update your version of nodejs');
        process.exit(1);
    }
    var args = ['--harmony', module.filename].concat(process.argv.slice(2));
    require('child_process').spawn(process.execPath, args, {stdio:'inherit'}).on('exit', function(code, signal) {
        process.exit(code);
    });
} else {

    var start_time = new Date().getTime();
    var path = require('path');

    var argv = load('cli').argv;

    var base_path = path.normalize(path.join(path.dirname(module.filename), ".."));
    var src_path = path.join(base_path, 'src');
    var lib_path = path.join(base_path, 'dev');
    if (!utils.path_exists(path.join(lib_path, 'compiler.js'))) lib_path = path.join(base_path, 'release');

    if (argv.mode === 'self') {
        if (argv.files.length > 0) {
            console.error("WARN: Ignoring input files since --self was passed");
        }
        load('self')(base_path, src_path, lib_path, argv.complete, argv.profile);
        if (argv.test) {
            console.log('\nRunning test suite...\n');
            argv.files = [];  // Ensure all tests are run
            load('test')(argv, base_path, src_path, path.join(base_path, 'dev'));
        }
        process.exit(0);
    } else 

    if (argv.mode === 'test') {
        load('test')(argv, base_path, src_path, lib_path);
    } else 

    if (argv.mode === 'lint') {
        load('lint').cli(argv, base_path, src_path, lib_path);
    } else

    if (argv.mode === 'repl') {
        load('repl')({'lib_path':lib_path, 'imp_path':path.join(src_path, 'lib'), show_js:!argv.no_js});
    } else 
    
    if (argv.mode === 'gettext') {
        load('gettext').cli(argv, base_path, src_path, lib_path);
    } else
    
    if (argv.mode === 'msgfmt') {
        load('msgfmt').cli(argv, base_path, src_path, lib_path);
    } else
    
    {
        load('compile')(start_time, argv, base_path, src_path, lib_path);
    }
}


================================================
FILE: bin/web-repl-export
================================================
#!/usr/bin/env node 
// vim:ft=javascript:ts=4:et

"use strict";

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

var base = path.normalize(path.resolve(path.join(path.dirname(__dirname))));
var meta = JSON.parse(fs.readFileSync(path.join(base, 'package.json'), {'encoding':'utf-8'}));
var commit_sha = fs.readFileSync(path.join(base, '.git', 'refs', 'heads', 'master'), {'encoding':'utf-8'}).trim();
var compiler_dir = path.join(base, 'dev');
if (!path_exists(path.join(compiler_dir, 'compiler.js'))) compiler_dir = path.join(base, 'release');

var manifest = {}, total = 0;
['compiler.js', 'baselib-plain-pretty.js'].forEach(function(x) {
    manifest[x] = fs.readFileSync(path.join(compiler_dir, x), {'encoding':'utf-8'});
    total += manifest[x].length;
});

['web_repl.js', 'embedded_compiler.js', 'utils.js', 'completer.js', 'msgfmt.js', 'gettext.js'].forEach(function(x) {
    x = 'tools/' + x;
    manifest[x] = fs.readFileSync(path.join(base, x), {'encoding':'utf-8'});
    total += manifest[x].length;
});

var stdlib = path.join(base, 'src', 'lib');

function path_exists(path) {
    try {
        fs.statSync(path);
        return true;
    } catch(e) {
        if (e.code != 'ENOENT') throw e;
    }
}

function process_dir(relpath) {
    var fullpath = (relpath) ? path.join(stdlib, relpath) : stdlib;
    fs.readdirSync(fullpath).forEach(function (x) {
        var q = path.join(fullpath, x);
        var s = fs.statSync(q);
        if (s.isDirectory()) return process_dir(relpath + '/' + x);
        if (!x.endsWith('.pyj')) return;
        var iname = path.normalize('__stdlib__' + '/' + relpath + '/' + x);
        var raw = fs.readFileSync(q, {'encoding':'utf-8'});
        manifest[iname] = raw;
        total += s.size;
    });
}
process_dir('');


var rs = '// vim:fileencoding=utf-8\n';
rs += '(function(external_namespace) {\n';
rs += '"use strict;"\n';
rs += 'var rs_version = ' + JSON.stringify(meta.version) + ';\n';
rs += 'var rs_commit_sha = ' + JSON.stringify(commit_sha) + ';\n';
rs += '\n// Embedded modules {{{\n';
rs += 'var data = ' + JSON.stringify(manifest) + ';\n\n';
rs += '// End embedded modules }}}\n\n';
rs += fs.readFileSync(path.join(base, 'web-repl', 'env.js'));
rs += '\n// Embedded sha1 implementation {{{\n';
rs += '(function() {\n';
rs += fs.readFileSync(path.join(base, 'web-repl', 'sha1.js'));
rs += '}).call(jsSHA);\n';
rs += '// End embedded sha1 implementation }}}\n\n';
rs += 'var exports = namespace;\n';
rs += fs.readFileSync(path.join(base, 'tools', 'export.js'), {'encoding':'utf-8'});
rs += 'external_namespace.RapydScript = namespace;\n';
rs += '})(this);\n';


var base_dir = process.argv.slice(-1)[0];
if (process.argv.length !== 3) {
    console.error('Usage: web-repl-export /path/to/export/directory');
    process.exit(1);
}

base_dir = path.normalize(path.resolve(base_dir));

try {
    fs.mkdirSync(base_dir);
} catch(e) {
    if (e.code !== 'EEXIST') throw e;
}

try {
    process.chdir(base_dir);
} catch(e) {
    if (e.code === 'ENOTDIR') { console.error(base_dir + ' is not a directory'); process.exit(1); }
    throw e;
}
fs.writeFileSync('rapydscript.js', rs, {'encoding':'utf-8'});
var web_repl = path.join(base, 'web-repl');
fs.readdirSync(web_repl).forEach(function(x) {
    if (['sha1.js', 'env.js'].indexOf(x) !== -1) return;
    var data = fs.readFileSync(path.join(web_repl, x), {'encoding':'utf-8'});
    fs.writeFileSync(x, data, {'encoding':'utf-8'});
});
console.log('RapydScript compiler (uncompressed) size: ' + (total/(1024)).toFixed(1) + ' KB');
console.log('web-repl exported to: ' + base_dir);


================================================
FILE: build
================================================
#!/bin/sh
exec bin/rapydscript self --complete --test


================================================
FILE: package.json
================================================
{
  "name": "rapydscript-ng",
  "description": "Pythonic JavaScript that doesn't suck",
  "homepage": "https://github.com/kovidgoyal/rapydscript-ng",
  "keywords": [
    "javascript",
    "rapydscript",
    "language",
    "compiler"
  ],
  "main": "tools/compiler.js",
  "scripts": {
    "test": "node bin/rapydscript self --complete --test",
    "start": "node bin/rapydscript",
    "build-self": "node bin/rapydscript self --complete"
  },
  "version": "0.7.23",
  "license": "BSD-2-Clause",
  "engines": {
    "node": ">=0.12.0"
  },
  "maintainers": [
    {
      "name": "Kovid Goyal",
      "email": "kovid@kovidgoyal.net"
    }
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/kovidgoyal/rapydscript-ng.git"
  },
  "dependencies": {
    "regenerator": ">= 0.12.1",
    "uglify-js": ">= 3.0.15"
  },
  "optionalDependencies": {
    "v8-profiler": ">= 5.2.9"
  },
  "bin": {
    "rapydscript": "bin/rapydscript"
  }
}


================================================
FILE: publish.py
================================================
#!/usr/bin/env python
# vim:fileencoding=utf-8
# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>

import subprocess
import os
import shutil
import json

# Load metadata
base = os.path.dirname(os.path.abspath(__file__))
subprocess.check_call([os.path.join(base, 'build')])
with open('package.json', 'rb') as f:
    m = json.load(f)
version = m['version']

# Update the files in release/ from dev/
shutil.rmtree(os.path.join(base, 'release'))
shutil.copytree(os.path.join(base, 'dev'), os.path.join(base, 'release'))
subprocess.check_call(['git', 'add', os.path.join(base, 'release')])
if subprocess.check_output(
        'git status --porcelain --untracked-files release'.split()).strip():
    subprocess.check_call([
        'git', 'commit', '-m', 'Updating release build of compiler'])
    subprocess.check_call('git push'.split())

# Tag the release
subprocess.check_call('git tag -s v{0} -m version-{0}'.format(version).split())
subprocess.check_call(['git', 'push', 'origin', 'v'+version])

# Update the web REPL
gh_pages = os.path.join(os.path.dirname(base), 'kovidgoyal.github.io')
subprocess.check_call([os.path.join(gh_pages, 'update-rapyd-repl.py')])

# Publish to NPM
subprocess.check_call(['npm', 'login'])
subprocess.check_call(['npm', 'publish', base])


================================================
FILE: release/baselib-plain-pretty.js
================================================
var ρσ_len;
function ρσ_bool(val) {
    return !!val;
};
if (!ρσ_bool.__argnames__) Object.defineProperties(ρσ_bool, {
    __argnames__ : {value: ["val"]},
    __module__ : {value: "__main__"}
});

function ρσ_print() {
    var parts;
    if (typeof console === "object") {
        parts = [];
        for (var i = 0; i < arguments.length; i++) {
            parts.push(ρσ_str(arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]));
        }
        console.log(parts.join(" "));
    }
};
if (!ρσ_print.__module__) Object.defineProperties(ρσ_print, {
    __module__ : {value: "__main__"}
});

function ρσ_int(val, base) {
    var ans;
    if (typeof val === "number") {
        ans = val | 0;
    } else {
        ans = parseInt(val, base || 10);
    }
    if (isNaN(ans)) {
        throw new ValueError("Invalid literal for int with base " + (base || 10) + ": " + val);
    }
    return ans;
};
if (!ρσ_int.__argnames__) Object.defineProperties(ρσ_int, {
    __argnames__ : {value: ["val", "base"]},
    __module__ : {value: "__main__"}
});

function ρσ_float(val) {
    var ans;
    if (typeof val === "number") {
        ans = val;
    } else {
        ans = parseFloat(val);
    }
    if (isNaN(ans)) {
        throw new ValueError("Could not convert string to float: " + arguments[0]);
    }
    return ans;
};
if (!ρσ_float.__argnames__) Object.defineProperties(ρσ_float, {
    __argnames__ : {value: ["val"]},
    __module__ : {value: "__main__"}
});

function ρσ_arraylike_creator() {
    var names;
    names = "Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" ");
    if (typeof HTMLCollection === "function") {
        names = names.concat("HTMLCollection NodeList NamedNodeMap TouchList".split(" "));
    }
    return (function() {
        var ρσ_anonfunc = function (x) {
            if (Array.isArray(x) || typeof x === "string" || names.indexOf(Object.prototype.toString.call(x).slice(8, -1)) > -1) {
                return true;
            }
            return false;
        };
        if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
            __argnames__ : {value: ["x"]},
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
};
if (!ρσ_arraylike_creator.__module__) Object.defineProperties(ρσ_arraylike_creator, {
    __module__ : {value: "__main__"}
});

function options_object(f) {
    return (function() {
        var ρσ_anonfunc = function () {
            if (typeof arguments[arguments.length - 1] === "object") {
                arguments[ρσ_bound_index(arguments.length - 1, arguments)][ρσ_kwargs_symbol] = true;
            }
            return f.apply(this, arguments);
        };
        if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
};
if (!options_object.__argnames__) Object.defineProperties(options_object, {
    __argnames__ : {value: ["f"]},
    __module__ : {value: "__main__"}
});

function ρσ_id(x) {
    return x.ρσ_object_id;
};
if (!ρσ_id.__argnames__) Object.defineProperties(ρσ_id, {
    __argnames__ : {value: ["x"]},
    __module__ : {value: "__main__"}
});

function ρσ_dir(item) {
    var arr;
    arr = ρσ_list_decorate([]);
    for (var i in item) {
        arr.push(i);
    }
    return arr;
};
if (!ρσ_dir.__argnames__) Object.defineProperties(ρσ_dir, {
    __argnames__ : {value: ["item"]},
    __module__ : {value: "__main__"}
});

function ρσ_ord(x) {
    var ans, second;
    ans = x.charCodeAt(0);
    if (55296 <= ans && ans <= 56319) {
        second = x.charCodeAt(1);
        if (56320 <= second && second <= 57343) {
            return (ans - 55296) * 1024 + second - 56320 + 65536;
        }
        throw new TypeError("string is missing the low surrogate char");
    }
    return ans;
};
if (!ρσ_ord.__argnames__) Object.defineProperties(ρσ_ord, {
    __argnames__ : {value: ["x"]},
    __module__ : {value: "__main__"}
});

function ρσ_chr(code) {
    if (code <= 65535) {
        return String.fromCharCode(code);
    }
    code -= 65536;
    return String.fromCharCode(55296 + (code >> 10), 56320 + (code & 1023));
};
if (!ρσ_chr.__argnames__) Object.defineProperties(ρσ_chr, {
    __argnames__ : {value: ["code"]},
    __module__ : {value: "__main__"}
});

function ρσ_callable(x) {
    return typeof x === "function";
};
if (!ρσ_callable.__argnames__) Object.defineProperties(ρσ_callable, {
    __argnames__ : {value: ["x"]},
    __module__ : {value: "__main__"}
});

function ρσ_bin(x) {
    var ans;
    if (typeof x !== "number" || x % 1 !== 0) {
        throw new TypeError("integer required");
    }
    ans = x.toString(2);
    if (ans[0] === "-") {
        ans = "-" + "0b" + ans.slice(1);
    } else {
        ans = "0b" + ans;
    }
    return ans;
};
if (!ρσ_bin.__argnames__) Object.defineProperties(ρσ_bin, {
    __argnames__ : {value: ["x"]},
    __module__ : {value: "__main__"}
});

function ρσ_hex(x) {
    var ans;
    if (typeof x !== "number" || x % 1 !== 0) {
        throw new TypeError("integer required");
    }
    ans = x.toString(16);
    if (ans[0] === "-") {
        ans = "-" + "0x" + ans.slice(1);
    } else {
        ans = "0x" + ans;
    }
    return ans;
};
if (!ρσ_hex.__argnames__) Object.defineProperties(ρσ_hex, {
    __argnames__ : {value: ["x"]},
    __module__ : {value: "__main__"}
});

function ρσ_enumerate(iterable) {
    var ans, iterator;
    ans = {"_i":-1};
    ans[ρσ_iterator_symbol] = (function() {
        var ρσ_anonfunc = function () {
            return this;
        };
        if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
    if (ρσ_arraylike(iterable)) {
        ans["next"] = (function() {
            var ρσ_anonfunc = function () {
                this._i += 1;
                if (this._i < iterable.length) {
                    return {'done':false, 'value':[this._i, iterable[this._i]]};
                }
                return {'done':true};
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ans;
    }
    if (typeof iterable[ρσ_iterator_symbol] === "function") {
        iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();
        ans["_iterator"] = iterator;
        ans["next"] = (function() {
            var ρσ_anonfunc = function () {
                var r;
                r = this._iterator.next();
                if (r.done) {
                    return {'done':true};
                }
                this._i += 1;
                return {'done':false, 'value':[this._i, r.value]};
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ans;
    }
    return ρσ_enumerate(Object.keys(iterable));
};
if (!ρσ_enumerate.__argnames__) Object.defineProperties(ρσ_enumerate, {
    __argnames__ : {value: ["iterable"]},
    __module__ : {value: "__main__"}
});

function ρσ_reversed(iterable) {
    var ans;
    if (ρσ_arraylike(iterable)) {
        ans = {"_i": iterable.length};
        ans["next"] = (function() {
            var ρσ_anonfunc = function () {
                this._i -= 1;
                if (this._i > -1) {
                    return {'done':false, 'value':iterable[this._i]};
                }
                return {'done':true};
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        ans[ρσ_iterator_symbol] = (function() {
            var ρσ_anonfunc = function () {
                return this;
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ans;
    }
    throw new TypeError("reversed() can only be called on arrays or strings");
};
if (!ρσ_reversed.__argnames__) Object.defineProperties(ρσ_reversed, {
    __argnames__ : {value: ["iterable"]},
    __module__ : {value: "__main__"}
});

function ρσ_iter(iterable) {
    var ans;
    if (typeof iterable[ρσ_iterator_symbol] === "function") {
        return (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();
    }
    if (ρσ_arraylike(iterable)) {
        ans = {"_i":-1};
        ans[ρσ_iterator_symbol] = (function() {
            var ρσ_anonfunc = function () {
                return this;
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        ans["next"] = (function() {
            var ρσ_anonfunc = function () {
                this._i += 1;
                if (this._i < iterable.length) {
                    return {'done':false, 'value':iterable[this._i]};
                }
                return {'done':true};
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ans;
    }
    return ρσ_iter(Object.keys(iterable));
};
if (!ρσ_iter.__argnames__) Object.defineProperties(ρσ_iter, {
    __argnames__ : {value: ["iterable"]},
    __module__ : {value: "__main__"}
});

function ρσ_range_next(step, length) {
    var ρσ_unpack;
    this._i += step;
    this._idx += 1;
    if (this._idx >= length) {
        ρσ_unpack = [this.__i, -1];
        this._i = ρσ_unpack[0];
        this._idx = ρσ_unpack[1];
        return {'done':true};
    }
    return {'done':false, 'value':this._i};
};
if (!ρσ_range_next.__argnames__) Object.defineProperties(ρσ_range_next, {
    __argnames__ : {value: ["step", "length"]},
    __module__ : {value: "__main__"}
});

function ρσ_range(start, stop, step) {
    var length, ans;
    if (arguments.length <= 1) {
        stop = start || 0;
        start = 0;
    }
    step = arguments[2] || 1;
    length = Math.max(Math.ceil((stop - start) / step), 0);
    ans = {start:start, step:step, stop:stop};
    ans[ρσ_iterator_symbol] = (function() {
        var ρσ_anonfunc = function () {
            var it;
            it = {"_i": start - step, "_idx": -1};
            it.next = ρσ_range_next.bind(it, step, length);
            it[ρσ_iterator_symbol] = (function() {
                var ρσ_anonfunc = function () {
                    return this;
                };
                if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                    __module__ : {value: "__main__"}
                });
                return ρσ_anonfunc;
            })();
            return it;
        };
        if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
    ans.count = (function() {
        var ρσ_anonfunc = function (val) {
            if (!this._cached) {
                this._cached = list(this);
            }
            return this._cached.count(val);
        };
        if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
            __argnames__ : {value: ["val"]},
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
    ans.index = (function() {
        var ρσ_anonfunc = function (val) {
            if (!this._cached) {
                this._cached = list(this);
            }
            return this._cached.index(val);
        };
        if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
            __argnames__ : {value: ["val"]},
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
    ans.__len__ = (function() {
        var ρσ_anonfunc = function () {
            return length;
        };
        if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
    ans.__repr__ = (function() {
        var ρσ_anonfunc = function () {
            return "range(" + ρσ_str.format("{}", start) + ", " + ρσ_str.format("{}", stop) + ", " + ρσ_str.format("{}", step) + ")";
        };
        if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
    ans.__str__ = ans.toString = ans.__repr__;
    if (typeof Proxy === "function") {
        ans = new Proxy(ans, (function(){
            var ρσ_d = {};
            ρσ_d["get"] = (function() {
                var ρσ_anonfunc = function (obj, prop) {
                    var iprop;
                    if (typeof prop === "string") {
                        iprop = parseInt(prop);
                        if (!isNaN(iprop)) {
                            prop = iprop;
                        }
                    }
                    if (typeof prop === "number") {
                        if (!obj._cached) {
                            obj._cached = list(obj);
                        }
                        return (ρσ_expr_temp = obj._cached)[(typeof prop === "number" && prop < 0) ? ρσ_expr_temp.length + prop : prop];
                    }
                    return obj[(typeof prop === "number" && prop < 0) ? obj.length + prop : prop];
                };
                if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
                    __argnames__ : {value: ["obj", "prop"]},
                    __module__ : {value: "__main__"}
                });
                return ρσ_anonfunc;
            })();
            return ρσ_d;
        }).call(this));
    }
    return ans;
};
if (!ρσ_range.__argnames__) Object.defineProperties(ρσ_range, {
    __argnames__ : {value: ["start", "stop", "step"]},
    __module__ : {value: "__main__"}
});

function ρσ_getattr(obj, name, defval) {
    var ret;
    try {
        ret = obj[(typeof name === "number" && name < 0) ? obj.length + name : name];
    } catch (ρσ_Exception) {
        ρσ_last_exception = ρσ_Exception;
        if (ρσ_Exception instanceof TypeError) {
            if (defval === undefined) {
                throw new AttributeError("The attribute " + name + " is not present");
            }
            return defval;
        } else {
            throw ρσ_Exception;
        }
    }
    if (ret === undefined && !(name in obj)) {
        if (defval === undefined) {
            throw new AttributeError("The attribute " + name + " is not present");
        }
        ret = defval;
    }
    return ret;
};
if (!ρσ_getattr.__argnames__) Object.defineProperties(ρσ_getattr, {
    __argnames__ : {value: ["obj", "name", "defval"]},
    __module__ : {value: "__main__"}
});

function ρσ_setattr(obj, name, value) {
    obj[(typeof name === "number" && name < 0) ? obj.length + name : name] = value;
};
if (!ρσ_setattr.__argnames__) Object.defineProperties(ρσ_setattr, {
    __argnames__ : {value: ["obj", "name", "value"]},
    __module__ : {value: "__main__"}
});

function ρσ_hasattr(obj, name) {
    return name in obj;
};
if (!ρσ_hasattr.__argnames__) Object.defineProperties(ρσ_hasattr, {
    __argnames__ : {value: ["obj", "name"]},
    __module__ : {value: "__main__"}
});

ρσ_len = (function() {
    var ρσ_anonfunc = function () {
        function len(obj) {
            if (ρσ_arraylike(obj)) {
                return obj.length;
            }
            if (typeof obj.__len__ === "function") {
                return obj.__len__();
            }
            if (obj instanceof Set || obj instanceof Map) {
                return obj.size;
            }
            return Object.keys(obj).length;
        };
        if (!len.__argnames__) Object.defineProperties(len, {
            __argnames__ : {value: ["obj"]},
            __module__ : {value: "__main__"}
        });

        function len5(obj) {
            if (ρσ_arraylike(obj)) {
                return obj.length;
            }
            if (typeof obj.__len__ === "function") {
                return obj.__len__();
            }
            return Object.keys(obj).length;
        };
        if (!len5.__argnames__) Object.defineProperties(len5, {
            __argnames__ : {value: ["obj"]},
            __module__ : {value: "__main__"}
        });

        return (typeof Set === "function" && typeof Map === "function") ? len : len5;
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})()();
function ρσ_get_module(name) {
    return ρσ_modules[(typeof name === "number" && name < 0) ? ρσ_modules.length + name : name];
};
if (!ρσ_get_module.__argnames__) Object.defineProperties(ρσ_get_module, {
    __argnames__ : {value: ["name"]},
    __module__ : {value: "__main__"}
});

function ρσ_pow(x, y, z) {
    var ans;
    ans = Math.pow(x, y);
    if (z !== undefined) {
        ans %= z;
    }
    return ans;
};
if (!ρσ_pow.__argnames__) Object.defineProperties(ρσ_pow, {
    __argnames__ : {value: ["x", "y", "z"]},
    __module__ : {value: "__main__"}
});

function ρσ_type(x) {
    return x.constructor;
};
if (!ρσ_type.__argnames__) Object.defineProperties(ρσ_type, {
    __argnames__ : {value: ["x"]},
    __module__ : {value: "__main__"}
});

function ρσ_divmod(x, y) {
    var d;
    if (y === 0) {
        throw new ZeroDivisionError("integer division or modulo by zero");
    }
    d = Math.floor(x / y);
    return [d, x - d * y];
};
if (!ρσ_divmod.__argnames__) Object.defineProperties(ρσ_divmod, {
    __argnames__ : {value: ["x", "y"]},
    __module__ : {value: "__main__"}
});

function ρσ_max() {
    var kwargs = arguments[arguments.length-1];
    if (kwargs === null || typeof kwargs !== "object" || kwargs [ρσ_kwargs_symbol] !== true) kwargs = {};
    var args = Array.prototype.slice.call(arguments, 0);
    if (kwargs !== null && typeof kwargs === "object" && kwargs [ρσ_kwargs_symbol] === true) args.pop();
    var args, x;
    if (args.length === 0) {
        if (kwargs.defval !== undefined) {
            return kwargs.defval;
        }
        throw new TypeError("expected at least one argument");
    }
    if (args.length === 1) {
        args = args[0];
    }
    if (kwargs.key) {
        args = (function() {
            var ρσ_Iter = ρσ_Iterable(args), ρσ_Result = [], x;
            for (var ρσ_Index = 0; ρσ_Index < ρσ_Iter.length; ρσ_Index++) {
                x = ρσ_Iter[ρσ_Index];
                ρσ_Result.push(kwargs.key(x));
            }
            ρσ_Result = ρσ_list_constructor(ρσ_Result);
            return ρσ_Result;
        })();
    }
    if (!Array.isArray(args)) {
        args = list(args);
    }
    if (args.length) {
        return this.apply(null, args);
    }
    if (kwargs.defval !== undefined) {
        return kwargs.defval;
    }
    throw new TypeError("expected at least one argument");
};
if (!ρσ_max.__handles_kwarg_interpolation__) Object.defineProperties(ρσ_max, {
    __handles_kwarg_interpolation__ : {value: true},
    __module__ : {value: "__main__"}
});

var abs = Math.abs, max = ρσ_max.bind(Math.max), min = ρσ_max.bind(Math.min), bool = ρσ_bool, type = ρσ_type;
var float = ρσ_float, int = ρσ_int, arraylike = ρσ_arraylike_creator(), ρσ_arraylike = arraylike;
var print = ρσ_print, id = ρσ_id, get_module = ρσ_get_module, pow = ρσ_pow, divmod = ρσ_divmod;
var dir = ρσ_dir, ord = ρσ_ord, chr = ρσ_chr, bin = ρσ_bin, hex = ρσ_hex, callable = ρσ_callable;
var enumerate = ρσ_enumerate, iter = ρσ_iter, reversed = ρσ_reversed, len = ρσ_len;
var range = ρσ_range, getattr = ρσ_getattr, setattr = ρσ_setattr, hasattr = ρσ_hasattr;function ρσ_equals(a, b) {
    var ρσ_unpack, akeys, bkeys, key;
    if (a === b) {
        return true;
    }
    if (a && typeof a.__eq__ === "function") {
        return a.__eq__(b);
    }
    if (b && typeof b.__eq__ === "function") {
        return b.__eq__(a);
    }
    if (ρσ_arraylike(a) && ρσ_arraylike(b)) {
        if ((a.length !== b.length && (typeof a.length !== "object" || ρσ_not_equals(a.length, b.length)))) {
            return false;
        }
        for (var i=0; i < a.length; i++) {
            if (!(((a[(typeof i === "number" && i < 0) ? a.length + i : i] === b[(typeof i === "number" && i < 0) ? b.length + i : i] || typeof a[(typeof i === "number" && i < 0) ? a.length + i : i] === "object" && ρσ_equals(a[(typeof i === "number" && i < 0) ? a.length + i : i], b[(typeof i === "number" && i < 0) ? b.length + i : i]))))) {
                return false;
            }
        }
        return true;
    }
    if (typeof a === "object" && typeof b === "object" && a !== null && b !== null && (a.constructor === Object && b.constructor === Object || Object.getPrototypeOf(a) === null && Object.getPrototypeOf(b) === null)) {
        ρσ_unpack = [Object.keys(a), Object.keys(b)];
        akeys = ρσ_unpack[0];
        bkeys = ρσ_unpack[1];
        if (akeys.length !== bkeys.length) {
            return false;
        }
        for (var j=0; j < akeys.length; j++) {
            key = akeys[(typeof j === "number" && j < 0) ? akeys.length + j : j];
            if (!(((a[(typeof key === "number" && key < 0) ? a.length + key : key] === b[(typeof key === "number" && key < 0) ? b.length + key : key] || typeof a[(typeof key === "number" && key < 0) ? a.length + key : key] === "object" && ρσ_equals(a[(typeof key === "number" && key < 0) ? a.length + key : key], b[(typeof key === "number" && key < 0) ? b.length + key : key]))))) {
                return false;
            }
        }
        return true;
    }
    return false;
};
if (!ρσ_equals.__argnames__) Object.defineProperties(ρσ_equals, {
    __argnames__ : {value: ["a", "b"]},
    __module__ : {value: "__main__"}
});

function ρσ_not_equals(a, b) {
    if (a === b) {
        return false;
    }
    if (a && typeof a.__ne__ === "function") {
        return a.__ne__(b);
    }
    if (b && typeof b.__ne__ === "function") {
        return b.__ne__(a);
    }
    return !ρσ_equals(a, b);
};
if (!ρσ_not_equals.__argnames__) Object.defineProperties(ρσ_not_equals, {
    __argnames__ : {value: ["a", "b"]},
    __module__ : {value: "__main__"}
});

var equals = ρσ_equals;
function ρσ_list_extend(iterable) {
    var start, iterator, result;
    if (Array.isArray(iterable) || typeof iterable === "string") {
        start = this.length;
        this.length += iterable.length;
        for (var i = 0; i < iterable.length; i++) {
            (ρσ_expr_temp = this)[ρσ_bound_index(start + i, ρσ_expr_temp)] = iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i];
        }
    } else {
        iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();
        result = iterator.next();
        while (!result.done) {
            this.push(result.value);
            result = iterator.next();
        }
    }
};
if (!ρσ_list_extend.__argnames__) Object.defineProperties(ρσ_list_extend, {
    __argnames__ : {value: ["iterable"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_index(val, start, stop) {
    start = start || 0;
    if (start < 0) {
        start = this.length + start;
    }
    if (start < 0) {
        throw new ValueError(val + " is not in list");
    }
    if (stop === undefined) {
        stop = this.length;
    }
    if (stop < 0) {
        stop = this.length + stop;
    }
    for (var i = start; i < stop; i++) {
        if (((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === val || typeof (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === "object" && ρσ_equals((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i], val))) {
            return i;
        }
    }
    throw new ValueError(val + " is not in list");
};
if (!ρσ_list_index.__argnames__) Object.defineProperties(ρσ_list_index, {
    __argnames__ : {value: ["val", "start", "stop"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_pop(index) {
    var ans;
    if (this.length === 0) {
        throw new IndexError("list is empty");
    }
    if (index === undefined) {
        index = -1;
    }
    ans = this.splice(index, 1);
    if (!ans.length) {
        throw new IndexError("pop index out of range");
    }
    return ans[0];
};
if (!ρσ_list_pop.__argnames__) Object.defineProperties(ρσ_list_pop, {
    __argnames__ : {value: ["index"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_remove(value) {
    for (var i = 0; i < this.length; i++) {
        if (((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === value || typeof (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === "object" && ρσ_equals((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i], value))) {
            this.splice(i, 1);
            return;
        }
    }
    throw new ValueError(value + " not in list");
};
if (!ρσ_list_remove.__argnames__) Object.defineProperties(ρσ_list_remove, {
    __argnames__ : {value: ["value"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_to_string() {
    return "[" + this.join(", ") + "]";
};
if (!ρσ_list_to_string.__module__) Object.defineProperties(ρσ_list_to_string, {
    __module__ : {value: "__main__"}
});

function ρσ_list_insert(index, val) {
    if (index < 0) {
        index += this.length;
    }
    index = min(this.length, max(index, 0));
    if (index === 0) {
        this.unshift(val);
        return;
    }
    for (var i = this.length; i > index; i--) {
        (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] = (ρσ_expr_temp = this)[ρσ_bound_index(i - 1, ρσ_expr_temp)];
    }
    (ρσ_expr_temp = this)[(typeof index === "number" && index < 0) ? ρσ_expr_temp.length + index : index] = val;
};
if (!ρσ_list_insert.__argnames__) Object.defineProperties(ρσ_list_insert, {
    __argnames__ : {value: ["index", "val"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_copy() {
    return ρσ_list_constructor(this);
};
if (!ρσ_list_copy.__module__) Object.defineProperties(ρσ_list_copy, {
    __module__ : {value: "__main__"}
});

function ρσ_list_clear() {
    this.length = 0;
};
if (!ρσ_list_clear.__module__) Object.defineProperties(ρσ_list_clear, {
    __module__ : {value: "__main__"}
});

function ρσ_list_as_array() {
    return Array.prototype.slice.call(this);
};
if (!ρσ_list_as_array.__module__) Object.defineProperties(ρσ_list_as_array, {
    __module__ : {value: "__main__"}
});

function ρσ_list_count(value) {
    return this.reduce((function() {
        var ρσ_anonfunc = function (n, val) {
            return n + (val === value);
        };
        if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
            __argnames__ : {value: ["n", "val"]},
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })(), 0);
};
if (!ρσ_list_count.__argnames__) Object.defineProperties(ρσ_list_count, {
    __argnames__ : {value: ["value"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_sort_key(value) {
    var t;
    t = typeof value;
    if (t === "string" || t === "number") {
        return value;
    }
    return value.toString();
};
if (!ρσ_list_sort_key.__argnames__) Object.defineProperties(ρσ_list_sort_key, {
    __argnames__ : {value: ["value"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_sort_cmp(a, b, ap, bp) {
    if (a < b) {
        return -1;
    }
    if (a > b) {
        return 1;
    }
    return ap - bp;
};
if (!ρσ_list_sort_cmp.__argnames__) Object.defineProperties(ρσ_list_sort_cmp, {
    __argnames__ : {value: ["a", "b", "ap", "bp"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_sort() {
    var key = (arguments[0] === undefined || ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? ρσ_list_sort.__defaults__.key : arguments[0];
    var reverse = (arguments[1] === undefined || ( 1 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? ρσ_list_sort.__defaults__.reverse : arguments[1];
    var ρσ_kwargs_obj = arguments[arguments.length-1];
    if (ρσ_kwargs_obj === null || typeof ρσ_kwargs_obj !== "object" || ρσ_kwargs_obj [ρσ_kwargs_symbol] !== true) ρσ_kwargs_obj = {};
    if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "key")){
        key = ρσ_kwargs_obj.key;
    }
    if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "reverse")){
        reverse = ρσ_kwargs_obj.reverse;
    }
    var mult, keymap, posmap, k;
    key = key || ρσ_list_sort_key;
    mult = (reverse) ? -1 : 1;
    keymap = dict();
    posmap = dict();
    for (var i=0; i < this.length; i++) {
        k = (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];
        keymap.set(k, key(k));
        posmap.set(k, i);
    }
    this.sort((function() {
        var ρσ_anonfunc = function (a, b) {
            return mult * ρσ_list_sort_cmp(keymap.get(a), keymap.get(b), posmap.get(a), posmap.get(b));
        };
        if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
            __argnames__ : {value: ["a", "b"]},
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })());
};
if (!ρσ_list_sort.__defaults__) Object.defineProperties(ρσ_list_sort, {
    __defaults__ : {value: {key:null, reverse:false}},
    __handles_kwarg_interpolation__ : {value: true},
    __argnames__ : {value: ["key", "reverse"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_concat() {
    var ans;
    ans = Array.prototype.concat.apply(this, arguments);
    ρσ_list_decorate(ans);
    return ans;
};
if (!ρσ_list_concat.__module__) Object.defineProperties(ρσ_list_concat, {
    __module__ : {value: "__main__"}
});

function ρσ_list_slice() {
    var ans;
    ans = Array.prototype.slice.apply(this, arguments);
    ρσ_list_decorate(ans);
    return ans;
};
if (!ρσ_list_slice.__module__) Object.defineProperties(ρσ_list_slice, {
    __module__ : {value: "__main__"}
});

function ρσ_list_iterator(value) {
    var self;
    self = this;
    return (function(){
        var ρσ_d = {};
        ρσ_d["_i"] = -1;
        ρσ_d["_list"] = self;
        ρσ_d["next"] = (function() {
            var ρσ_anonfunc = function () {
                this._i += 1;
                if (this._i >= this._list.length) {
                    return (function(){
                        var ρσ_d = {};
                        ρσ_d["done"] = true;
                        return ρσ_d;
                    }).call(this);
                }
                return (function(){
                    var ρσ_d = {};
                    ρσ_d["done"] = false;
                    ρσ_d["value"] = (ρσ_expr_temp = this._list)[ρσ_bound_index(this._i, ρσ_expr_temp)];
                    return ρσ_d;
                }).call(this);
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ρσ_d;
    }).call(this);
};
if (!ρσ_list_iterator.__argnames__) Object.defineProperties(ρσ_list_iterator, {
    __argnames__ : {value: ["value"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_len() {
    return this.length;
};
if (!ρσ_list_len.__module__) Object.defineProperties(ρσ_list_len, {
    __module__ : {value: "__main__"}
});

function ρσ_list_contains(val) {
    for (var i = 0; i < this.length; i++) {
        if (((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === val || typeof (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === "object" && ρσ_equals((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i], val))) {
            return true;
        }
    }
    return false;
};
if (!ρσ_list_contains.__argnames__) Object.defineProperties(ρσ_list_contains, {
    __argnames__ : {value: ["val"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_eq(other) {
    if (!ρσ_arraylike(other)) {
        return false;
    }
    if ((this.length !== other.length && (typeof this.length !== "object" || ρσ_not_equals(this.length, other.length)))) {
        return false;
    }
    for (var i = 0; i < this.length; i++) {
        if (!((((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === other[(typeof i === "number" && i < 0) ? other.length + i : i] || typeof (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === "object" && ρσ_equals((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i], other[(typeof i === "number" && i < 0) ? other.length + i : i]))))) {
            return false;
        }
    }
    return true;
};
if (!ρσ_list_eq.__argnames__) Object.defineProperties(ρσ_list_eq, {
    __argnames__ : {value: ["other"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_decorate(ans) {
    ans.append = Array.prototype.push;
    ans.toString = ρσ_list_to_string;
    ans.inspect = ρσ_list_to_string;
    ans.extend = ρσ_list_extend;
    ans.index = ρσ_list_index;
    ans.pypop = ρσ_list_pop;
    ans.remove = ρσ_list_remove;
    ans.insert = ρσ_list_insert;
    ans.copy = ρσ_list_copy;
    ans.clear = ρσ_list_clear;
    ans.count = ρσ_list_count;
    ans.concat = ρσ_list_concat;
    ans.pysort = ρσ_list_sort;
    ans.slice = ρσ_list_slice;
    ans.as_array = ρσ_list_as_array;
    ans.__len__ = ρσ_list_len;
    ans.__contains__ = ρσ_list_contains;
    ans.__eq__ = ρσ_list_eq;
    ans.constructor = ρσ_list_constructor;
    if (typeof ans[ρσ_iterator_symbol] !== "function") {
        ans[ρσ_iterator_symbol] = ρσ_list_iterator;
    }
    return ans;
};
if (!ρσ_list_decorate.__argnames__) Object.defineProperties(ρσ_list_decorate, {
    __argnames__ : {value: ["ans"]},
    __module__ : {value: "__main__"}
});

function ρσ_list_constructor(iterable) {
    var ans, iterator, result;
    if (iterable === undefined) {
        ans = [];
    } else if (ρσ_arraylike(iterable)) {
        ans = new Array(iterable.length);
        for (var i = 0; i < iterable.length; i++) {
            ans[(typeof i === "number" && i < 0) ? ans.length + i : i] = iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i];
        }
    } else if (typeof iterable[ρσ_iterator_symbol] === "function") {
        iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();
        ans = ρσ_list_decorate([]);
        result = iterator.next();
        while (!result.done) {
            ans.push(result.value);
            result = iterator.next();
        }
    } else if (typeof iterable === "number") {
        ans = new Array(iterable);
    } else {
        ans = Object.keys(iterable);
    }
    return ρσ_list_decorate(ans);
};
if (!ρσ_list_constructor.__argnames__) Object.defineProperties(ρσ_list_constructor, {
    __argnames__ : {value: ["iterable"]},
    __module__ : {value: "__main__"}
});

ρσ_list_constructor.__name__ = "list";
var list = ρσ_list_constructor, list_wrap = ρσ_list_decorate;
function sorted() {
    var iterable = ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true) ? undefined : arguments[0];
    var key = (arguments[1] === undefined || ( 1 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? sorted.__defaults__.key : arguments[1];
    var reverse = (arguments[2] === undefined || ( 2 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? sorted.__defaults__.reverse : arguments[2];
    var ρσ_kwargs_obj = arguments[arguments.length-1];
    if (ρσ_kwargs_obj === null || typeof ρσ_kwargs_obj !== "object" || ρσ_kwargs_obj [ρσ_kwargs_symbol] !== true) ρσ_kwargs_obj = {};
    if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "key")){
        key = ρσ_kwargs_obj.key;
    }
    if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "reverse")){
        reverse = ρσ_kwargs_obj.reverse;
    }
    var ans;
    ans = ρσ_list_constructor(iterable);
    ans.pysort(key, reverse);
    return ans;
};
if (!sorted.__defaults__) Object.defineProperties(sorted, {
    __defaults__ : {value: {key:null, reverse:false}},
    __handles_kwarg_interpolation__ : {value: true},
    __argnames__ : {value: ["iterable", "key", "reverse"]},
    __module__ : {value: "__main__"}
});

var ρσ_global_object_id = 0, ρσ_set_implementation;
function ρσ_set_keyfor(x) {
    var t, ans;
    t = typeof x;
    if (t === "string" || t === "number" || t === "boolean") {
        return "_" + t[0] + x;
    }
    if (x === null) {
        return "__!@#$0";
    }
    ans = x.ρσ_hash_key_prop;
    if (ans === undefined) {
        ans = "_!@#$" + (++ρσ_global_object_id);
        Object.defineProperty(x, "ρσ_hash_key_prop", (function(){
            var ρσ_d = {};
            ρσ_d["value"] = ans;
            return ρσ_d;
        }).call(this));
    }
    return ans;
};
if (!ρσ_set_keyfor.__argnames__) Object.defineProperties(ρσ_set_keyfor, {
    __argnames__ : {value: ["x"]},
    __module__ : {value: "__main__"}
});

function ρσ_set_polyfill() {
    this._store = {};
    this.size = 0;
};
if (!ρσ_set_polyfill.__module__) Object.defineProperties(ρσ_set_polyfill, {
    __module__ : {value: "__main__"}
});

ρσ_set_polyfill.prototype.add = (function() {
    var ρσ_anonfunc = function (x) {
        var key;
        key = ρσ_set_keyfor(x);
        if (!Object.prototype.hasOwnProperty.call(this._store, key)) {
            this.size += 1;
            (ρσ_expr_temp = this._store)[(typeof key === "number" && key < 0) ? ρσ_expr_temp.length + key : key] = x;
        }
        return this;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set_polyfill.prototype.clear = (function() {
    var ρσ_anonfunc = function (x) {
        this._store = {};
        this.size = 0;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set_polyfill.prototype.delete = (function() {
    var ρσ_anonfunc = function (x) {
        var key;
        key = ρσ_set_keyfor(x);
        if (Object.prototype.hasOwnProperty.call(this._store, key)) {
            this.size -= 1;
            delete this._store[key];
            return true;
        }
        return false;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set_polyfill.prototype.has = (function() {
    var ρσ_anonfunc = function (x) {
        return Object.prototype.hasOwnProperty.call(this._store, ρσ_set_keyfor(x));
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set_polyfill.prototype.values = (function() {
    var ρσ_anonfunc = function (x) {
        var ans;
        ans = {'_keys': Object.keys(this._store), '_i':-1, '_s':this._store};
        ans[ρσ_iterator_symbol] = (function() {
            var ρσ_anonfunc = function () {
                return this;
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        ans["next"] = (function() {
            var ρσ_anonfunc = function () {
                this._i += 1;
                if (this._i >= this._keys.length) {
                    return {'done': true};
                }
                return {'done':false, 'value':this._s[this._keys[this._i]]};
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ans;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
if (typeof Set !== "function" || typeof Set.prototype.delete !== "function") {
    ρσ_set_implementation = ρσ_set_polyfill;
} else {
    ρσ_set_implementation = Set;
}
function ρσ_set(iterable) {
    var ans, s, iterator, result, keys;
    if (this instanceof ρσ_set) {
        this.jsset = new ρσ_set_implementation;
        ans = this;
        if (iterable === undefined) {
            return ans;
        }
        s = ans.jsset;
        if (ρσ_arraylike(iterable)) {
            for (var i = 0; i < iterable.length; i++) {
                s.add(iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i]);
            }
        } else if (typeof iterable[ρσ_iterator_symbol] === "function") {
            iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();
            result = iterator.next();
            while (!result.done) {
                s.add(result.value);
                result = iterator.next();
            }
        } else {
            keys = Object.keys(iterable);
            for (var j=0; j < keys.length; j++) {
                s.add(keys[(typeof j === "number" && j < 0) ? keys.length + j : j]);
            }
        }
        return ans;
    } else {
        return new ρσ_set(iterable);
    }
};
if (!ρσ_set.__argnames__) Object.defineProperties(ρσ_set, {
    __argnames__ : {value: ["iterable"]},
    __module__ : {value: "__main__"}
});

ρσ_set.prototype.__name__ = "set";
Object.defineProperties(ρσ_set.prototype, (function(){
    var ρσ_d = {};
    ρσ_d["length"] = (function(){
        var ρσ_d = {};
        ρσ_d["get"] = (function() {
            var ρσ_anonfunc = function () {
                return this.jsset.size;
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ρσ_d;
    }).call(this);
    ρσ_d["size"] = (function(){
        var ρσ_d = {};
        ρσ_d["get"] = (function() {
            var ρσ_anonfunc = function () {
                return this.jsset.size;
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ρσ_d;
    }).call(this);
    return ρσ_d;
}).call(this));
ρσ_set.prototype.__len__ = (function() {
    var ρσ_anonfunc = function () {
        return this.jsset.size;
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.has = ρσ_set.prototype.__contains__ = (function() {
    var ρσ_anonfunc = function (x) {
        return this.jsset.has(x);
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.add = (function() {
    var ρσ_anonfunc = function (x) {
        this.jsset.add(x);
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.clear = (function() {
    var ρσ_anonfunc = function () {
        this.jsset.clear();
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.copy = (function() {
    var ρσ_anonfunc = function () {
        return ρσ_set(this);
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.discard = (function() {
    var ρσ_anonfunc = function (x) {
        this.jsset.delete(x);
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype[ρσ_iterator_symbol] = (function() {
    var ρσ_anonfunc = function () {
        return this.jsset.values();
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.difference = (function() {
    var ρσ_anonfunc = function () {
        var ans, s, iterator, r, x, has;
        ans = new ρσ_set;
        s = ans.jsset;
        iterator = this.jsset.values();
        r = iterator.next();
        while (!r.done) {
            x = r.value;
            has = false;
            for (var i = 0; i < arguments.length; i++) {
                if (arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].has(x)) {
                    has = true;
                    break;
                }
            }
            if (!has) {
                s.add(x);
            }
            r = iterator.next();
        }
        return ans;
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.difference_update = (function() {
    var ρσ_anonfunc = function () {
        var s, remove, iterator, r, x;
        s = this.jsset;
        remove = [];
        iterator = s.values();
        r = iterator.next();
        while (!r.done) {
            x = r.value;
            for (var i = 0; i < arguments.length; i++) {
                if (arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].has(x)) {
                    remove.push(x);
                    break;
                }
            }
            r = iterator.next();
        }
        for (var j = 0; j < remove.length; j++) {
            s.delete(remove[(typeof j === "number" && j < 0) ? remove.length + j : j]);
        }
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.intersection = (function() {
    var ρσ_anonfunc = function () {
        var ans, s, iterator, r, x, has;
        ans = new ρσ_set;
        s = ans.jsset;
        iterator = this.jsset.values();
        r = iterator.next();
        while (!r.done) {
            x = r.value;
            has = true;
            for (var i = 0; i < arguments.length; i++) {
                if (!arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].has(x)) {
                    has = false;
                    break;
                }
            }
            if (has) {
                s.add(x);
            }
            r = iterator.next();
        }
        return ans;
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.intersection_update = (function() {
    var ρσ_anonfunc = function () {
        var s, remove, iterator, r, x;
        s = this.jsset;
        remove = [];
        iterator = s.values();
        r = iterator.next();
        while (!r.done) {
            x = r.value;
            for (var i = 0; i < arguments.length; i++) {
                if (!arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].has(x)) {
                    remove.push(x);
                    break;
                }
            }
            r = iterator.next();
        }
        for (var j = 0; j < remove.length; j++) {
            s.delete(remove[(typeof j === "number" && j < 0) ? remove.length + j : j]);
        }
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.isdisjoint = (function() {
    var ρσ_anonfunc = function (other) {
        var iterator, r, x;
        iterator = this.jsset.values();
        r = iterator.next();
        while (!r.done) {
            x = r.value;
            if (other.has(x)) {
                return false;
            }
            r = iterator.next();
        }
        return true;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["other"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.issubset = (function() {
    var ρσ_anonfunc = function (other) {
        var iterator, r, x;
        iterator = this.jsset.values();
        r = iterator.next();
        while (!r.done) {
            x = r.value;
            if (!other.has(x)) {
                return false;
            }
            r = iterator.next();
        }
        return true;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["other"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.issuperset = (function() {
    var ρσ_anonfunc = function (other) {
        var s, iterator, r, x;
        s = this.jsset;
        iterator = other.jsset.values();
        r = iterator.next();
        while (!r.done) {
            x = r.value;
            if (!s.has(x)) {
                return false;
            }
            r = iterator.next();
        }
        return true;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["other"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.pop = (function() {
    var ρσ_anonfunc = function () {
        var iterator, r;
        iterator = this.jsset.values();
        r = iterator.next();
        if (r.done) {
            throw new KeyError("pop from an empty set");
        }
        this.jsset.delete(r.value);
        return r.value;
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.remove = (function() {
    var ρσ_anonfunc = function (x) {
        if (!this.jsset.delete(x)) {
            throw new KeyError(x.toString());
        }
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.symmetric_difference = (function() {
    var ρσ_anonfunc = function (other) {
        return this.union(other).difference(this.intersection(other));
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["other"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.symmetric_difference_update = (function() {
    var ρσ_anonfunc = function (other) {
        var common;
        common = this.intersection(other);
        this.update(other);
        this.difference_update(common);
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["other"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.union = (function() {
    var ρσ_anonfunc = function () {
        var ans;
        ans = ρσ_set(this);
        ans.update.apply(ans, arguments);
        return ans;
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.update = (function() {
    var ρσ_anonfunc = function () {
        var s, iterator, r;
        s = this.jsset;
        for (var i=0; i < arguments.length; i++) {
            iterator = arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i][ρσ_iterator_symbol]();
            r = iterator.next();
            while (!r.done) {
                s.add(r.value);
                r = iterator.next();
            }
        }
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.toString = ρσ_set.prototype.__repr__ = ρσ_set.prototype.__str__ = ρσ_set.prototype.inspect = (function() {
    var ρσ_anonfunc = function () {
        return "{" + list(this).join(", ") + "}";
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_set.prototype.__eq__ = (function() {
    var ρσ_anonfunc = function (other) {
        var iterator, r;
        if (!other instanceof this.constructor) {
            return false;
        }
        if (other.size !== this.size) {
            return false;
        }
        if (other.size === 0) {
            return true;
        }
        iterator = other[ρσ_iterator_symbol]();
        r = iterator.next();
        while (!r.done) {
            if (!this.has(r.value)) {
                return false;
            }
            r = iterator.next();
        }
        return true;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["other"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
function ρσ_set_wrap(x) {
    var ans;
    ans = new ρσ_set;
    ans.jsset = x;
    return ans;
};
if (!ρσ_set_wrap.__argnames__) Object.defineProperties(ρσ_set_wrap, {
    __argnames__ : {value: ["x"]},
    __module__ : {value: "__main__"}
});

var set = ρσ_set, set_wrap = ρσ_set_wrap;
var ρσ_dict_implementation;
function ρσ_dict_polyfill() {
    this._store = {};
    this.size = 0;
};
if (!ρσ_dict_polyfill.__module__) Object.defineProperties(ρσ_dict_polyfill, {
    __module__ : {value: "__main__"}
});

ρσ_dict_polyfill.prototype.set = (function() {
    var ρσ_anonfunc = function (x, value) {
        var key;
        key = ρσ_set_keyfor(x);
        if (!Object.prototype.hasOwnProperty.call(this._store, key)) {
            this.size += 1;
        }
        (ρσ_expr_temp = this._store)[(typeof key === "number" && key < 0) ? ρσ_expr_temp.length + key : key] = [x, value];
        return this;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x", "value"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict_polyfill.prototype.clear = (function() {
    var ρσ_anonfunc = function (x) {
        this._store = {};
        this.size = 0;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict_polyfill.prototype.delete = (function() {
    var ρσ_anonfunc = function (x) {
        var key;
        key = ρσ_set_keyfor(x);
        if (Object.prototype.hasOwnProperty.call(this._store, key)) {
            this.size -= 1;
            delete this._store[key];
            return true;
        }
        return false;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict_polyfill.prototype.has = (function() {
    var ρσ_anonfunc = function (x) {
        return Object.prototype.hasOwnProperty.call(this._store, ρσ_set_keyfor(x));
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict_polyfill.prototype.get = (function() {
    var ρσ_anonfunc = function (x) {
        try {
            return (ρσ_expr_temp = this._store)[ρσ_bound_index(ρσ_set_keyfor(x), ρσ_expr_temp)][1];
        } catch (ρσ_Exception) {
            ρσ_last_exception = ρσ_Exception;
            if (ρσ_Exception instanceof TypeError) {
                return undefined;
            } else {
                throw ρσ_Exception;
            }
        }
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict_polyfill.prototype.values = (function() {
    var ρσ_anonfunc = function (x) {
        var ans;
        ans = {'_keys': Object.keys(this._store), '_i':-1, '_s':this._store};
        ans[ρσ_iterator_symbol] = (function() {
            var ρσ_anonfunc = function () {
                return this;
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        ans["next"] = (function() {
            var ρσ_anonfunc = function () {
                this._i += 1;
                if (this._i >= this._keys.length) {
                    return {'done': true};
                }
                return {'done':false, 'value':this._s[this._keys[this._i]][1]};
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ans;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict_polyfill.prototype.keys = (function() {
    var ρσ_anonfunc = function (x) {
        var ans;
        ans = {'_keys': Object.keys(this._store), '_i':-1, '_s':this._store};
        ans[ρσ_iterator_symbol] = (function() {
            var ρσ_anonfunc = function () {
                return this;
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        ans["next"] = (function() {
            var ρσ_anonfunc = function () {
                this._i += 1;
                if (this._i >= this._keys.length) {
                    return {'done': true};
                }
                return {'done':false, 'value':this._s[this._keys[this._i]][0]};
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ans;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict_polyfill.prototype.entries = (function() {
    var ρσ_anonfunc = function (x) {
        var ans;
        ans = {'_keys': Object.keys(this._store), '_i':-1, '_s':this._store};
        ans[ρσ_iterator_symbol] = (function() {
            var ρσ_anonfunc = function () {
                return this;
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        ans["next"] = (function() {
            var ρσ_anonfunc = function () {
                this._i += 1;
                if (this._i >= this._keys.length) {
                    return {'done': true};
                }
                return {'done':false, 'value':this._s[this._keys[this._i]]};
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ans;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
if (typeof Map !== "function" || typeof Map.prototype.delete !== "function") {
    ρσ_dict_implementation = ρσ_dict_polyfill;
} else {
    ρσ_dict_implementation = Map;
}
function ρσ_dict() {
    var iterable = ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true) ? undefined : arguments[0];
    var kw = arguments[arguments.length-1];
    if (kw === null || typeof kw !== "object" || kw [ρσ_kwargs_symbol] !== true) kw = {};
    if (this instanceof ρσ_dict) {
        this.jsmap = new ρσ_dict_implementation;
        if (iterable !== undefined) {
            this.update(iterable);
        }
        this.update(kw);
        return this;
    } else {
        return ρσ_interpolate_kwargs_constructor.call(Object.create(ρσ_dict.prototype), false, ρσ_dict, [iterable].concat([ρσ_desugar_kwargs(kw)]));
    }
};
if (!ρσ_dict.__handles_kwarg_interpolation__) Object.defineProperties(ρσ_dict, {
    __handles_kwarg_interpolation__ : {value: true},
    __argnames__ : {value: ["iterable"]},
    __module__ : {value: "__main__"}
});

ρσ_dict.prototype.__name__ = "dict";
Object.defineProperties(ρσ_dict.prototype, (function(){
    var ρσ_d = {};
    ρσ_d["length"] = (function(){
        var ρσ_d = {};
        ρσ_d["get"] = (function() {
            var ρσ_anonfunc = function () {
                return this.jsmap.size;
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ρσ_d;
    }).call(this);
    ρσ_d["size"] = (function(){
        var ρσ_d = {};
        ρσ_d["get"] = (function() {
            var ρσ_anonfunc = function () {
                return this.jsmap.size;
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
        return ρσ_d;
    }).call(this);
    return ρσ_d;
}).call(this));
ρσ_dict.prototype.__len__ = (function() {
    var ρσ_anonfunc = function () {
        return this.jsmap.size;
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.has = ρσ_dict.prototype.__contains__ = (function() {
    var ρσ_anonfunc = function (x) {
        return this.jsmap.has(x);
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["x"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.set = ρσ_dict.prototype.__setitem__ = (function() {
    var ρσ_anonfunc = function (key, value) {
        this.jsmap.set(key, value);
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["key", "value"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.__delitem__ = (function() {
    var ρσ_anonfunc = function (key) {
        this.jsmap.delete(key);
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["key"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.clear = (function() {
    var ρσ_anonfunc = function () {
        this.jsmap.clear();
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.copy = (function() {
    var ρσ_anonfunc = function () {
        return ρσ_dict(this);
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.keys = (function() {
    var ρσ_anonfunc = function () {
        return this.jsmap.keys();
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.values = (function() {
    var ρσ_anonfunc = function () {
        return this.jsmap.values();
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.items = ρσ_dict.prototype.entries = (function() {
    var ρσ_anonfunc = function () {
        return this.jsmap.entries();
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype[ρσ_iterator_symbol] = (function() {
    var ρσ_anonfunc = function () {
        return this.jsmap.keys();
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.__getitem__ = (function() {
    var ρσ_anonfunc = function (key) {
        var ans;
        ans = this.jsmap.get(key);
        if (ans === undefined && !this.jsmap.has(key)) {
            throw new KeyError(key + "");
        }
        return ans;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["key"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.get = (function() {
    var ρσ_anonfunc = function (key, defval) {
        var ans;
        ans = this.jsmap.get(key);
        if (ans === undefined && !this.jsmap.has(key)) {
            return (defval === undefined) ? null : defval;
        }
        return ans;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["key", "defval"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.set_default = ρσ_dict.prototype.setdefault = (function() {
    var ρσ_anonfunc = function (key, defval) {
        var j;
        j = this.jsmap;
        if (!j.has(key)) {
            j.set(key, defval);
            return defval;
        }
        return j.get(key);
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["key", "defval"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.fromkeys = ρσ_dict.prototype.fromkeys = (function() {
    var ρσ_anonfunc = function () {
        var iterable = ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true) ? undefined : arguments[0];
        var value = (arguments[1] === undefined || ( 1 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? ρσ_anonfunc.__defaults__.value : arguments[1];
        var ρσ_kwargs_obj = arguments[arguments.length-1];
        if (ρσ_kwargs_obj === null || typeof ρσ_kwargs_obj !== "object" || ρσ_kwargs_obj [ρσ_kwargs_symbol] !== true) ρσ_kwargs_obj = {};
        if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "value")){
            value = ρσ_kwargs_obj.value;
        }
        var ans, iterator, r;
        ans = ρσ_dict();
        iterator = iter(iterable);
        r = iterator.next();
        while (!r.done) {
            ans.set(r.value, value);
            r = iterator.next();
        }
        return ans;
    };
    if (!ρσ_anonfunc.__defaults__) Object.defineProperties(ρσ_anonfunc, {
        __defaults__ : {value: {value:null}},
        __handles_kwarg_interpolation__ : {value: true},
        __argnames__ : {value: ["iterable", "value"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.pop = (function() {
    var ρσ_anonfunc = function (key, defval) {
        var ans;
        ans = this.jsmap.get(key);
        if (ans === undefined && !this.jsmap.has(key)) {
            if (defval === undefined) {
                throw new KeyError(key);
            }
            return defval;
        }
        this.jsmap.delete(key);
        return ans;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["key", "defval"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.popitem = (function() {
    var ρσ_anonfunc = function () {
        var last, e, r;
        last = null;
        e = this.jsmap.entries();
        while (true) {
            r = e.next();
            if (r.done) {
                if (last === null) {
                    throw new KeyError("dict is empty");
                }
                this.jsmap.delete(last.value[0]);
                return last.value;
            }
            last = r;
        }
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.update = (function() {
    var ρσ_anonfunc = function () {
        var m, iterable, iterator, result, keys;
        if (arguments.length === 0) {
            return;
        }
        m = this.jsmap;
        iterable = arguments[0];
        if (Array.isArray(iterable)) {
            for (var i = 0; i < iterable.length; i++) {
                m.set(iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i][0], iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i][1]);
            }
        } else if (iterable instanceof ρσ_dict) {
            iterator = iterable.items();
            result = iterator.next();
            while (!result.done) {
                m.set(result.value[0], result.value[1]);
                result = iterator.next();
            }
        } else if (typeof Map === "function" && iterable instanceof Map) {
            iterator = iterable.entries();
            result = iterator.next();
            while (!result.done) {
                m.set(result.value[0], result.value[1]);
                result = iterator.next();
            }
        } else if (typeof iterable[ρσ_iterator_symbol] === "function") {
            iterator = iterable[ρσ_iterator_symbol]();
            result = iterator.next();
            while (!result.done) {
                m.set(result.value[0], result.value[1]);
                result = iterator.next();
            }
        } else {
            keys = Object.keys(iterable);
            for (var j=0; j < keys.length; j++) {
                if (keys[(typeof j === "number" && j < 0) ? keys.length + j : j] !== ρσ_iterator_symbol) {
                    m.set(keys[(typeof j === "number" && j < 0) ? keys.length + j : j], iterable[ρσ_bound_index(keys[(typeof j === "number" && j < 0) ? keys.length + j : j], iterable)]);
                }
            }
        }
        if (arguments.length > 1) {
            ρσ_dict.prototype.update.call(this, arguments[1]);
        }
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.toString = ρσ_dict.prototype.inspect = ρσ_dict.prototype.__str__ = ρσ_dict.prototype.__repr__ = (function() {
    var ρσ_anonfunc = function () {
        var entries, iterator, r;
        entries = [];
        iterator = this.jsmap.entries();
        r = iterator.next();
        while (!r.done) {
            entries.push(ρσ_repr(r.value[0]) + ": " + ρσ_repr(r.value[1]));
            r = iterator.next();
        }
        return "{" + entries.join(", ") + "}";
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.__eq__ = (function() {
    var ρσ_anonfunc = function (other) {
        var iterator, r, x;
        if (!(other instanceof this.constructor)) {
            return false;
        }
        if (other.size !== this.size) {
            return false;
        }
        if (other.size === 0) {
            return true;
        }
        iterator = other.items();
        r = iterator.next();
        while (!r.done) {
            x = this.jsmap.get(r.value[0]);
            if (x === undefined && !this.jsmap.has(r.value[0]) || x !== r.value[1]) {
                return false;
            }
            r = iterator.next();
        }
        return true;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["other"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
ρσ_dict.prototype.as_object = (function() {
    var ρσ_anonfunc = function (other) {
        var ans, iterator, r;
        ans = {};
        iterator = this.jsmap.entries();
        r = iterator.next();
        while (!r.done) {
            ans[ρσ_bound_index(r.value[0], ans)] = r.value[1];
            r = iterator.next();
        }
        return ans;
    };
    if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
        __argnames__ : {value: ["other"]},
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})();
function ρσ_dict_wrap(x) {
    var ans;
    ans = new ρσ_dict;
    ans.jsmap = x;
    return ans;
};
if (!ρσ_dict_wrap.__argnames__) Object.defineProperties(ρσ_dict_wrap, {
    __argnames__ : {value: ["x"]},
    __module__ : {value: "__main__"}
});

var dict = ρσ_dict, dict_wrap = ρσ_dict_wrap;// }}}
var NameError;
NameError = ReferenceError;
function Exception() {
    if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});
    Exception.prototype.__init__.apply(this, arguments);
}
ρσ_extends(Exception, Error);
Exception.prototype.__init__ = function __init__(message) {
    var self = this;
    self.message = message;
    self.stack = (new Error).stack;
    self.name = self.constructor.name;
};
if (!Exception.prototype.__init__.__argnames__) Object.defineProperties(Exception.prototype.__init__, {
    __argnames__ : {value: ["message"]},
    __module__ : {value: "__main__"}
});
Exception.__argnames__ = Exception.prototype.__init__.__argnames__;
Exception.__handles_kwarg_interpolation__ = Exception.prototype.__init__.__handles_kwarg_interpolation__;
Exception.prototype.__repr__ = function __repr__() {
    var self = this;
    return self.name + ": " + self.message;
};
if (!Exception.prototype.__repr__.__module__) Object.defineProperties(Exception.prototype.__repr__, {
    __module__ : {value: "__main__"}
});
Exception.prototype.__str__ = function __str__ () {
    if(Error.prototype.__str__) return Error.prototype.__str__.call(this);
return this.__repr__();
};
Object.defineProperty(Exception.prototype, "__bases__", {value: [Error]});

function AttributeError() {
    if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});
    AttributeError.prototype.__init__.apply(this, arguments);
}
ρσ_extends(AttributeError, Exception);
AttributeError.prototype.__init__ = function __init__ () {
    Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);
};
AttributeError.prototype.__repr__ = function __repr__ () {
    if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);
    return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";
};
AttributeError.prototype.__str__ = function __str__ () {
    if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);
return this.__repr__();
};
Object.defineProperty(AttributeError.prototype, "__bases__", {value: [Exception]});


function IndexError() {
    if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});
    IndexError.prototype.__init__.apply(this, arguments);
}
ρσ_extends(IndexError, Exception);
IndexError.prototype.__init__ = function __init__ () {
    Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);
};
IndexError.prototype.__repr__ = function __repr__ () {
    if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);
    return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";
};
IndexError.prototype.__str__ = function __str__ () {
    if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);
return this.__repr__();
};
Object.defineProperty(IndexError.prototype, "__bases__", {value: [Exception]});


function KeyError() {
    if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});
    KeyError.prototype.__init__.apply(this, arguments);
}
ρσ_extends(KeyError, Exception);
KeyError.prototype.__init__ = function __init__ () {
    Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);
};
KeyError.prototype.__repr__ = function __repr__ () {
    if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);
    return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";
};
KeyError.prototype.__str__ = function __str__ () {
    if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);
return this.__repr__();
};
Object.defineProperty(KeyError.prototype, "__bases__", {value: [Exception]});


function ValueError() {
    if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});
    ValueError.prototype.__init__.apply(this, arguments);
}
ρσ_extends(ValueError, Exception);
ValueError.prototype.__init__ = function __init__ () {
    Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);
};
ValueError.prototype.__repr__ = function __repr__ () {
    if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);
    return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";
};
ValueError.prototype.__str__ = function __str__ () {
    if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);
return this.__repr__();
};
Object.defineProperty(ValueError.prototype, "__bases__", {value: [Exception]});


function UnicodeDecodeError() {
    if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});
    UnicodeDecodeError.prototype.__init__.apply(this, arguments);
}
ρσ_extends(UnicodeDecodeError, Exception);
UnicodeDecodeError.prototype.__init__ = function __init__ () {
    Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);
};
UnicodeDecodeError.prototype.__repr__ = function __repr__ () {
    if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);
    return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";
};
UnicodeDecodeError.prototype.__str__ = function __str__ () {
    if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);
return this.__repr__();
};
Object.defineProperty(UnicodeDecodeError.prototype, "__bases__", {value: [Exception]});


function AssertionError() {
    if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});
    AssertionError.prototype.__init__.apply(this, arguments);
}
ρσ_extends(AssertionError, Exception);
AssertionError.prototype.__init__ = function __init__ () {
    Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);
};
AssertionError.prototype.__repr__ = function __repr__ () {
    if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);
    return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";
};
AssertionError.prototype.__str__ = function __str__ () {
    if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);
return this.__repr__();
};
Object.defineProperty(AssertionError.prototype, "__bases__", {value: [Exception]});


function ZeroDivisionError() {
    if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});
    ZeroDivisionError.prototype.__init__.apply(this, arguments);
}
ρσ_extends(ZeroDivisionError, Exception);
ZeroDivisionError.prototype.__init__ = function __init__ () {
    Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);
};
ZeroDivisionError.prototype.__repr__ = function __repr__ () {
    if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);
    return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";
};
ZeroDivisionError.prototype.__str__ = function __str__ () {
    if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);
return this.__repr__();
};
Object.defineProperty(ZeroDivisionError.prototype, "__bases__", {value: [Exception]});

var ρσ_in, ρσ_desugar_kwargs, ρσ_exists;
function ρσ_eslice(arr, step, start, end) {
    var is_string;
    if (typeof arr === "string" || arr instanceof String) {
        is_string = true;
        arr = arr.split("");
    }
    if (step < 0) {
        step = -step;
        arr = arr.slice().reverse();
        if (typeof start !== "undefined") {
            start = arr.length - start - 1;
        }
        if (typeof end !== "undefined") {
            end = arr.length - end - 1;
        }
    }
    if (typeof start === "undefined") {
        start = 0;
    }
    if (typeof end === "undefined") {
        end = arr.length;
    }
    arr = arr.slice(start, end).filter((function() {
        var ρσ_anonfunc = function (e, i) {
            return i % step === 0;
        };
        if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
            __argnames__ : {value: ["e", "i"]},
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })());
    if (is_string) {
        arr = arr.join("");
    }
    return arr;
};
if (!ρσ_eslice.__argnames__) Object.defineProperties(ρσ_eslice, {
    __argnames__ : {value: ["arr", "step", "start", "end"]},
    __module__ : {value: "__main__"}
});

function ρσ_delslice(arr, step, start, end) {
    var is_string, ρσ_unpack, indices;
    if (typeof arr === "string" || arr instanceof String) {
        is_string = true;
        arr = arr.split("");
    }
    if (step < 0) {
        if (typeof start === "undefined") {
            start = arr.length;
        }
        if (typeof end === "undefined") {
            end = 0;
        }
        ρσ_unpack = [end, start, -step];
        start = ρσ_unpack[0];
        end = ρσ_unpack[1];
        step = ρσ_unpack[2];
    }
    if (typeof start === "undefined") {
        start = 0;
    }
    if (typeof end === "undefined") {
        end = arr.length;
    }
    if (step === 1) {
        arr.splice(start, end - start);
    } else {
        if (end > start) {
            indices = [];
            for (var i = start; i < end; i += step) {
                indices.push(i);
            }
            for (var i = indices.length - 1; i >= 0; i--) {
                arr.splice(indices[(typeof i === "number" && i < 0) ? indices.length + i : i], 1);
            }
        }
    }
    if (is_string) {
        arr = arr.join("");
    }
    return arr;
};
if (!ρσ_delslice.__argnames__) Object.defineProperties(ρσ_delslice, {
    __argnames__ : {value: ["arr", "step", "start", "end"]},
    __module__ : {value: "__main__"}
});

function ρσ_flatten(arr) {
    var ans, value;
    ans = ρσ_list_decorate([]);
    for (var i=0; i < arr.length; i++) {
        value = arr[(typeof i === "number" && i < 0) ? arr.length + i : i];
        if (Array.isArray(value)) {
            ans = ans.concat(ρσ_flatten(value));
        } else {
            ans.push(value);
        }
    }
    return ans;
};
if (!ρσ_flatten.__argnames__) Object.defineProperties(ρσ_flatten, {
    __argnames__ : {value: ["arr"]},
    __module__ : {value: "__main__"}
});

function ρσ_unpack_asarray(num, iterable) {
    var ans, iterator, result;
    if (ρσ_arraylike(iterable)) {
        return iterable;
    }
    ans = [];
    if (typeof iterable[ρσ_iterator_symbol] === "function") {
        iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();
        result = iterator.next();
        while (!result.done && ans.length < num) {
            ans.push(result.value);
            result = iterator.next();
        }
    }
    return ans;
};
if (!ρσ_unpack_asarray.__argnames__) Object.defineProperties(ρσ_unpack_asarray, {
    __argnames__ : {value: ["num", "iterable"]},
    __module__ : {value: "__main__"}
});

function ρσ_extends(child, parent) {
    child.prototype = Object.create(parent.prototype);
    child.prototype.constructor = child;
};
if (!ρσ_extends.__argnames__) Object.defineProperties(ρσ_extends, {
    __argnames__ : {value: ["child", "parent"]},
    __module__ : {value: "__main__"}
});

ρσ_in = (function() {
    var ρσ_anonfunc = function () {
        if (typeof Map === "function" && typeof Set === "function") {
            return (function() {
                var ρσ_anonfunc = function (val, arr) {
                    if (typeof arr === "string") {
                        return arr.indexOf(val) !== -1;
                    }
                    if (typeof arr.__contains__ === "function") {
                        return arr.__contains__(val);
                    }
                    if (arr instanceof Map || arr instanceof Set) {
                        return arr.has(val);
                    }
                    if (ρσ_arraylike(arr)) {
                        return ρσ_list_contains.call(arr, val);
                    }
                    return Object.prototype.hasOwnProperty.call(arr, val);
                };
                if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
                    __argnames__ : {value: ["val", "arr"]},
                    __module__ : {value: "__main__"}
                });
                return ρσ_anonfunc;
            })();
        }
        return (function() {
            var ρσ_anonfunc = function (val, arr) {
                if (typeof arr === "string") {
                    return arr.indexOf(val) !== -1;
                }
                if (typeof arr.__contains__ === "function") {
                    return arr.__contains__(val);
                }
                if (ρσ_arraylike(arr)) {
                    return ρσ_list_contains.call(arr, val);
                }
                return Object.prototype.hasOwnProperty.call(arr, val);
            };
            if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
                __argnames__ : {value: ["val", "arr"]},
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})()();
function ρσ_Iterable(iterable) {
    var iterator, ans, result;
    if (ρσ_arraylike(iterable)) {
        return iterable;
    }
    if (typeof iterable[ρσ_iterator_symbol] === "function") {
        iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();
        ans = ρσ_list_decorate([]);
        result = iterator.next();
        while (!result.done) {
            ans.push(result.value);
            result = iterator.next();
        }
        return ans;
    }
    return Object.keys(iterable);
};
if (!ρσ_Iterable.__argnames__) Object.defineProperties(ρσ_Iterable, {
    __argnames__ : {value: ["iterable"]},
    __module__ : {value: "__main__"}
});

ρσ_desugar_kwargs = (function() {
    var ρσ_anonfunc = function () {
        if (typeof Object.assign === "function") {
            return (function() {
                var ρσ_anonfunc = function () {
                    var ans;
                    ans = Object.create(null);
                    ans[ρσ_kwargs_symbol] = true;
                    for (var i = 0; i < arguments.length; i++) {
                        Object.assign(ans, arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]);
                    }
                    return ans;
                };
                if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                    __module__ : {value: "__main__"}
                });
                return ρσ_anonfunc;
            })();
        }
        return (function() {
            var ρσ_anonfunc = function () {
                var ans, keys;
                ans = Object.create(null);
                ans[ρσ_kwargs_symbol] = true;
                for (var i = 0; i < arguments.length; i++) {
                    keys = Object.keys(arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]);
                    for (var j = 0; j < keys.length; j++) {
                        ans[ρσ_bound_index(keys[(typeof j === "number" && j < 0) ? keys.length + j : j], ans)] = (ρσ_expr_temp = arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i])[ρσ_bound_index(keys[(typeof j === "number" && j < 0) ? keys.length + j : j], ρσ_expr_temp)];
                    }
                }
                return ans;
            };
            if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                __module__ : {value: "__main__"}
            });
            return ρσ_anonfunc;
        })();
    };
    if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
        __module__ : {value: "__main__"}
    });
    return ρσ_anonfunc;
})()();
function ρσ_interpolate_kwargs(f, supplied_args) {
    var has_prop, kwobj, args, prop;
    if (!f.__argnames__) {
        return f.apply(this, supplied_args);
    }
    has_prop = Object.prototype.hasOwnProperty;
    kwobj = supplied_args.pop();
    if (f.__handles_kwarg_interpolation__) {
        args = new Array(Math.max(supplied_args.length, f.__argnames__.length) + 1);
        args[args.length-1] = kwobj;
        for (var i = 0; i < args.length - 1; i++) {
            if (i < f.__argnames__.length) {
                prop = (ρσ_expr_temp = f.__argnames__)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];
                if (has_prop.call(kwobj, prop)) {
                    args[(typeof i === "number" && i < 0) ? args.length + i : i] = kwobj[(typeof prop === "number" && prop < 0) ? kwobj.length + prop : prop];
                    delete kwobj[prop];
                } else if (i < supplied_args.length) {
                    args[(typeof i === "number" && i < 0) ? args.length + i : i] = supplied_args[(typeof i === "number" && i < 0) ? supplied_args.length + i : i];
                }
            } else {
                args[(typeof i === "number" && i < 0) ? args.length + i : i] = supplied_args[(typeof i === "number" && i < 0) ? supplied_args.length + i : i];
            }
        }
        return f.apply(this, args);
    }
    for (var i = 0; i < f.__argnames__.length; i++) {
        prop = (ρσ_expr_temp = f.__argnames__)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];
        if (has_prop.call(kwobj, prop)) {
            supplied_args[(typeof i === "number" && i < 0) ? supplied_args.length + i : i] = kwobj[(typeof prop === "number" && prop < 0) ? kwobj.length + prop : prop];
        }
    }
    return f.apply(this, supplied_args);
};
if (!ρσ_interpolate_kwargs.__argnames__) Object.defineProperties(ρσ_interpolate_kwargs, {
    __argnames__ : {value: ["f", "supplied_args"]},
    __module__ : {value: "__main__"}
});

function ρσ_interpolate_kwargs_constructor(apply, f, supplied_args) {
    if (apply) {
        f.apply(this, supplied_args);
    } else {
        ρσ_interpolate_kwargs.call(this, f, supplied_args);
    }
    return this;
};
if (!ρσ_interpolate_kwargs_constructor.__argnames__) Object.defineProperties(ρσ_interpolate_kwargs_constructor, {
    __argnames__ : {value: ["apply", "f", "supplied_args"]},
    __module__ : {value: "__main__"}
});

function ρσ_getitem(obj, key) {
    if (obj.__getitem__) {
        return obj.__getitem__(key);
    }
    if (typeof key === "number" && key < 0) {
        key += obj.length;
    }
    return obj[(typeof key === "number" && key < 0) ? obj.length + key : key];
};
if (!ρσ_getitem.__argnames__) Object.defineProperties(ρσ_getitem, {
    __argnames__ : {value: ["obj", "key"]},
    __module__ : {value: "__main__"}
});

function ρσ_setitem(obj, key, val) {
    if (obj.__setitem__) {
        obj.__setitem__(key, val);
    } else {
        if (typeof key === "number" && key < 0) {
            key += obj.length;
        }
        obj[(typeof key === "number" && key < 0) ? obj.length + key : key] = val;
    }
    return val;
};
if (!ρσ_setitem.__argnames__) Object.defineProperties(ρσ_setitem, {
    __argnames__ : {value: ["obj", "key", "val"]},
    __module__ : {value: "__main__"}
});

function ρσ_delitem(obj, key) {
    if (obj.__delitem__) {
        obj.__delitem__(key);
    } else if (typeof obj.splice === "function") {
        obj.splice(key, 1);
    } else {
        if (typeof key === "number" && key < 0) {
            key += obj.length;
        }
        delete obj[key];
    }
};
if (!ρσ_delitem.__argnames__) Object.defineProperties(ρσ_delitem, {
    __argnames__ : {value: ["obj", "key"]},
    __module__ : {value: "__main__"}
});

function ρσ_bound_index(idx, arr) {
    if (typeof idx === "number" && idx < 0) {
        idx += arr.length;
    }
    return idx;
};
if (!ρσ_bound_index.__argnames__) Object.defineProperties(ρσ_bound_index, {
    __argnames__ : {value: ["idx", "arr"]},
    __module__ : {value: "__main__"}
});

function ρσ_splice(arr, val, start, end) {
    start = start || 0;
    if (start < 0) {
        start += arr.length;
    }
    if (end === undefined) {
        end = arr.length;
    }
    if (end < 0) {
        end += arr.length;
    }
    Array.prototype.splice.apply(arr, [start, end - start].concat(val));
};
if (!ρσ_splice.__argnames__) Object.defineProperties(ρσ_splice, {
    __argnames__ : {value: ["arr", "val", "start", "end"]},
    __module__ : {value: "__main__"}
});

ρσ_exists = (function(){
    var ρσ_d = {};
    ρσ_d["n"] = (function() {
        var ρσ_anonfunc = function (expr) {
            return expr !== undefined && expr !== null;
        };
        if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
            __argnames__ : {value: ["expr"]},
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
    ρσ_d["d"] = (function() {
        var ρσ_anonfunc = function (expr) {
            if (expr === undefined || expr === null) {
                return Object.create(null);
            }
            return expr;
        };
        if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
            __argnames__ : {value: ["expr"]},
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
    ρσ_d["c"] = (function() {
        var ρσ_anonfunc = function (expr) {
            if (typeof expr === "function") {
                return expr;
            }
            return (function() {
                var ρσ_anonfunc = function () {
                    return undefined;
                };
                if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                    __module__ : {value: "__main__"}
                });
                return ρσ_anonfunc;
            })();
        };
        if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
            __argnames__ : {value: ["expr"]},
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
    ρσ_d["g"] = (function() {
        var ρσ_anonfunc = function (expr) {
            if (expr === undefined || expr === null || typeof expr.__getitem__ !== "function") {
                return (function(){
                    var ρσ_d = {};
                    ρσ_d["__getitem__"] = (function() {
                        var ρσ_anonfunc = function () {
                            return undefined;
                        };
                        if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
                            __module__ : {value: "__main__"}
                        });
                        return ρσ_anonfunc;
                    })();
                    return ρσ_d;
                }).call(this);
            }
        };
        if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
            __argnames__ : {value: ["expr"]},
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
    ρσ_d["e"] = (function() {
        var ρσ_anonfunc = function (expr, alt) {
            return (expr === undefined || expr === null) ? alt : expr;
        };
        if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
            __argnames__ : {value: ["expr", "alt"]},
            __module__ : {value: "__main__"}
        });
        return ρσ_anonfunc;
    })();
    return ρσ_d;
}).call(this);
function ρσ_mixin() {
    var seen, resolved_props, p, target, props, name;
    seen = Object.create(null);
    seen.__argnames__ = seen.__handles_kwarg_interpolation__ = seen.__init__ = seen.__annotations__ = seen.__doc__ = seen.__bind_methods__ = seen.__bases__ = seen.constructor = seen.__class__ = true;
    resolved_props = {};
    p = target = arguments[0].prototype;
    while (p && p !== Object.prototype) {
        props = Object.getOwnPropertyNames(p);
        for (var i = 0; i < props.length; i++) {
            seen[ρσ_bound_index(props[(typeof i === "number" && i < 0) ? props.length + i : i], seen)] = true;
        }
        p = Object.getPrototypeOf(p);
    }
    for (var c = 1; c < arguments.length; c++) {
        p = arguments[(typeof c === "number" && c < 0) ? arguments.length + c : c].prototype;
        while (p && p !== Object.prototype) {
            props = Object.getOwnPropertyNames(p);
            for (var i = 0; i < props.length; i++) {
                name = props[(typeof i === "number" && i < 0) ? props.length + i : i];
                if (seen[(typeof name === "number" && name < 0) ? seen.length + name : name]) {
                    continue;
                }
                seen[(typeof name === "number" && name < 0) ? seen.length + name : name] = true;
                resolved_props[(typeof name === "number" && name < 0) ? resolved_props.length + name : name] = Object.getOwnPropertyDescriptor(p, name);
            }
            p = Object.getPrototypeOf(p);
        }
    }
    Object.defineProperties(target, resolved_props);
};
if (!ρσ_mixin.__module__) Object.defineProperties(ρσ_mixin, {
    __module__ : {value: "__main__"}
});

function ρσ_instanceof() {
    var obj, bases, q, cls, p;
    obj = arguments[0];
    bases = "";
    if (obj && obj.constructor && obj.constructor.prototype) {
        bases = obj.constructor.prototype.__bases__ || "";
    }
    for (var i = 1; i < arguments.length; i++) {
        q = arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i];
        if (obj instanceof q) {
            return true;
        }
        if ((q === Array || q === ρσ_list_constructor) && Array.isArray(obj)) {
            return true;
        }
        if (q === ρσ_str && (typeof obj === "string" || obj instanceof String)) {
            return true;
        }
        if (q === ρσ_int && typeof obj === "number" && Number.isInteger(obj)) {
            return true;
        }
        if (q === ρσ_float && typeof obj === "number" && !Number.isInteger(obj)) {
            return true;
        }
        if (bases.length > 1) {
            for (var c = 1; c < bases.length; c++) {
                cls = bases[(typeof c === "number" && c < 0) ? bases.length + c : c];
                while (cls) {
              
Download .txt
gitextract_5ar8r793/

├── .agignore
├── .github/
│   └── workflows/
│       └── ci.yml
├── .gitignore
├── =template.pyj
├── CHANGELOG.md
├── CONTRIBUTORS
├── HACKING.md
├── LICENSE
├── README.md
├── add-toc-to-readme
├── bin/
│   ├── export
│   ├── rapydscript
│   └── web-repl-export
├── build
├── package.json
├── publish.py
├── release/
│   ├── baselib-plain-pretty.js
│   ├── baselib-plain-ugly.js
│   ├── compiler.js
│   └── signatures.json
├── session.vim
├── setup.cfg
├── src/
│   ├── ast.pyj
│   ├── baselib-builtins.pyj
│   ├── baselib-containers.pyj
│   ├── baselib-errors.pyj
│   ├── baselib-internal.pyj
│   ├── baselib-itertools.pyj
│   ├── baselib-str.pyj
│   ├── compiler.pyj
│   ├── errors.pyj
│   ├── lib/
│   │   ├── aes.pyj
│   │   ├── elementmaker.pyj
│   │   ├── encodings.pyj
│   │   ├── gettext.pyj
│   │   ├── math.pyj
│   │   ├── operator.pyj
│   │   ├── pythonize.pyj
│   │   ├── random.pyj
│   │   ├── re.pyj
│   │   ├── traceback.pyj
│   │   └── uuid.pyj
│   ├── output/
│   │   ├── __init__.pyj
│   │   ├── classes.pyj
│   │   ├── codegen.pyj
│   │   ├── comments.pyj
│   │   ├── exceptions.pyj
│   │   ├── functions.pyj
│   │   ├── literals.pyj
│   │   ├── loops.pyj
│   │   ├── modules.pyj
│   │   ├── operators.pyj
│   │   ├── statements.pyj
│   │   ├── stream.pyj
│   │   └── utils.pyj
│   ├── parse.pyj
│   ├── string_interpolation.pyj
│   ├── tokenizer.pyj
│   ├── unicode_aliases.pyj
│   └── utils.pyj
├── test/
│   ├── _import_one.pyj
│   ├── _import_two/
│   │   ├── __init__.pyj
│   │   ├── level2/
│   │   │   ├── __init__.pyj
│   │   │   └── deep.pyj
│   │   ├── other.pyj
│   │   └── sub.pyj
│   ├── aes_vectors.pyj
│   ├── annotations.pyj
│   ├── baselib.pyj
│   ├── classes.pyj
│   ├── collections.pyj
│   ├── decorators.pyj
│   ├── docstrings.pyj
│   ├── elementmaker_test.pyj
│   ├── functions.pyj
│   ├── generators.pyj
│   ├── generic.pyj
│   ├── imports.pyj
│   ├── internationalization.pyj
│   ├── lint.pyj
│   ├── loops.pyj
│   ├── regexp.pyj
│   ├── repl.pyj
│   ├── scoped_flags.pyj
│   ├── starargs.pyj
│   └── str.pyj
├── tools/
│   ├── cli.js
│   ├── compile.js
│   ├── compiler.js
│   ├── completer.js
│   ├── embedded_compiler.js
│   ├── export.js
│   ├── gettext.js
│   ├── ini.js
│   ├── lint.js
│   ├── msgfmt.js
│   ├── repl.js
│   ├── self.js
│   ├── test.js
│   ├── utils.js
│   └── web_repl.js
├── try
└── web-repl/
    ├── env.js
    ├── index.html
    ├── main.js
    ├── prism.css
    ├── prism.js
    └── sha1.js
Download .txt
SYMBOL INDEX (649 symbols across 19 files)

FILE: release/baselib-plain-pretty.js
  function ρσ_bool (line 2) | function ρσ_bool(val) {
  function ρσ_print (line 10) | function ρσ_print() {
  function ρσ_int (line 24) | function ρσ_int(val, base) {
  function ρσ_float (line 41) | function ρσ_float(val) {
  function ρσ_arraylike_creator (line 58) | function ρσ_arraylike_creator() {
  function options_object (line 82) | function options_object(f) {
  function ρσ_id (line 101) | function ρσ_id(x) {
  function ρσ_dir (line 109) | function ρσ_dir(item) {
  function ρσ_ord (line 122) | function ρσ_ord(x) {
  function ρσ_chr (line 139) | function ρσ_chr(code) {
  function ρσ_callable (line 151) | function ρσ_callable(x) {
  function ρσ_bin (line 159) | function ρσ_bin(x) {
  function ρσ_hex (line 177) | function ρσ_hex(x) {
  function ρσ_enumerate (line 195) | function ρσ_enumerate(iterable) {
  function ρσ_reversed (line 250) | function ρσ_reversed(iterable) {
  function ρσ_iter (line 285) | function ρσ_iter(iterable) {
  function ρσ_range_next (line 323) | function ρσ_range_next(step, length) {
  function ρσ_range (line 340) | function ρσ_range(start, stop, step) {
  function ρσ_getattr (line 451) | function ρσ_getattr(obj, name, defval) {
  function ρσ_setattr (line 479) | function ρσ_setattr(obj, name, value) {
  function ρσ_hasattr (line 487) | function ρσ_hasattr(obj, name) {
  function len (line 497) | function len(obj) {
  function len5 (line 514) | function len5(obj) {
  function ρσ_get_module (line 535) | function ρσ_get_module(name) {
  function ρσ_pow (line 543) | function ρσ_pow(x, y, z) {
  function ρσ_type (line 556) | function ρσ_type(x) {
  function ρσ_divmod (line 564) | function ρσ_divmod(x, y) {
  function ρσ_max (line 577) | function ρσ_max() {
  function ρσ_equals (line 624) | function ρσ_equals(a, b) {
  function ρσ_not_equals (line 668) | function ρσ_not_equals(a, b) {
  function ρσ_list_extend (line 686) | function ρσ_list_extend(iterable) {
  function ρσ_list_index (line 708) | function ρσ_list_index(val, start, stop) {
  function ρσ_list_pop (line 734) | function ρσ_list_pop(index) {
  function ρσ_list_remove (line 753) | function ρσ_list_remove(value) {
  function ρσ_list_to_string (line 767) | function ρσ_list_to_string() {
  function ρσ_list_insert (line 774) | function ρσ_list_insert(index, val) {
  function ρσ_list_copy (line 793) | function ρσ_list_copy() {
  function ρσ_list_clear (line 800) | function ρσ_list_clear() {
  function ρσ_list_as_array (line 807) | function ρσ_list_as_array() {
  function ρσ_list_count (line 814) | function ρσ_list_count(value) {
  function ρσ_list_sort_key (line 831) | function ρσ_list_sort_key(value) {
  function ρσ_list_sort_cmp (line 844) | function ρσ_list_sort_cmp(a, b, ap, bp) {
  function ρσ_list_sort (line 858) | function ρσ_list_sort() {
  function ρσ_list_concat (line 897) | function ρσ_list_concat() {
  function ρσ_list_slice (line 907) | function ρσ_list_slice() {
  function ρσ_list_iterator (line 917) | function ρσ_list_iterator(value) {
  function ρσ_list_len (line 954) | function ρσ_list_len() {
  function ρσ_list_contains (line 961) | function ρσ_list_contains(val) {
  function ρσ_list_eq (line 974) | function ρσ_list_eq(other) {
  function ρσ_list_decorate (line 993) | function ρσ_list_decorate(ans) {
  function ρσ_list_constructor (line 1023) | function ρσ_list_constructor(iterable) {
  function sorted (line 1054) | function sorted() {
  function ρσ_set_keyfor (line 1079) | function ρσ_set_keyfor(x) {
  function ρσ_set_polyfill (line 1104) | function ρσ_set_polyfill() {
  function ρσ_set (line 1205) | function ρσ_set(iterable) {
  function ρσ_set_wrap (line 1625) | function ρσ_set_wrap(x) {
  function ρσ_dict_polyfill (line 1638) | function ρσ_dict_polyfill() {
  function ρσ_dict (line 1826) | function ρσ_dict() {
  function ρσ_dict_wrap (line 2199) | function ρσ_dict_wrap(x) {
  function Exception (line 2213) | function Exception() {
  function AttributeError (line 2243) | function AttributeError() {
  function IndexError (line 2262) | function IndexError() {
  function KeyError (line 2281) | function KeyError() {
  function ValueError (line 2300) | function ValueError() {
  function UnicodeDecodeError (line 2319) | function UnicodeDecodeError() {
  function AssertionError (line 2338) | function AssertionError() {
  function ZeroDivisionError (line 2357) | function ZeroDivisionError() {
  function ρσ_eslice (line 2376) | function ρσ_eslice(arr, step, start, end) {
  function ρσ_delslice (line 2418) | function ρσ_delslice(arr, step, start, end) {
  function ρσ_flatten (line 2465) | function ρσ_flatten(arr) {
  function ρσ_unpack_asarray (line 2483) | function ρσ_unpack_asarray(num, iterable) {
  function ρσ_extends (line 2504) | function ρσ_extends(child, parent) {
  function ρσ_Iterable (line 2564) | function ρσ_Iterable(iterable) {
  function ρσ_interpolate_kwargs (line 2629) | function ρσ_interpolate_kwargs(f, supplied_args) {
  function ρσ_interpolate_kwargs_constructor (line 2667) | function ρσ_interpolate_kwargs_constructor(apply, f, supplied_args) {
  function ρσ_getitem (line 2680) | function ρσ_getitem(obj, key) {
  function ρσ_setitem (line 2694) | function ρσ_setitem(obj, key, val) {
  function ρσ_delitem (line 2710) | function ρσ_delitem(obj, key) {
  function ρσ_bound_index (line 2727) | function ρσ_bound_index(idx, arr) {
  function ρσ_splice (line 2738) | function ρσ_splice(arr, val, start, end) {
  function ρσ_mixin (line 2838) | function ρσ_mixin() {
  function ρσ_instanceof (line 2872) | function ρσ_instanceof() {
  function sum (line 2917) | function sum(iterable, start) {
  function map (line 2945) | function map() {
  function filter (line 2986) | function filter(func_or_none, iterable) {
  function zip (line 3023) | function zip() {
  function any (line 3063) | function any(iterable) {
  function all (line 3079) | function all(iterable) {
  function ρσ_repr_js_builtin (line 3096) | function ρσ_repr_js_builtin(x, as_array) {
  function ρσ_html_element_to_string (line 3119) | function ρσ_html_element_to_string(elem) {
  function ρσ_repr (line 3143) | function ρσ_repr(x) {
  function ρσ_str (line 3199) | function ρσ_str(x) {
  function resolve (line 3289) | function resolve(arg, object) {
  function resolve_format_spec (line 3310) | function resolve_format_spec(format_spec) {
  function set_comma (line 3333) | function set_comma(ans, comma) {
  function safe_comma (line 3347) | function safe_comma(value, comma) {
  function safe_fixed (line 3362) | function safe_fixed(value, precision, comma) {
  function apply_formatting (line 3380) | function apply_formatting(value, format_spec) {
  function parse_markup (line 3558) | function parse_markup(markup) {
  function render_markup (line 3591) | function render_markup(markup) {

FILE: release/baselib-plain-ugly.js
  function ρσ_bool (line 1) | function ρσ_bool(val){return!!val}
  function ρσ_print (line 1) | function ρσ_print(){var parts;if(typeof console==="object"){parts=[];for...
  function ρσ_int (line 1) | function ρσ_int(val,base){var ans;if(typeof val==="number"){ans=val|0}el...
  function ρσ_float (line 1) | function ρσ_float(val){var ans;if(typeof val==="number"){ans=val}else{an...
  function ρσ_arraylike_creator (line 1) | function ρσ_arraylike_creator(){var names;names="Int8Array Uint8Array Ui...
  function options_object (line 1) | function options_object(f){return(function(){var ρσ_anonfunc=function(){...
  function ρσ_id (line 1) | function ρσ_id(x){return x.ρσ_object_id}
  function ρσ_dir (line 1) | function ρσ_dir(item){var arr;arr=ρσ_list_decorate([]);for(var i in item...
  function ρσ_ord (line 1) | function ρσ_ord(x){var ans,second;ans=x.charCodeAt(0);if(55296<=ans&&ans...
  function ρσ_chr (line 1) | function ρσ_chr(code){if(code<=65535){return String.fromCharCode(code)}c...
  function ρσ_callable (line 1) | function ρσ_callable(x){return typeof x === "function"}
  function ρσ_bin (line 1) | function ρσ_bin(x){var ans;if(typeof x!=="number"||x%1!==0){throw new Ty...
  function ρσ_hex (line 1) | function ρσ_hex(x){var ans;if(typeof x!=="number"||x%1!==0){throw new Ty...
  function ρσ_enumerate (line 1) | function ρσ_enumerate(iterable){var ans,iterator;ans={"_i":-1};ans[ρσ_it...
  function ρσ_reversed (line 1) | function ρσ_reversed(iterable){var ans;if(ρσ_arraylike(iterable)){ans={"...
  function ρσ_iter (line 1) | function ρσ_iter(iterable){var ans;if(typeof iterable[ρσ_iterator_symbol...
  function ρσ_range_next (line 1) | function ρσ_range_next(step,length){var ρσ_unpack;this._i+=step;this._id...
  function ρσ_range (line 1) | function ρσ_range(start,stop,step){var length,ans;if(arguments.length<=1...
  function ρσ_getattr (line 1) | function ρσ_getattr(obj,name,defval){var ret;try{ret=obj[(typeof name===...
  function ρσ_setattr (line 1) | function ρσ_setattr(obj,name,value){obj[(typeof name==="number"&&name<0)...
  function ρσ_hasattr (line 1) | function ρσ_hasattr(obj,name){return name in obj}
  function len (line 1) | function len(obj){if(ρσ_arraylike(obj)){return obj.length}if(typeof obj....
  function len5 (line 1) | function len5(obj){if(ρσ_arraylike(obj)){return obj.length}if(typeof obj...
  function ρσ_get_module (line 1) | function ρσ_get_module(name){return ρσ_modules[(typeof name==="number"&&...
  function ρσ_pow (line 1) | function ρσ_pow(x,y,z){var ans;ans=Math.pow(x,y);if(z!==undefined){ans%=...
  function ρσ_type (line 1) | function ρσ_type(x){return x.constructor}
  function ρσ_divmod (line 1) | function ρσ_divmod(x,y){var d;if(y===0){throw new ZeroDivisionError("int...
  function ρσ_max (line 1) | function ρσ_max(){var kwargs=arguments[arguments.length-1];if(kwargs===n...
  function ρσ_not_equals (line 1) | function ρσ_not_equals(a,b){if(a===b){return false}if(a&&typeof a.__ne__...
  function ρσ_list_extend (line 1) | function ρσ_list_extend(iterable){var start,iterator,result;if(Array.isA...
  function ρσ_list_index (line 1) | function ρσ_list_index(val,start,stop){start=start||0;if(start<0){start=...
  function ρσ_list_pop (line 1) | function ρσ_list_pop(index){var ans;if(this.length===0){throw new IndexE...
  function ρσ_list_remove (line 1) | function ρσ_list_remove(value){for(var i = 0; i < this.length; i++){if((...
  function ρσ_list_to_string (line 1) | function ρσ_list_to_string(){return"["+this.join(", ")+"]"}
  function ρσ_list_insert (line 1) | function ρσ_list_insert(index,val){if(index<0){index+=this.length}index=...
  function ρσ_list_copy (line 1) | function ρσ_list_copy(){return ρσ_list_constructor(this)}
  function ρσ_list_clear (line 1) | function ρσ_list_clear(){this.length=0}
  function ρσ_list_as_array (line 1) | function ρσ_list_as_array(){return Array.prototype.slice.call(this)}
  function ρσ_list_count (line 1) | function ρσ_list_count(value){return this.reduce((function(){var ρσ_anon...
  function ρσ_list_sort_key (line 1) | function ρσ_list_sort_key(value){var t;t=typeof value;if(t==="string"||t...
  function ρσ_list_sort_cmp (line 1) | function ρσ_list_sort_cmp(a,b,ap,bp){if(a<b){return-1}if(a>b){return 1}r...
  function ρσ_list_sort (line 1) | function ρσ_list_sort(){var key=(arguments[0]===undefined||(0===argument...
  function ρσ_list_concat (line 1) | function ρσ_list_concat(){var ans;ans=Array.prototype.concat.apply(this,...
  function ρσ_list_slice (line 1) | function ρσ_list_slice(){var ans;ans=Array.prototype.slice.apply(this,ar...
  function ρσ_list_iterator (line 1) | function ρσ_list_iterator(value){var self;self=this;return(function(){va...
  function ρσ_list_len (line 1) | function ρσ_list_len(){return this.length}
  function ρσ_list_contains (line 1) | function ρσ_list_contains(val){for(var i = 0; i < this.length; i++){if((...
  function ρσ_list_eq (line 1) | function ρσ_list_eq(other){if(!ρσ_arraylike(other)){return false}if((thi...
  function ρσ_list_decorate (line 1) | function ρσ_list_decorate(ans){ans.append=Array.prototype.push;ans.toStr...
  function ρσ_list_constructor (line 1) | function ρσ_list_constructor(iterable){var ans,iterator,result;if(iterab...
  function sorted (line 1) | function sorted(){var iterable=(0===arguments.length-1&&arguments[argume...
  function ρσ_set_keyfor (line 1) | function ρσ_set_keyfor(x){var t,ans;t=typeof x;if(t==="string"||t==="num...
  function ρσ_set_polyfill (line 1) | function ρσ_set_polyfill(){this._store={};this.size=0}
  function ρσ_set (line 1) | function ρσ_set(iterable){var ans,s,iterator,result,keys;if(this instanc...
  function ρσ_set_wrap (line 1) | function ρσ_set_wrap(x){var ans;ans=new ρσ_set;ans.jsset=x;return ans}
  function ρσ_dict_polyfill (line 1) | function ρσ_dict_polyfill(){this._store={};this.size=0}
  function ρσ_dict (line 1) | function ρσ_dict(){var iterable=(0===arguments.length-1&&arguments[argum...
  function ρσ_dict_wrap (line 2) | function ρσ_dict_wrap(x){var ans;ans=new ρσ_dict;ans.jsmap=x;return ans}
  function Exception (line 3) | function Exception(){if(this.ρσ_object_id===undefined)Object.definePrope...
  function AttributeError (line 3) | function AttributeError(){if(this.ρσ_object_id===undefined)Object.define...
  function IndexError (line 3) | function IndexError(){if(this.ρσ_object_id===undefined)Object.defineProp...
  function KeyError (line 3) | function KeyError(){if(this.ρσ_object_id===undefined)Object.defineProper...
  function ValueError (line 3) | function ValueError(){if(this.ρσ_object_id===undefined)Object.defineProp...
  function UnicodeDecodeError (line 3) | function UnicodeDecodeError(){if(this.ρσ_object_id===undefined)Object.de...
  function AssertionError (line 3) | function AssertionError(){if(this.ρσ_object_id===undefined)Object.define...
  function ZeroDivisionError (line 3) | function ZeroDivisionError(){if(this.ρσ_object_id===undefined)Object.def...
  function ρσ_eslice (line 3) | function ρσ_eslice(arr,step,start,end){var is_string;if(typeof arr==="st...
  function ρσ_delslice (line 3) | function ρσ_delslice(arr,step,start,end){var is_string,ρσ_unpack,indices...
  function ρσ_flatten (line 3) | function ρσ_flatten(arr){var ans,value;ans=ρσ_list_decorate([]);for(var ...
  function ρσ_unpack_asarray (line 3) | function ρσ_unpack_asarray(num,iterable){var ans,iterator,result;if(ρσ_a...
  function ρσ_extends (line 3) | function ρσ_extends(child,parent){child.prototype=Object.create(parent.p...
  function ρσ_Iterable (line 3) | function ρσ_Iterable(iterable){var iterator,ans,result;if(ρσ_arraylike(i...
  function ρσ_interpolate_kwargs (line 3) | function ρσ_interpolate_kwargs(f,supplied_args){var has_prop,kwobj,args,...
  function ρσ_interpolate_kwargs_constructor (line 3) | function ρσ_interpolate_kwargs_constructor(apply,f,supplied_args){if(app...
  function ρσ_getitem (line 3) | function ρσ_getitem(obj,key){if(obj.__getitem__){return obj.__getitem__(...
  function ρσ_setitem (line 3) | function ρσ_setitem(obj,key,val){if(obj.__setitem__){obj.__setitem__(key...
  function ρσ_delitem (line 3) | function ρσ_delitem(obj,key){if(obj.__delitem__){obj.__delitem__(key)}el...
  function ρσ_bound_index (line 3) | function ρσ_bound_index(idx,arr){if(typeof idx==="number"&&idx<0){idx+=a...
  function ρσ_splice (line 3) | function ρσ_splice(arr,val,start,end){start=start||0;if(start<0){start+=...
  function ρσ_mixin (line 3) | function ρσ_mixin(){var seen,resolved_props,p,target,props,name;seen=Obj...
  function ρσ_instanceof (line 3) | function ρσ_instanceof(){var obj,bases,q,cls,p;obj=arguments[0];bases=""...
  function sum (line 3) | function sum(iterable,start){var ans,iterator,r;if(Array.isArray(iterabl...
  function map (line 3) | function map(){var iterators,func,args,ans;iterators=new Array(arguments...
  function filter (line 3) | function filter(func_or_none,iterable){var func,ans;func=(func_or_none==...
  function zip (line 3) | function zip(){var iterators,ans;iterators=new Array(arguments.length);f...
  function any (line 3) | function any(iterable){var i;var ρσ_Iter0=ρσ_Iterable(iterable);for(var ...
  function all (line 3) | function all(iterable){var i;var ρσ_Iter1=ρσ_Iterable(iterable);for(var ...
  function ρσ_repr_js_builtin (line 3) | function ρσ_repr_js_builtin(x,as_array){var ans,b,keys,key;ans=[];b="{}"...
  function ρσ_html_element_to_string (line 3) | function ρσ_html_element_to_string(elem){var attrs,val,attr,ans;attrs=[]...
  function ρσ_repr (line 3) | function ρσ_repr(x){var ans,name;if(x===null){return"None"}if(x===undefi...
  function ρσ_str (line 3) | function ρσ_str(x){var ans,name;if(x===null){return"None"}if(x===undefin...
  function resolve (line 3) | function resolve(arg,object){var ρσ_unpack,first,key,rest,ans;if(!arg){r...
  function resolve_format_spec (line 3) | function resolve_format_spec(format_spec){if(ρσ_str.format._template_res...
  function set_comma (line 3) | function set_comma(ans,comma){var sep;if(comma!==","){sep=1234;sep=sep.t...
  function safe_comma (line 3) | function safe_comma(value,comma){try{return set_comma(value.toLocaleStri...
  function safe_fixed (line 3) | function safe_fixed(value,precision,comma){if(!comma){return value.toFix...
  function apply_formatting (line 3) | function apply_formatting(value,format_spec){var ρσ_unpack,fill,align,si...
  function parse_markup (line 3) | function parse_markup(markup){var key,transformer,format_spec,pos,state,...
  function render_markup (line 3) | function render_markup(markup){var ρσ_unpack,key,transformer,format_spec...

FILE: release/compiler.js
  function ρσ_bool (line 8) | function ρσ_bool(val) {
  function ρσ_print (line 16) | function ρσ_print() {
  function ρσ_int (line 30) | function ρσ_int(val, base) {
  function ρσ_float (line 47) | function ρσ_float(val) {
  function ρσ_arraylike_creator (line 64) | function ρσ_arraylike_creator() {
  function options_object (line 88) | function options_object(f) {
  function ρσ_id (line 107) | function ρσ_id(x) {
  function ρσ_dir (line 115) | function ρσ_dir(item) {
  function ρσ_ord (line 128) | function ρσ_ord(x) {
  function ρσ_chr (line 145) | function ρσ_chr(code) {
  function ρσ_callable (line 157) | function ρσ_callable(x) {
  function ρσ_bin (line 165) | function ρσ_bin(x) {
  function ρσ_hex (line 183) | function ρσ_hex(x) {
  function ρσ_enumerate (line 201) | function ρσ_enumerate(iterable) {
  function ρσ_reversed (line 256) | function ρσ_reversed(iterable) {
  function ρσ_iter (line 291) | function ρσ_iter(iterable) {
  function ρσ_range_next (line 329) | function ρσ_range_next(step, length) {
  function ρσ_range (line 346) | function ρσ_range(start, stop, step) {
  function ρσ_getattr (line 457) | function ρσ_getattr(obj, name, defval) {
  function ρσ_setattr (line 485) | function ρσ_setattr(obj, name, value) {
  function ρσ_hasattr (line 493) | function ρσ_hasattr(obj, name) {
  function len (line 503) | function len(obj) {
  function len5 (line 520) | function len5(obj) {
  function ρσ_get_module (line 541) | function ρσ_get_module(name) {
  function ρσ_pow (line 549) | function ρσ_pow(x, y, z) {
  function ρσ_type (line 562) | function ρσ_type(x) {
  function ρσ_divmod (line 570) | function ρσ_divmod(x, y) {
  function ρσ_max (line 583) | function ρσ_max() {
  function ρσ_equals (line 630) | function ρσ_equals(a, b) {
  function ρσ_not_equals (line 674) | function ρσ_not_equals(a, b) {
  function ρσ_list_extend (line 692) | function ρσ_list_extend(iterable) {
  function ρσ_list_index (line 714) | function ρσ_list_index(val, start, stop) {
  function ρσ_list_pop (line 740) | function ρσ_list_pop(index) {
  function ρσ_list_remove (line 759) | function ρσ_list_remove(value) {
  function ρσ_list_to_string (line 773) | function ρσ_list_to_string() {
  function ρσ_list_insert (line 780) | function ρσ_list_insert(index, val) {
  function ρσ_list_copy (line 799) | function ρσ_list_copy() {
  function ρσ_list_clear (line 806) | function ρσ_list_clear() {
  function ρσ_list_as_array (line 813) | function ρσ_list_as_array() {
  function ρσ_list_count (line 820) | function ρσ_list_count(value) {
  function ρσ_list_sort_key (line 837) | function ρσ_list_sort_key(value) {
  function ρσ_list_sort_cmp (line 850) | function ρσ_list_sort_cmp(a, b, ap, bp) {
  function ρσ_list_sort (line 864) | function ρσ_list_sort() {
  function ρσ_list_concat (line 903) | function ρσ_list_concat() {
  function ρσ_list_slice (line 913) | function ρσ_list_slice() {
  function ρσ_list_iterator (line 923) | function ρσ_list_iterator(value) {
  function ρσ_list_len (line 960) | function ρσ_list_len() {
  function ρσ_list_contains (line 967) | function ρσ_list_contains(val) {
  function ρσ_list_eq (line 980) | function ρσ_list_eq(other) {
  function ρσ_list_decorate (line 999) | function ρσ_list_decorate(ans) {
  function ρσ_list_constructor (line 1029) | function ρσ_list_constructor(iterable) {
  function sorted (line 1060) | function sorted() {
  function ρσ_set_keyfor (line 1085) | function ρσ_set_keyfor(x) {
  function ρσ_set_polyfill (line 1110) | function ρσ_set_polyfill() {
  function ρσ_set (line 1211) | function ρσ_set(iterable) {
  function ρσ_set_wrap (line 1631) | function ρσ_set_wrap(x) {
  function ρσ_dict_polyfill (line 1644) | function ρσ_dict_polyfill() {
  function ρσ_dict (line 1832) | function ρσ_dict() {
  function ρσ_dict_wrap (line 2205) | function ρσ_dict_wrap(x) {
  function Exception (line 2219) | function Exception() {
  function AttributeError (line 2249) | function AttributeError() {
  function IndexError (line 2268) | function IndexError() {
  function KeyError (line 2287) | function KeyError() {
  function ValueError (line 2306) | function ValueError() {
  function UnicodeDecodeError (line 2325) | function UnicodeDecodeError() {
  function AssertionError (line 2344) | function AssertionError() {
  function ZeroDivisionError (line 2363) | function ZeroDivisionError() {
  function ρσ_eslice (line 2382) | function ρσ_eslice(arr, step, start, end) {
  function ρσ_delslice (line 2424) | function ρσ_delslice(arr, step, start, end) {
  function ρσ_flatten (line 2471) | function ρσ_flatten(arr) {
  function ρσ_unpack_asarray (line 2489) | function ρσ_unpack_asarray(num, iterable) {
  function ρσ_extends (line 2510) | function ρσ_extends(child, parent) {
  function ρσ_Iterable (line 2570) | function ρσ_Iterable(iterable) {
  function ρσ_interpolate_kwargs (line 2635) | function ρσ_interpolate_kwargs(f, supplied_args) {
  function ρσ_interpolate_kwargs_constructor (line 2673) | function ρσ_interpolate_kwargs_constructor(apply, f, supplied_args) {
  function ρσ_getitem (line 2686) | function ρσ_getitem(obj, key) {
  function ρσ_setitem (line 2700) | function ρσ_setitem(obj, key, val) {
  function ρσ_delitem (line 2716) | function ρσ_delitem(obj, key) {
  function ρσ_bound_index (line 2733) | function ρσ_bound_index(idx, arr) {
  function ρσ_splice (line 2744) | function ρσ_splice(arr, val, start, end) {
  function ρσ_mixin (line 2844) | function ρσ_mixin() {
  function ρσ_instanceof (line 2878) | function ρσ_instanceof() {
  function sum (line 2923) | function sum(iterable, start) {
  function map (line 2951) | function map() {
  function filter (line 2992) | function filter(func_or_none, iterable) {
  function zip (line 3029) | function zip() {
  function any (line 3069) | function any(iterable) {
  function all (line 3085) | function all(iterable) {
  function ρσ_repr_js_builtin (line 3102) | function ρσ_repr_js_builtin(x, as_array) {
  function ρσ_html_element_to_string (line 3125) | function ρσ_html_element_to_string(elem) {
  function ρσ_repr (line 3149) | function ρσ_repr(x) {
  function ρσ_str (line 3205) | function ρσ_str(x) {
  function resolve (line 3295) | function resolve(arg, object) {
  function resolve_format_spec (line 3316) | function resolve_format_spec(format_spec) {
  function set_comma (line 3339) | function set_comma(ans, comma) {
  function safe_comma (line 3353) | function safe_comma(value, comma) {
  function safe_fixed (line 3368) | function safe_fixed(value, precision, comma) {
  function apply_formatting (line 3386) | function apply_formatting(value, format_spec) {
  function parse_markup (line 3564) | function parse_markup(markup) {
  function render_markup (line 3597) | function render_markup(markup) {
  function array_to_hash (line 4400) | function array_to_hash(a) {
  function slice (line 4415) | function slice(a, start) {
  function characters (line 4423) | function characters(str_) {
  function member (line 4431) | function member(name, array) {
  function repeat_string (line 4446) | function repeat_string(str_, i) {
  function DefaultsError (line 4466) | function DefaultsError() {
  function defaults (line 4491) | function defaults(args, defs, croak) {
  function merge (line 4518) | function merge(obj, ext) {
  function noop (line 4532) | function noop() {
  function MAP (line 4541) | function MAP(a, f, backwards) {
  function AtTop (line 4638) | function AtTop(val) {
  function Splice (line 4646) | function Splice(val) {
  function Last (line 4654) | function Last(val) {
  function push_uniq (line 4669) | function push_uniq(array, el) {
  function string_template (line 4679) | function string_template(text, props) {
  function remove (line 4696) | function remove(array, el) {
  function mergeSort (line 4710) | function mergeSort(array, cmp) {
  function set_difference (line 4767) | function set_difference(a, b) {
  function set_intersection (line 4784) | function set_intersection(a, b) {
  function make_predicate (line 4801) | function make_predicate(words) {
  function cache_file_name (line 4819) | function cache_file_name(src, cache_dir) {
  function SyntaxError (line 4854) | function SyntaxError() {
  function ImportError (line 4902) | function ImportError() {
  function is_node_type (line 4963) | function is_node_type(node, typ) {
  function AST (line 4971) | function AST() {
  function AST_Token (line 5013) | function AST_Token() {
  function AST_Node (line 5045) | function AST_Node() {
  function AST_Statement (line 5202) | function AST_Statement() {
  function AST_Debugger (line 5220) | function AST_Debugger() {
  function AST_Directive (line 5238) | function AST_Directive() {
  function AST_SimpleStatement (line 5262) | function AST_SimpleStatement() {
  function AST_Assert (line 5301) | function AST_Assert() {
  function walk_body (line 5344) | function walk_body(node, visitor) {
  function AST_Block (line 5361) | function AST_Block() {
  function AST_BlockStatement (line 5400) | function AST_BlockStatement() {
  function AST_EmptyStatement (line 5418) | function AST_EmptyStatement() {
  function AST_StatementWithBody (line 5449) | function AST_StatementWithBody() {
  function AST_DWLoop (line 5488) | function AST_DWLoop() {
  function AST_Do (line 5528) | function AST_Do() {
  function AST_While (line 5546) | function AST_While() {
  function AST_ForIn (line 5564) | function AST_ForIn() {
  function AST_ForJS (line 5610) | function AST_ForJS() {
  function AST_ListComprehension (line 5633) | function AST_ListComprehension() {
  function AST_SetComprehension (line 5676) | function AST_SetComprehension() {
  function AST_DictComprehension (line 5694) | function AST_DictComprehension() {
  function AST_GeneratorComprehension (line 5739) | function AST_GeneratorComprehension() {
  function AST_With (line 5757) | function AST_With() {
  function AST_WithClause (line 5802) | function AST_WithClause() {
  function AST_Scope (line 5845) | function AST_Scope() {
  function AST_Toplevel (line 5869) | function AST_Toplevel() {
  function AST_Import (line 5904) | function AST_Import() {
  function AST_Imports (line 5957) | function AST_Imports() {
  function AST_Decorator (line 6001) | function AST_Decorator() {
  function AST_Lambda (line 6042) | function AST_Lambda() {
  function AST_Function (line 6109) | function AST_Function() {
  function AST_Class (line 6127) | function AST_Class() {
  function AST_Method (line 6187) | function AST_Method() {
  function AST_Jump (line 6212) | function AST_Jump() {
  function AST_Exit (line 6230) | function AST_Exit() {
  function AST_Return (line 6271) | function AST_Return() {
  function AST_Yield (line 6289) | function AST_Yield() {
  function AST_Throw (line 6312) | function AST_Throw() {
  function AST_LoopControl (line 6330) | function AST_LoopControl() {
  function AST_Break (line 6348) | function AST_Break() {
  function AST_Continue (line 6366) | function AST_Continue() {
  function AST_If (line 6384) | function AST_If() {
  function AST_Try (line 6428) | function AST_Try() {
  function AST_Catch (line 6478) | function AST_Catch() {
  function AST_Except (line 6496) | function AST_Except() {
  function AST_Finally (line 6547) | function AST_Finally() {
  function AST_Else (line 6565) | function AST_Else() {
  function AST_Definitions (line 6583) | function AST_Definitions() {
  function AST_Var (line 6627) | function AST_Var() {
  function AST_VarDef (line 6645) | function AST_VarDef() {
  function AST_BaseCall (line 6688) | function AST_BaseCall() {
  function AST_Call (line 6711) | function AST_Call() {
  function AST_ClassCall (line 6771) | function AST_ClassCall() {
  function AST_New (line 6829) | function AST_New() {
  function AST_Seq (line 6847) | function AST_Seq() {
  function AST_PropAccess (line 6964) | function AST_PropAccess() {
  function AST_Dot (line 6988) | function AST_Dot() {
  function AST_Sub (line 7022) | function AST_Sub() {
  function AST_ItemAccess (line 7057) | function AST_ItemAccess() {
  function AST_Splice (line 7101) | function AST_Splice() {
  function AST_Unary (line 7143) | function AST_Unary() {
  function AST_UnaryPrefix (line 7184) | function AST_UnaryPrefix() {
  function AST_Binary (line 7202) | function AST_Binary() {
  function AST_Existential (line 7244) | function AST_Existential() {
  function AST_Conditional (line 7287) | function AST_Conditional() {
  function AST_Assign (line 7330) | function AST_Assign() {
  function AST_Array (line 7409) | function AST_Array() {
  function flatten (line 7440) | function flatten(arr) {
  function AST_Object (line 7484) | function AST_Object() {
  function AST_ExpressiveObject (line 7530) | function AST_ExpressiveObject() {
  function AST_ObjectProperty (line 7548) | function AST_ObjectProperty() {
  function AST_ObjectKeyVal (line 7590) | function AST_ObjectKeyVal() {
  function AST_Set (line 7608) | function AST_Set() {
  function AST_SetItem (line 7652) | function AST_SetItem() {
  function AST_Symbol (line 7691) | function AST_Symbol() {
  function AST_SymbolAlias (line 7716) | function AST_SymbolAlias() {
  function AST_SymbolDeclaration (line 7734) | function AST_SymbolDeclaration() {
  function AST_SymbolVar (line 7757) | function AST_SymbolVar() {
  function AST_ImportedVar (line 7775) | function AST_ImportedVar() {
  function AST_SymbolNonlocal (line 7798) | function AST_SymbolNonlocal() {
  function AST_SymbolFunarg (line 7816) | function AST_SymbolFunarg() {
  function AST_SymbolDefun (line 7839) | function AST_SymbolDefun() {
  function AST_SymbolLambda (line 7857) | function AST_SymbolLambda() {
  function AST_SymbolCatch (line 7875) | function AST_SymbolCatch() {
  function AST_SymbolRef (line 7893) | function AST_SymbolRef() {
  function AST_This (line 7916) | function AST_This() {
  function AST_Constant (line 7934) | function AST_Constant() {
  function AST_String (line 7952) | function AST_String() {
  function AST_Verbatim (line 7975) | function AST_Verbatim() {
  function AST_Number (line 7998) | function AST_Number() {
  function AST_RegExp (line 8021) | function AST_RegExp() {
  function AST_Atom (line 8044) | function AST_Atom() {
  function AST_Null (line 8072) | function AST_Null() {
  function AST_NaN (line 8091) | function AST_NaN() {
  function AST_Undefined (line 8110) | function AST_Undefined() {
  function AST_Hole (line 8129) | function AST_Hole() {
  function AST_Infinity (line 8148) | function AST_Infinity() {
  function AST_Boolean (line 8167) | function AST_Boolean() {
  function AST_False (line 8185) | function AST_False() {
  function AST_True (line 8204) | function AST_True() {
  function TreeWalker (line 8223) | function TreeWalker() {
  function Found (line 8335) | function Found() {
  function has_calls (line 8354) | function has_calls(expression) {
  function quoted_string (line 8493) | function quoted_string(x) {
  function render_markup (line 8501) | function render_markup(markup) {
  function interpolate (line 8527) | function interpolate(template, raise_error) {
  function is_string_modifier (line 8652) | function is_string_modifier(val) {
  function is_letter (line 8668) | function is_letter(code) {
  function is_digit (line 8676) | function is_digit(code) {
  function is_alphanumeric_char (line 8684) | function is_alphanumeric_char(code) {
  function is_unicode_combining_mark (line 8692) | function is_unicode_combining_mark(ch) {
  function is_unicode_connector_punctuation (line 8700) | function is_unicode_connector_punctuation(ch) {
  function is_identifier (line 8708) | function is_identifier(name) {
  function is_identifier_start (line 8716) | function is_identifier_start(code) {
  function is_identifier_char (line 8724) | function is_identifier_char(ch) {
  function parse_js_number (line 8734) | function parse_js_number(num) {
  function is_token (line 8756) | function is_token(token, type, val) {
  function tokenizer (line 8765) | function tokenizer(raw_text, filename) {
  function get_compiler_version (line 9708) | function get_compiler_version() {
  function static_predicate (line 9715) | function static_predicate(names) {
  function has_simple_decorator (line 9837) | function has_simple_decorator(decorators, name) {
  function has_setter_decorator (line 9860) | function has_setter_decorator(decorators, name) {
  function create_parser_ctx (line 9883) | function create_parser_ctx(S, import_dirs, module_id, baselib_items, imp...
  function parse (line 12943) | function parse(text, options) {
  function as_hex (line 13108) | function as_hex(code, sz) {
  function to_ascii (line 13121) | function to_ascii(str_, identifier) {
  function encode_string (line 13144) | function encode_string(str_) {
  function OutputStream (line 13188) | function OutputStream() {
  function force_statement (line 13671) | function force_statement(stat, output) {
  function first_in_statement (line 13703) | function first_in_statement(output) {
  function declare_vars (line 13726) | function declare_vars(vars, output) {
  function display_body (line 13751) | function display_body(body, is_toplevel, output) {
  function display_complex_body (line 13773) | function display_complex_body(node, is_toplevel, output, function_preamb...
  function print_bracketed (line 13807) | function print_bracketed(node, output, complex, function_preamble, befor...
  function print_with (line 13854) | function print_with(self, output) {
  function print_assert (line 13937) | function print_assert(self, output) {
  function print_try (line 13968) | function print_try(self, output) {
  function print_catch (line 14004) | function print_catch(self, output) {
  function print_finally (line 14103) | function print_finally(self, output, belse, else_var_name) {
  function print_else (line 14136) | function print_else(self, else_var_name, output) {
  function best_of (line 14157) | function best_of(a) {
  function make_num (line 14175) | function make_num(num) {
  function make_block (line 14199) | function make_block(stmt, output) {
  function create_doctring (line 14221) | function create_doctring(docstrings) {
  function unpack_tuple (line 14288) | function unpack_tuple(elems, output, in_statement) {
  function print_do_loop (line 14318) | function print_do_loop(self, output) {
  function print_while_loop (line 14341) | function print_while_loop(self, output) {
  function is_simple_for_in (line 14361) | function is_simple_for_in(self) {
  function is_simple_for (line 14372) | function is_simple_for(self) {
  function print_for_loop_body (line 14390) | function print_for_loop_body(output) {
  function init_es6_itervar (line 14445) | function init_es6_itervar(output, itervar) {
  function print_for_in (line 14455) | function print_for_in(self, output) {
  function print_list_comprehension (line 14592) | function print_list_comprehension(self, output) {
  function print_getattr (line 14971) | function print_getattr(self, output, skip_expression) {
  function print_getitem (line 14990) | function print_getitem(self, output) {
  function print_rich_getitem (line 15039) | function print_rich_getitem(self, output) {
  function print_splice_assignment (line 15065) | function print_splice_assignment(self, output) {
  function print_delete (line 15080) | function print_delete(self, output) {
  function print_unary_prefix (line 15095) | function print_unary_prefix(self, output) {
  function write_instanceof (line 15124) | function write_instanceof(left, right, output) {
  function write_smart_equality (line 15155) | function write_smart_equality(self, output) {
  function print_binary_op (line 15201) | function print_binary_op(self, output) {
  function print_existential (line 15310) | function print_existential(self, output) {
  function print_assignment (line 15344) | function print_assignment(self, output) {
  function print_assign (line 15394) | function print_assign(self, output) {
  function print_conditional (line 15470) | function print_conditional(self, output, condition, consequent, alternat...
  function print_seq (line 15498) | function print_seq(output) {
  function set_module_name (line 15569) | function set_module_name(x) {
  function decorate (line 15577) | function decorate(decorators, output, func) {
  function function_args (line 15608) | function function_args(argnames, output, strip_first) {
  function function_preamble (line 15637) | function function_preamble(node, output, offset) {
  function has_annotations (line 15717) | function has_annotations(self) {
  function function_annotation (line 15736) | function function_annotation(self, output, strip_first, name) {
  function function_definition (line 15884) | function function_definition(self, output, strip_first, as_expression) {
  function print_function (line 15964) | function print_function(output) {
  function find_this (line 15994) | function find_this(expression) {
  function print_this (line 16007) | function print_this(expression, output) {
  function print_function_call (line 16021) | function print_function_call(self, output) {
  function print_class (line 16269) | function print_class(output) {
  function print_array (line 16687) | function print_array(self, output) {
  function print_obj_literal (line 16730) | function print_obj_literal(self, output) {
  function print_object (line 16801) | function print_object(self, output) {
  function print_set (line 16821) | function print_set(self, output) {
  function print_regexp (line 16873) | function print_regexp(self, output) {
  function output_comments (line 16902) | function output_comments(comments, output, nlb) {
  function print_comments (line 16926) | function print_comments(self, output) {
  function write_imports (line 16992) | function write_imports(module, output) {
  function write_main_name (line 17064) | function write_main_name(output) {
  function const_decl (line 17079) | function const_decl(js_version) {
  function declare_exports (line 17087) | function declare_exports(module_id, exports, output, docstrings) {
  function prologue (line 17124) | function prologue(module, output) {
  function print_top_level (line 17159) | function print_top_level(self, output) {
  function print_module (line 17252) | function print_module(self, output) {
  function print_imports (line 17402) | function print_imports(container, output) {
  function generate_code (line 17593) | function generate_code() {

FILE: tools/cli.js
  function OptionGroup (line 14) | function OptionGroup(name) {
  function create_group (line 32) | function create_group(name, usage, description, extra) {
  function print_usage (line 60) | function print_usage(group) {  // {{{
  function opt (line 116) | function opt(name, aliases, type, default_val, help_text, choices) {
  function parse_args (line 150) | function parse_args() {  // {{{

FILE: tools/compile.js
  function read_whole_file (line 15) | function read_whole_file(filename, cb) {
  function makedirs (line 30) | function makedirs(dir) {
  function process_cache_dir (line 40) | function process_cache_dir(dir) {
  function parse_file (line 63) | function parse_file(code, file, toplevel) {
  function write_output (line 75) | function write_output(output) {
  function time_it (line 89) | function time_it(name, cont) {
  function compile_single_file (line 100) | function compile_single_file(err, code) {

FILE: tools/compiler.js
  function sha1sum (line 19) | function sha1sum(data) {
  function path_exists (line 25) | function path_exists(path) {
  function uglify (line 34) | function uglify(code) {
  function regenerate (line 41) | function regenerate(code, beautify) {
  function create_compiler (line 63) | function create_compiler() {

FILE: tools/completer.js
  function global_names (line 16) | function global_names(ctx) {
  function object_names (line 34) | function object_names(obj, prefix) {
  function prefix_matches (line 80) | function prefix_matches(prefix, items) {
  function find_completions (line 87) | function find_completions(line, ctx) {

FILE: tools/embedded_compiler.js
  function print_ast (line 17) | function print_ast(ast, keep_baselib, keep_docstrings, js_version, priva...

FILE: tools/export.js
  function normalize_array (line 10) | function normalize_array(parts, allowAboveRoot) {
  function normalize (line 33) | function normalize(path) {
  function dirname (line 48) | function dirname(path) {
  function basename (line 55) | function basename(path) {
  function load (line 63) | function load(filepath) {
  function has (line 92) | function has(x, y) { return Object.prototype.hasOwnProperty.call(x, y); }
  function try_files (line 94) | function try_files(candidate) {
  function find_in_modules_dir (line 101) | function find_in_modules_dir(name, base) {
  function find_module (line 119) | function find_module(name, base) {
  function vrequire (line 130) | function vrequire(name, base) {
  function uglify (line 151) | function uglify(x) {
  function regenerate (line 158) | function regenerate(code, beautify) {
  function create_compiler (line 201) | function create_compiler() {
  function compile (line 211) | function compile(code, filename, options) {
  function create_embedded_compiler (line 231) | function create_embedded_compiler(runjs) {
  function web_repl (line 236) | function web_repl() {
  function init_repl (line 241) | function init_repl(options) {
  function gettext_parse (line 247) | function gettext_parse(catalog, code, filename) {
  function gettext_output (line 252) | function gettext_output(catalog, options, write) {
  function msgfmt (line 257) | function msgfmt(data, options) {
  function completer (line 262) | function completer(compiler, options) {

FILE: tools/gettext.js
  function parse_file (line 13) | function parse_file(code, filename) {
  function detect_format (line 22) | function detect_format(msgid) {
  function Gettext (line 28) | function Gettext(catalog, filename) {
  function gettext (line 58) | function gettext(catalog, code, filename) {
  function esc (line 76) | function esc(string) {
  function entry_to_string (line 80) | function entry_to_string(msgid, data) {
  function write_output (line 93) | function write_output(catalog, options, write) {
  function read_whole_file (line 128) | function read_whole_file(filename, cb) {
  function read_files (line 148) | function read_files(src) {
  function process_single_file (line 160) | function process_single_file(err, code) {

FILE: tools/ini.js
  function parse_ini_data (line 12) | function parse_ini_data(data) {
  function find_cfg_file (line 43) | function find_cfg_file(toplevel_dir) {
  function read_config (line 58) | function read_config(toplevel_dir) {

FILE: tools/lint.js
  function cmp (line 55) | function cmp(a, b) {
  function parse_file (line 59) | function parse_file(code, filename) {
  function msg_from_node (line 68) | function msg_from_node(filename, ident, name, node, level, line) {
  function Binding (line 86) | function Binding(name, node, options) {
  function Scope (line 101) | function Scope(is_toplevel, parent_scope, filename, is_class) {
  function Linter (line 216) | function Linter(toplevel, filename, code, options) {
  function lint_code (line 538) | function lint_code(code, options) {
  function read_whole_file (line 566) | function read_whole_file(filename, cb) {
  function cli_report (line 581) | function cli_report(r, i, messages) {
  function cli_undef_report (line 594) | function cli_undef_report(r, i, messages) {
  function cli_json_report (line 599) | function cli_json_report(r, i, messages) {
  function cli_vim_report (line 613) | function cli_vim_report(r) {
  function get_ini (line 622) | function get_ini(toplevel_dir) {
  function path_for_filename (line 656) | function path_for_filename(x) {
  function lint_single_file (line 660) | function lint_single_file(err, code) {

FILE: tools/msgfmt.js
  function unesc (line 9) | function unesc(string) {
  function parse (line 13) | function parse(data, on_error) {
  function read_stdin (line 158) | function read_stdin(cont) {
  function serialize_catalog (line 170) | function serialize_catalog(catalog, options) {

FILE: tools/repl.js
  function create_ctx (line 19) | function create_ctx(baselib, show_js, console) {
  function expanduser (line 30) | function expanduser(x) {
  function repl_defaults (line 37) | function repl_defaults(options) {
  function read_history (line 54) | function read_history(options) {
  function write_history (line 62) | function write_history(options, history) {
  function print_ast (line 93) | function print_ast(ast, keep_baselib) {
  function resetbuffer (line 102) | function resetbuffer() { buffer = []; }
  function completer (line 104) | function completer(line) {
  function prompt (line 108) | function prompt() {
  function runjs (line 124) | function runjs(js) {
  function compile_source (line 145) | function compile_source(source) {
  function push (line 177) | function push(line) {

FILE: tools/self.js
  function compile_baselib (line 15) | function compile_baselib(RapydScript, src_path) {
  function check_for_changes (line 42) | function check_for_changes(base_path, src_path, signatures) {
  function compile (line 94) | function compile(src_path, lib_path, sources, source_hash, profile) {
  function run_single_compile (line 143) | function run_single_compile(base_path, src_path, lib_path, profile) {

FILE: tools/utils.js
  function ansi (line 12) | function ansi(code) {
  function path_exists (line 17) | function path_exists(path) {
  function colored (line 27) | function colored(string, color, bold) {
  function supports_color (line 34) | function supports_color(stdout) {
  function safe_colored (line 60) | function safe_colored(string) {
  function repeat (line 64) | function repeat(str, num) {
  function generators_available (line 68) | function generators_available() {
  function wrap (line 78) | function wrap(lines, width) {
  function merge (line 96) | function merge() {
  function get_import_dirs (line 107) | function get_import_dirs(paths_string, ignore_env) {

FILE: web-repl/env.js
  function require (line 72) | function require(name) {

FILE: web-repl/main.js
  function compile (line 12) | function compile(code) {
  function runjs (line 16) | function runjs(code) {
  function println (line 20) | function println(text) {
  function add_output (line 24) | function add_output(text, color) {
  function add_javascript (line 38) | function add_javascript(text) {
  function show_compiler_error (line 49) | function show_compiler_error(text, line, col) {
  function read_eval (line 75) | function read_eval(code) {
  function run_code (line 101) | function run_code() {
  function hide_completions (line 109) | function hide_completions() {
  function completions_visible (line 113) | function completions_visible() {
  function show_completions (line 117) | function show_completions(completions) {
  function check_for_completions (line 145) | function check_for_completions() {
  function update_completions (line 165) | function update_completions() {
  function longest_common_prefix (line 179) | function longest_common_prefix(items) {
  function on_input (line 186) | function on_input(ev) {
  function on_load (line 223) | function on_load() {

FILE: web-repl/sha1.js
  function x (line 12) | function x(b,a,d){var c=0,e=[],h=0,l=!1,f=[],g=[],q=!1;d=d||{};var r=d.e...
  function C (line 16) | function C(b,a,d){var c="";a/=8;var e;for(e=0;e<a;e+=1){var h=b[e>>>2]>>...
  function D (line 16) | function D(b,a,d){var c="",e=a/8,h;for(h=0;h<e;h+=3){var l=h+1<e?b[h+1>>...
  function E (line 17) | function E(b,a){var d="";a/=8;var c;for(c=0;c<a;c+=1){var e=b[c>>>2]>>>8...
  function F (line 17) | function F(b,a){a/=8;var d,c=new ArrayBuffer(a);var e=new Uint8Array(c);...
  function B (line 17) | function B(b){var a={outputUpper:!1,b64Pad:"=",shakeLen:-1};b=b||{};a.ou...
  function A (line 18) | function A(b,a){switch(a){case "UTF8":case "UTF16BE":case "UTF16LE":brea...
  function m (line 23) | function m(b,a){return b<<a|b>>>32-a}
  function t (line 23) | function t(b,a){var d=(b&65535)+(a&65535);return((b>>>16)+(a>>>16)+(d>>>...
  function v (line 23) | function v(b,a,d,c,e){var h=(b&65535)+(a&65535)+(d&65535)+(c&65535)+(e&6...
  function w (line 23) | function w(b){if("SHA-1"===b)b=[1732584193,4023233417,2562383102,2717338...
  function z (line 23) | function z(b,a){var d=[],c;var e=a[0];var h=a[1];var l=a[2];
  function H (line 24) | function H(b,a,d,c){var e;for(e=(a+65>>>9<<4)+15;b.length<=e;)b.push(0);...
Condensed preview — 108 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,252K chars).
[
  {
    "path": ".agignore",
    "chars": 6,
    "preview": "lib/*\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 1047,
    "preview": "name: CI\non: [push, pull_request]\nenv:\n    CI: 'true'\n\njobs:\n    test:\n        name: Test on ${{ matrix.os }} LANG ${{ m"
  },
  {
    "path": ".gitignore",
    "chars": 104,
    "preview": "# use glob syntax\n*~\n*.swp\n*.tmp\n*.orig\n*.pyj-cached\nnode_modules\ndev\nself.cpuprofile\npackage-lock.json\n"
  },
  {
    "path": "=template.pyj",
    "chars": 120,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: %YEAR%, %USER% <%MAIL%>\nfrom __python__ import hash_literals\n\n%HERE%\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 17124,
    "preview": "version 0.7.23\n=======================\n\n  * Fix consecutive of f-strings without concatenation operator causing a syntax"
  },
  {
    "path": "CONTRIBUTORS",
    "chars": 259,
    "preview": "This project is officially supported by Kovid Goyal.\n\nMain Developers\n---------------\nKovid Goyal\n\nOther Contributors\n--"
  },
  {
    "path": "HACKING.md",
    "chars": 3040,
    "preview": "Hacking the RapydScript compiler\n=================================\n\nThe RapydScript compiler is written in RapydScript i"
  },
  {
    "path": "LICENSE",
    "chars": 1383,
    "preview": "Copyright (c) 2015-, Kovid Goyal <kovid@kovidgoyal.net>\nCopyright (c) 2013-2014, Alexander Tsepkov <atsepkov@pyjeon.com>"
  },
  {
    "path": "README.md",
    "chars": 62014,
    "preview": "RapydScript\n===========\n\n\n[![Build Status](https://github.com/ebook-utils/kovidgoyal/rapydscript-ng/CI/badge.svg)](https"
  },
  {
    "path": "add-toc-to-readme",
    "chars": 78,
    "preview": "#!/bin/sh\nexec node_modules/doctoc/doctoc.js --title '**Contents**' README.md\n"
  },
  {
    "path": "bin/export",
    "chars": 2365,
    "preview": "#!/usr/bin/env node \n// vim:ft=javascript:ts=4:et\n\n\"use strict\";\n\nvar fs = require('fs');\nvar path = require('path');\nva"
  },
  {
    "path": "bin/rapydscript",
    "chars": 2264,
    "preview": "#!/usr/bin/env node \n// vim:ft=javascript:ts=4:et\n\n\"use strict\";\n\nfunction load(mod) {\n    return require('../tools/' + "
  },
  {
    "path": "bin/web-repl-export",
    "chars": 3593,
    "preview": "#!/usr/bin/env node \n// vim:ft=javascript:ts=4:et\n\n\"use strict\";\n\nvar fs = require('fs');\nvar path = require('path');\n\nv"
  },
  {
    "path": "build",
    "chars": 54,
    "preview": "#!/bin/sh\nexec bin/rapydscript self --complete --test\n"
  },
  {
    "path": "package.json",
    "chars": 948,
    "preview": "{\n  \"name\": \"rapydscript-ng\",\n  \"description\": \"Pythonic JavaScript that doesn't suck\",\n  \"homepage\": \"https://github.co"
  },
  {
    "path": "publish.py",
    "chars": 1286,
    "preview": "#!/usr/bin/env python\n# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n\nim"
  },
  {
    "path": "release/baselib-plain-pretty.js",
    "chars": 155980,
    "preview": "var ρσ_len;\nfunction ρσ_bool(val) {\n    return !!val;\n};\nif (!ρσ_bool.__argnames__) Object.defineProperties(ρσ_bool, {\n "
  },
  {
    "path": "release/baselib-plain-ugly.js",
    "chars": 107450,
    "preview": "var ρσ_len;function ρσ_bool(val){return!!val};if(!ρσ_bool.__argnames__)Object.defineProperties(ρσ_bool,{__argnames__:{va"
  },
  {
    "path": "release/compiler.js",
    "chars": 868165,
    "preview": "(function(){\n    \"use strict\";\n    var ρσ_iterator_symbol = (typeof Symbol === \"function\" && typeof Symbol.iterator === "
  },
  {
    "path": "release/signatures.json",
    "chars": 1888,
    "preview": "{\n    \"ast\": \"7a1a1800d9ee7af7f7153eee38002e4e9dcfb71e\",\n    \"baselib-builtins\": \"50927b38fded9bd9dbe14c42a20dd8e930ac02"
  },
  {
    "path": "session.vim",
    "chars": 86,
    "preview": "set wildignore+=*.pyj-cached\nset wildignore+=node_modules\nimap <F4> ρσ_\ncmap <F4> ρσ_\n"
  },
  {
    "path": "setup.cfg",
    "chars": 41,
    "preview": "[rapydscript]\nglobals=assert,RapydScript\n"
  },
  {
    "path": "src/ast.pyj",
    "chars": 36180,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "src/baselib-builtins.pyj",
    "chars": 9199,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\n# globals: exports, co"
  },
  {
    "path": "src/baselib-containers.pyj",
    "chars": 22190,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\n# globals:ρσ_iterator_"
  },
  {
    "path": "src/baselib-errors.pyj",
    "chars": 676,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n# globals: ρσ_str\n\nName"
  },
  {
    "path": "src/baselib-internal.pyj",
    "chars": 9999,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n\n# globals: exports, console, ρσ_iterator_symbol, ρσ_kwargs_symbol, ρσ_arraylike"
  },
  {
    "path": "src/baselib-itertools.pyj",
    "chars": 2488,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\n# globals: ρσ_iterator"
  },
  {
    "path": "src/baselib-str.pyj",
    "chars": 26055,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\n# globals: ρσ_kwargs_s"
  },
  {
    "path": "src/compiler.pyj",
    "chars": 1323,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n# globals: console\n\nfro"
  },
  {
    "path": "src/errors.pyj",
    "chars": 871,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "src/lib/aes.pyj",
    "chars": 62372,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n\n# globals: crypto\n\n# Int"
  },
  {
    "path": "src/lib/elementmaker.pyj",
    "chars": 3257,
    "preview": "# vim:fileencoding=utf-8\n# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\nhtml_elements = {\n   "
  },
  {
    "path": "src/lib/encodings.pyj",
    "chars": 5083,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n\ndef base64encode(bytes, "
  },
  {
    "path": "src/lib/gettext.pyj",
    "chars": 21264,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\n# noqa: eol-semicolon\n\n#"
  },
  {
    "path": "src/lib/math.pyj",
    "chars": 6854,
    "preview": "###########################################################\n# RapydScript Standard Library\n# Author: Alexander Tsepkov\n#"
  },
  {
    "path": "src/lib/operator.pyj",
    "chars": 397,
    "preview": "add = __add__ = def(x, y): return x + y\nsub = __sub__ = def(x, y): return x - y\nmul = __mul__ = def(x, y): return x * y\n"
  },
  {
    "path": "src/lib/pythonize.pyj",
    "chars": 759,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n# globals: ρσ_str\n\ndef st"
  },
  {
    "path": "src/lib/random.pyj",
    "chars": 3594,
    "preview": "###########################################################\n# RapydScript Standard Library\n# Author: Alexander Tsepkov\n#"
  },
  {
    "path": "src/lib/re.pyj",
    "chars": 23221,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n# Copyright: 2013, Alex"
  },
  {
    "path": "src/lib/traceback.pyj",
    "chars": 1994,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n# globals: ρσ_str, ρσ_las"
  },
  {
    "path": "src/lib/uuid.pyj",
    "chars": 2110,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>\n# globals: crypto\nfrom __"
  },
  {
    "path": "src/output/__init__.pyj",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "src/output/classes.pyj",
    "chars": 10644,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "src/output/codegen.pyj",
    "chars": 15255,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "src/output/comments.pyj",
    "chars": 1701,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "src/output/exceptions.pyj",
    "chars": 3416,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "src/output/functions.pyj",
    "chars": 15841,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n# globals:regenerate\nfrom"
  },
  {
    "path": "src/output/literals.pyj",
    "chars": 3255,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "src/output/loops.pyj",
    "chars": 15015,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n# globals: regenerate\nfro"
  },
  {
    "path": "src/output/modules.pyj",
    "chars": 12227,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n# globals: writefile\nfrom"
  },
  {
    "path": "src/output/operators.pyj",
    "chars": 13590,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "src/output/statements.pyj",
    "chars": 6314,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "src/output/stream.pyj",
    "chars": 8582,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n# globals:regenerate\nfrom"
  },
  {
    "path": "src/output/utils.pyj",
    "chars": 2319,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "src/parse.pyj",
    "chars": 82415,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n# globals: readfile\nfrom "
  },
  {
    "path": "src/string_interpolation.pyj",
    "chars": 2038,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "src/tokenizer.pyj",
    "chars": 31491,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "src/unicode_aliases.pyj",
    "chars": 16146,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\n# Alias DB from http:/"
  },
  {
    "path": "src/utils.pyj",
    "chars": 4667,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\nfrom __python__ import ha"
  },
  {
    "path": "test/_import_one.pyj",
    "chars": 478,
    "preview": "# vim:fileencoding=utf-8\nnonlocal GLOBAL_SYMBOL\n\n'Module level ds1'\n\ndef toplevel_func(a):\n    return a + 'toplevel'\n\n''"
  },
  {
    "path": "test/_import_two/__init__.pyj",
    "chars": 165,
    "preview": "# vim:fileencoding=utf-8\n\ndef toplevel_func2(a):\n    return a + 'toplevel2'\n\nclass TopLevel2:\n\n    def __init__(self, a)"
  },
  {
    "path": "test/_import_two/level2/__init__.pyj",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "test/_import_two/level2/deep.pyj",
    "chars": 114,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n\ndeep_var = 'deep'\n"
  },
  {
    "path": "test/_import_two/other.pyj",
    "chars": 115,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\nother = 'other'\n\n"
  },
  {
    "path": "test/_import_two/sub.pyj",
    "chars": 209,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\nsub_var = 'sub'\n\ndef s"
  },
  {
    "path": "test/aes_vectors.pyj",
    "chars": 15291,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n\nfrom aes import CBC, CTR"
  },
  {
    "path": "test/annotations.pyj",
    "chars": 1617,
    "preview": "def add(a: int, b: float):\n    return a + b\n\nassrt.ok(add.__annotations__)\nassrt.equal(add.__annotations__['a'], int)\nas"
  },
  {
    "path": "test/baselib.pyj",
    "chars": 8428,
    "preview": "# vim:fileencoding=utf-8\n# globals: ρσ_iterator_symbol, ρσ_set_polyfill, ρσ_dict_polyfill, assrt\nnonlocal ρσ_set_impleme"
  },
  {
    "path": "test/classes.pyj",
    "chars": 8837,
    "preview": "# globals: assrt\n\n# empty classes are allowed\nclass Blank:\n    pass\nblank = Blank()\nassrt.ok(isinstance(blank, Blank))\n\n"
  },
  {
    "path": "test/collections.pyj",
    "chars": 2979,
    "preview": "# globals: assrt\n# ARRAYS\n\n# immutables\na = [4,5,6,7]\n\n# mutables\nclass Item:\n    pass\ni0 = Item()\ni1 = Item()\ni2 = Item"
  },
  {
    "path": "test/decorators.pyj",
    "chars": 1062,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\ndef double(f):\n    retur"
  },
  {
    "path": "test/docstrings.pyj",
    "chars": 784,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n# globals: ρσ_module_doc_"
  },
  {
    "path": "test/elementmaker_test.pyj",
    "chars": 1152,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n# globals: assrt\n\nfrom el"
  },
  {
    "path": "test/functions.pyj",
    "chars": 2923,
    "preview": "# globals: assrt\n\ndef nothing():\n    pass\nassrt.equal(nothing(), undefined)\n\nadd = def(a, b):\n    return a+b\ndef sub(a, "
  },
  {
    "path": "test/generators.pyj",
    "chars": 891,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\ndef g1():\n    yield 1\n"
  },
  {
    "path": "test/generic.pyj",
    "chars": 8807,
    "preview": "# globals: assrt, ρσ_last_exception\n\nimport traceback\n\ndef throw_test(code):\n    assrt.throws(def():\n        RapydScript"
  },
  {
    "path": "test/imports.pyj",
    "chars": 1860,
    "preview": "# globals:test_path, GLOBAL_SYMBOL, assrt\nfrom _import_one import toplevel_var, toplevel_func as tf, TopLevel, true_var,"
  },
  {
    "path": "test/internationalization.pyj",
    "chars": 2162,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\nfrom gettext import gett"
  },
  {
    "path": "test/lint.pyj",
    "chars": 4927,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\nlinter = require('../t"
  },
  {
    "path": "test/loops.pyj",
    "chars": 1518,
    "preview": "# globals: assrt\n# loop through values, not indices\na = ['foo', 'bar', 'baz']\nfor val in a:\n\tassrt.ok(val in a)\n\nfor i i"
  },
  {
    "path": "test/regexp.pyj",
    "chars": 2182,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n\n# Test the re module\ni"
  },
  {
    "path": "test/repl.pyj",
    "chars": 2844,
    "preview": "# globals: compiler_dir\nstdout = []\ndef clear():\n    stdout.length = 0\n\nclass FakeConsole:\n\n    def log(self):\n        A"
  },
  {
    "path": "test/scoped_flags.pyj",
    "chars": 1377,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>\n\na = {1:1}\nassrt.ok(not i"
  },
  {
    "path": "test/starargs.pyj",
    "chars": 7336,
    "preview": "# vim:fileencoding=utf-8\n# globals: assrt\n\neq = assrt.equal\nde = assrt.deepEqual\n\ndef get(obj, name):\n    return obj[nam"
  },
  {
    "path": "test/str.pyj",
    "chars": 7486,
    "preview": "# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>\n# globals: assrt\n\nimpor"
  },
  {
    "path": "tools/cli.js",
    "chars": 16843,
    "preview": "/*\n * cli.js\n * Copyright (C) 2015 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms of the BSD licens"
  },
  {
    "path": "tools/compile.js",
    "chars": 5824,
    "preview": "/*\n * compile.js\n * Copyright (C) 2015 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms of the BSD li"
  },
  {
    "path": "tools/compiler.js",
    "chars": 2380,
    "preview": "/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2015 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms "
  },
  {
    "path": "tools/completer.js",
    "chars": 4510,
    "preview": "/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2016 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms "
  },
  {
    "path": "tools/embedded_compiler.js",
    "chars": 2313,
    "preview": "/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2016 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms "
  },
  {
    "path": "tools/export.js",
    "chars": 8350,
    "preview": "/* \n * Copyright (C) 2015 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms of the BSD license\n */\n\nva"
  },
  {
    "path": "tools/gettext.js",
    "chars": 6182,
    "preview": "/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2015 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms "
  },
  {
    "path": "tools/ini.js",
    "chars": 1703,
    "preview": "/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2015 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms "
  },
  {
    "path": "tools/lint.js",
    "chars": 27607,
    "preview": "/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2015 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms "
  },
  {
    "path": "tools/msgfmt.js",
    "chars": 6884,
    "preview": "/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2015 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms "
  },
  {
    "path": "tools/repl.js",
    "chars": 8168,
    "preview": "/*\n * repl.js\n * Copyright (C) 2015 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms of the BSD licen"
  },
  {
    "path": "tools/self.js",
    "chars": 6260,
    "preview": "/*\n * self.js\n * Copyright (C) 2015 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms of the BSD licen"
  },
  {
    "path": "tools/test.js",
    "chars": 4425,
    "preview": "/*\n * test.js\n * Copyright (C) 2015 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms of the BSD licen"
  },
  {
    "path": "tools/utils.js",
    "chars": 3143,
    "preview": "/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2015 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms "
  },
  {
    "path": "tools/web_repl.js",
    "chars": 3090,
    "preview": "/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2016 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms "
  },
  {
    "path": "try",
    "chars": 863,
    "preview": "#!/usr/bin/env python3\n\nimport subprocess\nimport sys\nimport os\nimport shutil\n\nargs = sys.argv[1:]\nsource = None\n\ncmd = ["
  },
  {
    "path": "web-repl/env.js",
    "chars": 2340,
    "preview": "/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2016 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms "
  },
  {
    "path": "web-repl/index.html",
    "chars": 3511,
    "preview": "<!DOCTYPE html>\n<html>\n    <head>\n        <title>RapydScript REPL</title>\n        <meta charset=\"utf-8\" />\n        <scri"
  },
  {
    "path": "web-repl/main.js",
    "chars": 9496,
    "preview": "/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2016 Kovid Goyal <kovid at kovidgoyal.net>\n *\n * Distributed under terms "
  },
  {
    "path": "web-repl/prism.css",
    "chars": 2995,
    "preview": "/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+abap+actionscript+apacheconf+apl+"
  },
  {
    "path": "web-repl/prism.js",
    "chars": 211372,
    "preview": "/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+abap+actionscript+apacheconf+apl+"
  },
  {
    "path": "web-repl/sha1.js",
    "chars": 7312,
    "preview": "/*\n A JavaScript implementation of the SHA family of hashes, as\n defined in FIPS PUB 180-4 and FIPS PUB 202, as well as "
  }
]

About this extraction

This page contains the full source code of the kovidgoyal/rapydscript-ng GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 108 files (2.0 MB), approximately 540.8k tokens, and a symbol index with 649 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!