mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-01-14 01:07:55 -05:00
Compare commits
165 Commits
1.12.6
...
2.0.0-alph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8c150f201 | ||
|
|
a5cb8cd7c3 | ||
|
|
32799ad732 | ||
|
|
d47f90599e | ||
|
|
5817aeb837 | ||
|
|
7de06c3dcb | ||
|
|
6f0f173795 | ||
|
|
221a8720fe | ||
|
|
ff56533e0b | ||
|
|
e88619a3bb | ||
|
|
4cc701a9da | ||
|
|
d2e94c6ebd | ||
|
|
d7d32cf0b6 | ||
|
|
ebe32d35e2 | ||
|
|
ecafe7ce0f | ||
|
|
41a229e22e | ||
|
|
d9194b2670 | ||
|
|
365d1968e9 | ||
|
|
eebc432efb | ||
|
|
dd5aa2b7a4 | ||
|
|
d1d2c16fdd | ||
|
|
ef1898ba42 | ||
|
|
81cbca5bb8 | ||
|
|
da3db1be39 | ||
|
|
396bd4f2f2 | ||
|
|
cbea7b5d1c | ||
|
|
3e7973e08d | ||
|
|
ec5adf53a7 | ||
|
|
48eb173bcd | ||
|
|
69a07dfa6d | ||
|
|
800116d859 | ||
|
|
4f6073f283 | ||
|
|
9e13100f58 | ||
|
|
52bc1dab0b | ||
|
|
ff9f078a89 | ||
|
|
8d81804fee | ||
|
|
0fc625d7e9 | ||
|
|
ef1005b920 | ||
|
|
5cf8256d2e | ||
|
|
f0e884dc4e | ||
|
|
24bef3a1f5 | ||
|
|
5d557a54e1 | ||
|
|
3379f233e8 | ||
|
|
26b1584fd8 | ||
|
|
5fa91e7b95 | ||
|
|
d8bd2b7fd0 | ||
|
|
d02376c4c6 | ||
|
|
69fbb361f2 | ||
|
|
4468ca69c0 | ||
|
|
a4b3a3ba39 | ||
|
|
ad90f4ad99 | ||
|
|
cc8dd150f5 | ||
|
|
7ced071934 | ||
|
|
28d077c08a | ||
|
|
31ff5e4194 | ||
|
|
ea269104bd | ||
|
|
78b21c2483 | ||
|
|
fc42b3ed24 | ||
|
|
c8a3c1a6fd | ||
|
|
58f9428c58 | ||
|
|
3c6e235b32 | ||
|
|
35cfba06b4 | ||
|
|
f01dcd3894 | ||
|
|
e48fea1892 | ||
|
|
47bd5aca58 | ||
|
|
0aa3166709 | ||
|
|
51aaef3d76 | ||
|
|
d62f7adc9b | ||
|
|
853dd456a8 | ||
|
|
462a60da7b | ||
|
|
4abd0fa06d | ||
|
|
b1313962a7 | ||
|
|
2a862d533f | ||
|
|
a825336ba9 | ||
|
|
a55dbc0c37 | ||
|
|
818d262843 | ||
|
|
e05a4e9000 | ||
|
|
c3b3af8746 | ||
|
|
4889109b8d | ||
|
|
93f1f3777c | ||
|
|
14382abc2d | ||
|
|
85b3be9ce3 | ||
|
|
512b580820 | ||
|
|
e90cf16965 | ||
|
|
59001f2fe3 | ||
|
|
db055bb916 | ||
|
|
80fdc6ecc3 | ||
|
|
ff1725b367 | ||
|
|
d278c730ea | ||
|
|
4aa0130a92 | ||
|
|
c7ad70731a | ||
|
|
16dda9c496 | ||
|
|
b2e10e597f | ||
|
|
b2bf505e4c | ||
|
|
9c9058ebb4 | ||
|
|
ece610d682 | ||
|
|
d61d4272ce | ||
|
|
618e851cd6 | ||
|
|
2167a7ab2e | ||
|
|
ec9e559ec0 | ||
|
|
07e4047b7f | ||
|
|
7bb5ccfd80 | ||
|
|
eb36d6e7a2 | ||
|
|
000dc03360 | ||
|
|
0dd727e6eb | ||
|
|
6a845aa4f6 | ||
|
|
9eb7c63158 | ||
|
|
0f10082a21 | ||
|
|
6bd087ebb2 | ||
|
|
c7539e3310 | ||
|
|
e139d59896 | ||
|
|
b481bd1f73 | ||
|
|
2392a91033 | ||
|
|
0145bf397a | ||
|
|
d524dc8ad0 | ||
|
|
d2fb1b5ce8 | ||
|
|
286eec74f9 | ||
|
|
fb3e1a8e65 | ||
|
|
ba3411a1ac | ||
|
|
6685771255 | ||
|
|
e38866b2bf | ||
|
|
6f6df0e48d | ||
|
|
33e6242f6f | ||
|
|
aff191fc53 | ||
|
|
dd0a4f33ee | ||
|
|
4d4839011b | ||
|
|
0ef9eef87d | ||
|
|
14a63149f4 | ||
|
|
ceca091816 | ||
|
|
bc471da960 | ||
|
|
6f595f8fd3 | ||
|
|
42a10ba39e | ||
|
|
a21ce38fdf | ||
|
|
f8fa52a5d7 | ||
|
|
57ffe14fab | ||
|
|
9524159e68 | ||
|
|
dc25f462a9 | ||
|
|
663595ba94 | ||
|
|
8b1c109b9c | ||
|
|
ea3f044816 | ||
|
|
993f459880 | ||
|
|
43e580321a | ||
|
|
327395d793 | ||
|
|
acb3c8d79c | ||
|
|
ad4a6c4877 | ||
|
|
496fd5d3d3 | ||
|
|
a1bcf7f1d9 | ||
|
|
9e0a4f844a | ||
|
|
fb2be8e1e3 | ||
|
|
c04c3850ec | ||
|
|
f14e8b279c | ||
|
|
70a7265f35 | ||
|
|
b35bb20a18 | ||
|
|
def685a4e1 | ||
|
|
8647e50941 | ||
|
|
8b50fd0461 | ||
|
|
01890cd415 | ||
|
|
a1809277a0 | ||
|
|
8138c663a8 | ||
|
|
c5c4d7c8f8 | ||
|
|
f8b0c8049c | ||
|
|
1d230fe055 | ||
|
|
329b2d1cb2 | ||
|
|
bb40b1188c | ||
|
|
98068611b1 |
@@ -4,6 +4,6 @@
|
||||
|
||||
* Before sending a pull request for a feature, be sure to have [tests](https://github.com/jashkenas/coffeescript/tree/master/test).
|
||||
|
||||
* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffeescript/tree/master/src). If you're just getting started with CoffeeScript, there's a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide).
|
||||
* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffeescript/tree/master/src). If you’re just getting started with CoffeeScript, there’s a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide).
|
||||
|
||||
* In your pull request, do not add documentation to `index.html` or re-build the minified `coffee-script.js` file. We'll do those things before cutting a new release.
|
||||
* In your pull request, do not add documentation to `index.html` or re-build the minified `coffeescript.js` file. We’ll do those things before cutting a new release.
|
||||
|
||||
53
Cakefile
53
Cakefile
@@ -2,8 +2,8 @@ fs = require 'fs'
|
||||
path = require 'path'
|
||||
_ = require 'underscore'
|
||||
{ spawn, exec, execSync } = require 'child_process'
|
||||
CoffeeScript = require './lib/coffee-script'
|
||||
helpers = require './lib/coffee-script/helpers'
|
||||
CoffeeScript = require './lib/coffeescript'
|
||||
helpers = require './lib/coffeescript/helpers'
|
||||
|
||||
# ANSI Terminal Colors.
|
||||
bold = red = green = reset = ''
|
||||
@@ -51,7 +51,7 @@ run = (args, callback) ->
|
||||
buildParser = ->
|
||||
helpers.extend global, require 'util'
|
||||
require 'jison'
|
||||
parser = require('./lib/coffee-script/grammar').parser.generate()
|
||||
parser = require('./lib/coffeescript/grammar').parser.generate()
|
||||
# Patch Jison’s output, until https://github.com/zaach/jison/pull/339 is accepted,
|
||||
# to ensure that require('fs') is only called where it exists.
|
||||
parser = parser.replace "var source = require('fs')", """
|
||||
@@ -59,19 +59,19 @@ buildParser = ->
|
||||
var fs = require('fs');
|
||||
if (typeof fs !== 'undefined' && fs !== null)
|
||||
source = fs"""
|
||||
fs.writeFileSync 'lib/coffee-script/parser.js', parser
|
||||
fs.writeFileSync 'lib/coffeescript/parser.js', parser
|
||||
|
||||
buildExceptParser = (callback) ->
|
||||
files = fs.readdirSync 'src'
|
||||
files = ('src/' + file for file in files when file.match(/\.(lit)?coffee$/))
|
||||
run ['-c', '-o', 'lib/coffee-script'].concat(files), callback
|
||||
run ['-c', '-o', 'lib/coffeescript'].concat(files), callback
|
||||
|
||||
build = (callback) ->
|
||||
buildParser()
|
||||
buildExceptParser callback
|
||||
|
||||
testBuiltCode = (watch = no) ->
|
||||
csPath = './lib/coffee-script'
|
||||
csPath = './lib/coffeescript'
|
||||
csDir = path.dirname require.resolve csPath
|
||||
|
||||
for mod of require.cache when csDir is mod[0 ... csDir.length]
|
||||
@@ -122,11 +122,19 @@ task 'build:browser', 'build the merged script for inclusion in the browser', ->
|
||||
return #{fs.readFileSync "./package.json"};
|
||||
})();
|
||||
"""
|
||||
for name in ['helpers', 'rewriter', 'lexer', 'parser', 'scope', 'nodes', 'sourcemap', 'coffee-script', 'browser']
|
||||
for {name, src} in [{name: 'marked', src: 'lib/marked.js'}]
|
||||
code += """
|
||||
require['#{name}'] = (function() {
|
||||
var exports = {}, module = {exports: exports};
|
||||
#{fs.readFileSync "node_modules/#{name}/#{src}"}
|
||||
return module.exports;
|
||||
})();
|
||||
"""
|
||||
for name in ['helpers', 'rewriter', 'lexer', 'parser', 'scope', 'nodes', 'sourcemap', 'coffeescript', 'browser']
|
||||
code += """
|
||||
require['./#{name}'] = (function() {
|
||||
var exports = {}, module = {exports: exports};
|
||||
#{fs.readFileSync "lib/coffee-script/#{name}.js"}
|
||||
#{fs.readFileSync "lib/coffeescript/#{name}.js"}
|
||||
return module.exports;
|
||||
})();
|
||||
"""
|
||||
@@ -135,7 +143,7 @@ task 'build:browser', 'build the merged script for inclusion in the browser', ->
|
||||
var CoffeeScript = function() {
|
||||
function require(path){ return require[path]; }
|
||||
#{code}
|
||||
return require['./coffee-script'];
|
||||
return require['./coffeescript'];
|
||||
}();
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
@@ -153,7 +161,7 @@ task 'build:browser', 'build the merged script for inclusion in the browser', ->
|
||||
]
|
||||
outputFolder = "docs/v#{majorVersion}/browser-compiler"
|
||||
fs.mkdirSync outputFolder unless fs.existsSync outputFolder
|
||||
fs.writeFileSync "#{outputFolder}/coffee-script.js", header + '\n' + code
|
||||
fs.writeFileSync "#{outputFolder}/coffeescript.js", header + '\n' + code
|
||||
console.log "built ... running browser tests:"
|
||||
invoke 'test:browser'
|
||||
|
||||
@@ -323,8 +331,8 @@ task 'release', 'build and test the CoffeeScript source, and build the documenta
|
||||
invoke 'doc:source'
|
||||
|
||||
task 'bench', 'quick benchmark of compilation time', ->
|
||||
{Rewriter} = require './lib/coffee-script/rewriter'
|
||||
sources = ['coffee-script', 'grammar', 'helpers', 'lexer', 'nodes', 'rewriter']
|
||||
{Rewriter} = require './lib/coffeescript/rewriter'
|
||||
sources = ['coffeescript', 'grammar', 'helpers', 'lexer', 'nodes', 'rewriter']
|
||||
coffee = sources.map((name) -> fs.readFileSync "src/#{name}.coffee").join '\n'
|
||||
litcoffee = fs.readFileSync("src/scope.litcoffee").toString()
|
||||
fmt = (ms) -> " #{bold}#{ " #{ms}".slice -4 }#{reset} ms"
|
||||
@@ -347,16 +355,20 @@ task 'bench', 'quick benchmark of compilation time', ->
|
||||
# Run the CoffeeScript test suite.
|
||||
runTests = (CoffeeScript) ->
|
||||
CoffeeScript.register()
|
||||
startTime = Date.now()
|
||||
currentFile = null
|
||||
passedTests = 0
|
||||
failures = []
|
||||
startTime = Date.now()
|
||||
|
||||
# These are attached to `global` so that they’re accessible from within
|
||||
# `test/async.coffee`, which has an async-capable version of
|
||||
# `global.test`.
|
||||
global.currentFile = null
|
||||
global.passedTests = 0
|
||||
global.failures = []
|
||||
|
||||
global[name] = func for name, func of require 'assert'
|
||||
|
||||
# Convenience aliases.
|
||||
global.CoffeeScript = CoffeeScript
|
||||
global.Repl = require './lib/coffee-script/repl'
|
||||
global.Repl = require './lib/coffeescript/repl'
|
||||
|
||||
# Our test helper function for delimiting different test cases.
|
||||
global.test = (description, fn) ->
|
||||
@@ -391,6 +403,11 @@ runTests = (CoffeeScript) ->
|
||||
# Run every test in the `test` folder, recording failures.
|
||||
files = fs.readdirSync 'test'
|
||||
|
||||
# Ignore async test file if async/await is not available
|
||||
asyncSupported = parseInt(process.versions.node.split('.')[0]) >= 7 and
|
||||
('--harmony' in process.execArgv or '--harmony-async-await' in process.execArgv)
|
||||
files.splice files.indexOf('async.coffee'), 1 unless asyncSupported
|
||||
|
||||
for file in files when helpers.isCoffee file
|
||||
literate = helpers.isLiterate file
|
||||
currentFile = filename = path.join 'test', file
|
||||
@@ -407,7 +424,7 @@ task 'test', 'run the CoffeeScript language test suite', ->
|
||||
|
||||
|
||||
task 'test:browser', 'run the test suite against the merged browser script', ->
|
||||
source = fs.readFileSync "docs/v#{majorVersion}/browser-compiler/coffee-script.js", 'utf-8'
|
||||
source = fs.readFileSync "docs/v#{majorVersion}/browser-compiler/coffeescript.js", 'utf-8'
|
||||
result = {}
|
||||
global.testingBrowser = yes
|
||||
(-> eval source).call result
|
||||
|
||||
2
bin/cake
2
bin/cake
@@ -4,4 +4,4 @@ var path = require('path');
|
||||
var fs = require('fs');
|
||||
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
|
||||
|
||||
require(lib + '/coffee-script/cake').run();
|
||||
require(lib + '/coffeescript/cake').run();
|
||||
|
||||
@@ -4,4 +4,4 @@ var path = require('path');
|
||||
var fs = require('fs');
|
||||
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
|
||||
|
||||
require(lib + '/coffee-script/command').run();
|
||||
require(lib + '/coffeescript/command').run();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "coffee-script",
|
||||
"name": "coffeescript",
|
||||
"main": [
|
||||
"lib/coffee-script/coffee-script.js"
|
||||
"lib/coffeescript/coffeescript.js"
|
||||
],
|
||||
"description": "Unfancy JavaScript",
|
||||
"keywords": [
|
||||
|
||||
319
docs/v2/annotated-source/browser.html
Normal file
319
docs/v2/annotated-source/browser.html
Normal file
@@ -0,0 +1,319 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>browser.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>browser.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
<p>This <strong>Browser</strong> compatibility layer extends core CoffeeScript functions
|
||||
to make things work smoothly when compiling code directly in the browser.
|
||||
We add support for loading remote Coffee scripts via <strong>XHR</strong>, and
|
||||
<code>text/coffeescript</code> script tags, source maps via data-URLs, and so on.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>
|
||||
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span>
|
||||
CoffeeScript.<span class="hljs-built_in">require</span> = <span class="hljs-built_in">require</span>
|
||||
compile = CoffeeScript.compile</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-2">¶</a>
|
||||
</div>
|
||||
<p>Use standard JavaScript <code>eval</code> to eval code.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript.eval = <span class="hljs-function"><span class="hljs-params">(code, options = {})</span> -></span>
|
||||
options.bare ?= <span class="hljs-literal">on</span>
|
||||
eval compile code, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-3">¶</a>
|
||||
</div>
|
||||
<p>Running code does not provide access to this scope.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript.run = <span class="hljs-function"><span class="hljs-params">(code, options = {})</span> -></span>
|
||||
options.bare = <span class="hljs-literal">on</span>
|
||||
options.shiftLine = <span class="hljs-literal">on</span>
|
||||
Function(compile code, options)()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-4">¶</a>
|
||||
</div>
|
||||
<p>If we’re not in a browser environment, we’re finished with the public API.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> <span class="hljs-built_in">window</span>?</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-5">¶</a>
|
||||
</div>
|
||||
<p>Include source maps where possible. If we’ve got a base64 encoder, a
|
||||
JSON serializer, and tools for escaping unicode characters, we’re good to go.
|
||||
Ported from <a href="https://developer.mozilla.org/en-US/docs/DOM/window.btoa">https://developer.mozilla.org/en-US/docs/DOM/window.btoa</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> btoa? <span class="hljs-keyword">and</span> JSON?
|
||||
<span class="hljs-function"> <span class="hljs-title">compile</span> = <span class="hljs-params">(code, options = {})</span> -></span>
|
||||
options.inlineMap = <span class="hljs-literal">true</span>
|
||||
CoffeeScript.compile code, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-6">¶</a>
|
||||
</div>
|
||||
<p>Load a remote script from the current domain via XHR.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript.load = <span class="hljs-function"><span class="hljs-params">(url, callback, options = {}, hold = <span class="hljs-literal">false</span>)</span> -></span>
|
||||
options.sourceFiles = [url]
|
||||
xhr = <span class="hljs-keyword">if</span> <span class="hljs-built_in">window</span>.ActiveXObject
|
||||
<span class="hljs-keyword">new</span> <span class="hljs-built_in">window</span>.ActiveXObject(<span class="hljs-string">'Microsoft.XMLHTTP'</span>)
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-keyword">new</span> <span class="hljs-built_in">window</span>.XMLHttpRequest()
|
||||
xhr.open <span class="hljs-string">'GET'</span>, url, <span class="hljs-literal">true</span>
|
||||
xhr.overrideMimeType <span class="hljs-string">'text/plain'</span> <span class="hljs-keyword">if</span> <span class="hljs-string">'overrideMimeType'</span> <span class="hljs-keyword">of</span> xhr
|
||||
xhr.onreadystatechange = <span class="hljs-function">-></span>
|
||||
<span class="hljs-keyword">if</span> xhr.readyState <span class="hljs-keyword">is</span> <span class="hljs-number">4</span>
|
||||
<span class="hljs-keyword">if</span> xhr.status <span class="hljs-keyword">in</span> [<span class="hljs-number">0</span>, <span class="hljs-number">200</span>]
|
||||
param = [xhr.responseText, options]
|
||||
CoffeeScript.run param... <span class="hljs-keyword">unless</span> hold
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error <span class="hljs-string">"Could not load <span class="hljs-subst">#{url}</span>"</span>
|
||||
callback param <span class="hljs-keyword">if</span> callback
|
||||
xhr.send <span class="hljs-literal">null</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-7">¶</a>
|
||||
</div>
|
||||
<p>Activate CoffeeScript in the browser by having it compile and evaluate
|
||||
all script tags with a content-type of <code>text/coffeescript</code>.
|
||||
This happens on page load.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">runScripts</span> = -></span>
|
||||
scripts = <span class="hljs-built_in">window</span>.<span class="hljs-built_in">document</span>.getElementsByTagName <span class="hljs-string">'script'</span>
|
||||
coffeetypes = [<span class="hljs-string">'text/coffeescript'</span>, <span class="hljs-string">'text/literate-coffeescript'</span>]
|
||||
coffees = (s <span class="hljs-keyword">for</span> s <span class="hljs-keyword">in</span> scripts <span class="hljs-keyword">when</span> s.type <span class="hljs-keyword">in</span> coffeetypes)
|
||||
index = <span class="hljs-number">0</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">execute</span> = -></span>
|
||||
param = coffees[index]
|
||||
<span class="hljs-keyword">if</span> param <span class="hljs-keyword">instanceof</span> Array
|
||||
CoffeeScript.run param...
|
||||
index++
|
||||
execute()
|
||||
|
||||
<span class="hljs-keyword">for</span> script, i <span class="hljs-keyword">in</span> coffees
|
||||
<span class="hljs-keyword">do</span> (script, i) ->
|
||||
options = literate: script.type <span class="hljs-keyword">is</span> coffeetypes[<span class="hljs-number">1</span>]
|
||||
source = script.src <span class="hljs-keyword">or</span> script.getAttribute(<span class="hljs-string">'data-src'</span>)
|
||||
<span class="hljs-keyword">if</span> source
|
||||
options.filename = source
|
||||
CoffeeScript.load source,
|
||||
<span class="hljs-function"><span class="hljs-params">(param)</span> -></span>
|
||||
coffees[i] = param
|
||||
execute()
|
||||
options
|
||||
<span class="hljs-literal">true</span>
|
||||
<span class="hljs-keyword">else</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-8">¶</a>
|
||||
</div>
|
||||
<p><code>options.filename</code> defines the filename the source map appears as
|
||||
in Developer Tools. If a script tag has an <code>id</code>, use that as the
|
||||
filename; otherwise use <code>coffeescript</code>, or <code>coffeescript1</code> etc.,
|
||||
leaving the first one unnumbered for the common case that there’s
|
||||
only one CoffeeScript script block to parse.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> options.filename = <span class="hljs-keyword">if</span> script.id <span class="hljs-keyword">and</span> script.id <span class="hljs-keyword">isnt</span> <span class="hljs-string">''</span> <span class="hljs-keyword">then</span> script.id <span class="hljs-keyword">else</span> <span class="hljs-string">"coffeescript<span class="hljs-subst">#{<span class="hljs-keyword">if</span> i <span class="hljs-keyword">isnt</span> <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> i <span class="hljs-keyword">else</span> <span class="hljs-string">''</span>}</span>"</span>
|
||||
options.sourceFiles = [<span class="hljs-string">'embedded'</span>]
|
||||
coffees[i] = [script.innerHTML, options]
|
||||
|
||||
execute()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-9">¶</a>
|
||||
</div>
|
||||
<p>Listen for window load, both in decent browsers and in IE.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> <span class="hljs-built_in">window</span>.addEventListener
|
||||
<span class="hljs-built_in">window</span>.addEventListener <span class="hljs-string">'DOMContentLoaded'</span>, runScripts, <span class="hljs-literal">no</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-built_in">window</span>.attachEvent <span class="hljs-string">'onload'</span>, runScripts</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
345
docs/v2/annotated-source/cake.html
Normal file
345
docs/v2/annotated-source/cake.html
Normal file
@@ -0,0 +1,345 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>cake.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>cake.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
<p><code>cake</code> is a simplified version of <a href="http://www.gnu.org/software/make/">Make</a>
|
||||
(<a href="http://rake.rubyforge.org/">Rake</a>, <a href="http://github.com/280north/jake">Jake</a>)
|
||||
for CoffeeScript. You define tasks with names and descriptions in a Cakefile,
|
||||
and can call them from the command line, or invoke them from other tasks.</p>
|
||||
<p>Running <code>cake</code> with no arguments will print out a list of all the tasks in the
|
||||
current directory’s Cakefile.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-2">¶</a>
|
||||
</div>
|
||||
<p>External dependencies.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>fs = <span class="hljs-built_in">require</span> <span class="hljs-string">'fs'</span>
|
||||
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
|
||||
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
|
||||
optparse = <span class="hljs-built_in">require</span> <span class="hljs-string">'./optparse'</span>
|
||||
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-3">¶</a>
|
||||
</div>
|
||||
<p>Register .coffee extension</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript.register()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-4">¶</a>
|
||||
</div>
|
||||
<p>Keep track of the list of defined tasks, the accepted options, and so on.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>tasks = {}
|
||||
options = {}
|
||||
switches = []
|
||||
oparse = <span class="hljs-literal">null</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-5">¶</a>
|
||||
</div>
|
||||
<p>Mixin the top-level Cake functions for Cakefiles to use directly.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>helpers.extend <span class="hljs-built_in">global</span>,</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-6">¶</a>
|
||||
</div>
|
||||
<p>Define a Cake task with a short name, an optional sentence description,
|
||||
and the function to run as the action itself.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> task: <span class="hljs-function"><span class="hljs-params">(name, description, action)</span> -></span>
|
||||
[action, description] = [description, action] <span class="hljs-keyword">unless</span> action
|
||||
tasks[name] = {name, description, action}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-7">¶</a>
|
||||
</div>
|
||||
<p>Define an option that the Cakefile accepts. The parsed options hash,
|
||||
containing all of the command-line options passed, will be made available
|
||||
as the first argument to the action.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> option: <span class="hljs-function"><span class="hljs-params">(letter, flag, description)</span> -></span>
|
||||
switches.push [letter, flag, description]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-8">¶</a>
|
||||
</div>
|
||||
<p>Invoke another task in the current Cakefile.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> invoke: <span class="hljs-function"><span class="hljs-params">(name)</span> -></span>
|
||||
missingTask name <span class="hljs-keyword">unless</span> tasks[name]
|
||||
tasks[name].action options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-9">¶</a>
|
||||
</div>
|
||||
<p>Run <code>cake</code>. Executes all of the tasks you pass, in order. Note that Node’s
|
||||
asynchrony may cause tasks to execute in a different order than you’d expect.
|
||||
If no tasks are passed, print the help screen. Keep a reference to the
|
||||
original directory name, when running Cake tasks from subdirectories.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.run = <span class="hljs-function">-></span>
|
||||
<span class="hljs-built_in">global</span>.__originalDirname = fs.realpathSync <span class="hljs-string">'.'</span>
|
||||
process.chdir cakefileDirectory __originalDirname
|
||||
args = process.argv[<span class="hljs-number">2.</span>.]
|
||||
CoffeeScript.run fs.readFileSync(<span class="hljs-string">'Cakefile'</span>).toString(), filename: <span class="hljs-string">'Cakefile'</span>
|
||||
oparse = <span class="hljs-keyword">new</span> optparse.OptionParser switches
|
||||
<span class="hljs-keyword">return</span> printTasks() <span class="hljs-keyword">unless</span> args.length
|
||||
<span class="hljs-keyword">try</span>
|
||||
options = oparse.parse(args)
|
||||
<span class="hljs-keyword">catch</span> e
|
||||
<span class="hljs-keyword">return</span> fatalError <span class="hljs-string">"<span class="hljs-subst">#{e}</span>"</span>
|
||||
invoke arg <span class="hljs-keyword">for</span> arg <span class="hljs-keyword">in</span> options.arguments</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-10">¶</a>
|
||||
</div>
|
||||
<p>Display the list of Cake tasks in a format similar to <code>rake -T</code></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">printTasks</span> = -></span>
|
||||
relative = path.relative <span class="hljs-keyword">or</span> path.resolve
|
||||
cakefilePath = path.join relative(__originalDirname, process.cwd()), <span class="hljs-string">'Cakefile'</span>
|
||||
<span class="hljs-built_in">console</span>.log <span class="hljs-string">"<span class="hljs-subst">#{cakefilePath}</span> defines the following tasks:\n"</span>
|
||||
<span class="hljs-keyword">for</span> name, task <span class="hljs-keyword">of</span> tasks
|
||||
spaces = <span class="hljs-number">20</span> - name.length
|
||||
spaces = <span class="hljs-keyword">if</span> spaces > <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> Array(spaces + <span class="hljs-number">1</span>).join(<span class="hljs-string">' '</span>) <span class="hljs-keyword">else</span> <span class="hljs-string">''</span>
|
||||
desc = <span class="hljs-keyword">if</span> task.description <span class="hljs-keyword">then</span> <span class="hljs-string">"# <span class="hljs-subst">#{task.description}</span>"</span> <span class="hljs-keyword">else</span> <span class="hljs-string">''</span>
|
||||
<span class="hljs-built_in">console</span>.log <span class="hljs-string">"cake <span class="hljs-subst">#{name}</span><span class="hljs-subst">#{spaces}</span> <span class="hljs-subst">#{desc}</span>"</span>
|
||||
<span class="hljs-built_in">console</span>.log oparse.help() <span class="hljs-keyword">if</span> switches.length</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-11">¶</a>
|
||||
</div>
|
||||
<p>Print an error and exit when attempting to use an invalid task/option.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">fatalError</span> = <span class="hljs-params">(message)</span> -></span>
|
||||
<span class="hljs-built_in">console</span>.error message + <span class="hljs-string">'\n'</span>
|
||||
<span class="hljs-built_in">console</span>.log <span class="hljs-string">'To see a list of all tasks/options, run "cake"'</span>
|
||||
process.exit <span class="hljs-number">1</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">missingTask</span> = <span class="hljs-params">(task)</span> -></span> fatalError <span class="hljs-string">"No such task: <span class="hljs-subst">#{task}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-12">¶</a>
|
||||
</div>
|
||||
<p>When <code>cake</code> is invoked, search in the current and all parent directories
|
||||
to find the relevant Cakefile.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">cakefileDirectory</span> = <span class="hljs-params">(dir)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> dir <span class="hljs-keyword">if</span> fs.existsSync path.join dir, <span class="hljs-string">'Cakefile'</span>
|
||||
parent = path.normalize path.join dir, <span class="hljs-string">'..'</span>
|
||||
<span class="hljs-keyword">return</span> cakefileDirectory parent <span class="hljs-keyword">unless</span> parent <span class="hljs-keyword">is</span> dir
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error <span class="hljs-string">"Cakefile not found in <span class="hljs-subst">#{process.cwd()}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
982
docs/v2/annotated-source/coffeescript.html
Normal file
982
docs/v2/annotated-source/coffeescript.html
Normal file
@@ -0,0 +1,982 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>coffeescript.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>coffeescript.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
<p>CoffeeScript can be used both on the server, as a command-line compiler based
|
||||
on Node.js/V8, or to run CoffeeScript directly in the browser. This module
|
||||
contains the main entry functions for tokenizing, parsing, and compiling
|
||||
source CoffeeScript into JavaScript.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>
|
||||
fs = <span class="hljs-built_in">require</span> <span class="hljs-string">'fs'</span>
|
||||
vm = <span class="hljs-built_in">require</span> <span class="hljs-string">'vm'</span>
|
||||
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
|
||||
{Lexer} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./lexer'</span>
|
||||
{parser} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./parser'</span>
|
||||
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
|
||||
SourceMap = <span class="hljs-built_in">require</span> <span class="hljs-string">'./sourcemap'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-2">¶</a>
|
||||
</div>
|
||||
<p>Require <code>package.json</code>, which is two levels above this file, as this file is
|
||||
evaluated from <code>lib/coffeescript</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>packageJson = <span class="hljs-built_in">require</span> <span class="hljs-string">'../../package.json'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-3">¶</a>
|
||||
</div>
|
||||
<p>The current CoffeeScript version number.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.VERSION = packageJson.version
|
||||
|
||||
exports.FILE_EXTENSIONS = [<span class="hljs-string">'.coffee'</span>, <span class="hljs-string">'.litcoffee'</span>, <span class="hljs-string">'.coffee.md'</span>]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-4">¶</a>
|
||||
</div>
|
||||
<p>Expose helpers for testing.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.helpers = helpers</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-5">¶</a>
|
||||
</div>
|
||||
<p>Function that allows for btoa in both nodejs and the browser.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">base64encode</span> = <span class="hljs-params">(src)</span> -></span> <span class="hljs-keyword">switch</span>
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-keyword">typeof</span> Buffer <span class="hljs-keyword">is</span> <span class="hljs-string">'function'</span>
|
||||
Buffer.<span class="hljs-keyword">from</span>(src).toString(<span class="hljs-string">'base64'</span>)
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-keyword">typeof</span> btoa <span class="hljs-keyword">is</span> <span class="hljs-string">'function'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-6">¶</a>
|
||||
</div>
|
||||
<p>The contents of a <code><script></code> block are encoded via UTF-16, so if any extended
|
||||
characters are used in the block, btoa will fail as it maxes out at UTF-8.
|
||||
See <a href="https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem">https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem</a>
|
||||
for the gory details, and for the solution implemented here.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> btoa encodeURIComponent(src).replace <span class="hljs-regexp">/%([0-9A-F]{2})/g</span>, <span class="hljs-function"><span class="hljs-params">(match, p1)</span> -></span>
|
||||
String.fromCharCode <span class="hljs-string">'0x'</span> + p1
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error(<span class="hljs-string">'Unable to base64 encode inline sourcemap.'</span>)</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-7">¶</a>
|
||||
</div>
|
||||
<p>Function wrapper to add source file information to SyntaxErrors thrown by the
|
||||
lexer/parser/compiler.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">withPrettyErrors</span> = <span class="hljs-params">(fn)</span> -></span>
|
||||
(code, options = {}) ->
|
||||
<span class="hljs-keyword">try</span>
|
||||
fn.call @, code, options
|
||||
<span class="hljs-keyword">catch</span> err
|
||||
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> code <span class="hljs-keyword">isnt</span> <span class="hljs-string">'string'</span> <span class="hljs-comment"># Support `CoffeeScript.nodes(tokens)`.</span>
|
||||
<span class="hljs-keyword">throw</span> helpers.updateSyntaxError err, code, options.filename</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-8">¶</a>
|
||||
</div>
|
||||
<p>For each compiled file, save its source in memory in case we need to
|
||||
recompile it later. We might need to recompile if the first compilation
|
||||
didn’t create a source map (faster) but something went wrong and we need
|
||||
a stack trace. Assuming that most of the time, code isn’t throwing
|
||||
exceptions, it’s probably more efficient to compile twice only when we
|
||||
need a stack trace, rather than always generating a source map even when
|
||||
it’s not likely to be used. Save in form of <code>filename</code>: <code>(source)</code></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>sources = {}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-9">¶</a>
|
||||
</div>
|
||||
<p>Also save source maps if generated, in form of <code>filename</code>: <code>(source map)</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>sourceMaps = {}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-10">¶</a>
|
||||
</div>
|
||||
<p>Compile CoffeeScript code to JavaScript, using the Coffee/Jison compiler.</p>
|
||||
<p>If <code>options.sourceMap</code> is specified, then <code>options.filename</code> must also be
|
||||
specified. All options that can be passed to <code>SourceMap#generate</code> may also
|
||||
be passed here.</p>
|
||||
<p>This returns a javascript string, unless <code>options.sourceMap</code> is passed,
|
||||
in which case this returns a <code>{js, v3SourceMap, sourceMap}</code>
|
||||
object, where sourceMap is a sourcemap.coffee#SourceMap object, handy for
|
||||
doing programmatic lookups.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.compile = compile = withPrettyErrors (code, options) ->
|
||||
{merge, extend} = helpers
|
||||
options = extend {}, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-11">¶</a>
|
||||
</div>
|
||||
<p>Always generate a source map if no filename is passed in, since without a
|
||||
a filename we have no way to retrieve this source later in the event that
|
||||
we need to recompile it to get a source map for <code>prepareStackTrace</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> generateSourceMap = options.sourceMap <span class="hljs-keyword">or</span> options.inlineMap <span class="hljs-keyword">or</span> <span class="hljs-keyword">not</span> options.filename?
|
||||
filename = options.filename <span class="hljs-keyword">or</span> <span class="hljs-string">'<anonymous>'</span>
|
||||
|
||||
sources[filename] = code
|
||||
map = <span class="hljs-keyword">new</span> SourceMap <span class="hljs-keyword">if</span> generateSourceMap
|
||||
|
||||
tokens = lexer.tokenize code, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-12">¶</a>
|
||||
</div>
|
||||
<p>Pass a list of referenced variables, so that generated variables won’t get
|
||||
the same name.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> options.referencedVars = (
|
||||
token[<span class="hljs-number">1</span>] <span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> tokens <span class="hljs-keyword">when</span> token[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'IDENTIFIER'</span>
|
||||
)</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-13">¶</a>
|
||||
</div>
|
||||
<p>Check for import or export; if found, force bare mode.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">unless</span> options.bare? <span class="hljs-keyword">and</span> options.bare <span class="hljs-keyword">is</span> <span class="hljs-literal">yes</span>
|
||||
<span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> tokens
|
||||
<span class="hljs-keyword">if</span> token[<span class="hljs-number">0</span>] <span class="hljs-keyword">in</span> [<span class="hljs-string">'IMPORT'</span>, <span class="hljs-string">'EXPORT'</span>]
|
||||
options.bare = <span class="hljs-literal">yes</span>
|
||||
<span class="hljs-keyword">break</span>
|
||||
|
||||
fragments = parser.parse(tokens).compileToFragments options
|
||||
|
||||
currentLine = <span class="hljs-number">0</span>
|
||||
currentLine += <span class="hljs-number">1</span> <span class="hljs-keyword">if</span> options.header
|
||||
currentLine += <span class="hljs-number">1</span> <span class="hljs-keyword">if</span> options.shiftLine
|
||||
currentColumn = <span class="hljs-number">0</span>
|
||||
js = <span class="hljs-string">""</span>
|
||||
<span class="hljs-keyword">for</span> fragment <span class="hljs-keyword">in</span> fragments</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-14">¶</a>
|
||||
</div>
|
||||
<p>Update the sourcemap with data from each fragment.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> generateSourceMap</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-15">¶</a>
|
||||
</div>
|
||||
<p>Do not include empty, whitespace, or semicolon-only fragments.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> fragment.locationData <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> <span class="hljs-regexp">/^[;\s]*$/</span>.test fragment.code
|
||||
map.add(
|
||||
[fragment.locationData.first_line, fragment.locationData.first_column]
|
||||
[currentLine, currentColumn]
|
||||
{noReplace: <span class="hljs-literal">true</span>})
|
||||
newLines = helpers.count fragment.code, <span class="hljs-string">"\n"</span>
|
||||
currentLine += newLines
|
||||
<span class="hljs-keyword">if</span> newLines
|
||||
currentColumn = fragment.code.length - (fragment.code.lastIndexOf(<span class="hljs-string">"\n"</span>) + <span class="hljs-number">1</span>)
|
||||
<span class="hljs-keyword">else</span>
|
||||
currentColumn += fragment.code.length</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-16">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-16">¶</a>
|
||||
</div>
|
||||
<p>Copy the code from each fragment into the final JavaScript.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> js += fragment.code
|
||||
|
||||
<span class="hljs-keyword">if</span> options.header
|
||||
header = <span class="hljs-string">"Generated by CoffeeScript <span class="hljs-subst">#{@VERSION}</span>"</span>
|
||||
js = <span class="hljs-string">"// <span class="hljs-subst">#{header}</span>\n<span class="hljs-subst">#{js}</span>"</span>
|
||||
|
||||
<span class="hljs-keyword">if</span> generateSourceMap
|
||||
v3SourceMap = map.generate(options, code)
|
||||
sourceMaps[filename] = map
|
||||
|
||||
<span class="hljs-keyword">if</span> options.inlineMap
|
||||
encoded = base64encode JSON.stringify v3SourceMap
|
||||
sourceMapDataURI = <span class="hljs-string">"//# sourceMappingURL=data:application/json;base64,<span class="hljs-subst">#{encoded}</span>"</span>
|
||||
sourceURL = <span class="hljs-string">"//# sourceURL=<span class="hljs-subst">#{options.filename ? <span class="hljs-string">'coffeescript'</span>}</span>"</span>
|
||||
js = <span class="hljs-string">"<span class="hljs-subst">#{js}</span>\n<span class="hljs-subst">#{sourceMapDataURI}</span>\n<span class="hljs-subst">#{sourceURL}</span>"</span>
|
||||
|
||||
<span class="hljs-keyword">if</span> options.sourceMap
|
||||
{
|
||||
js
|
||||
sourceMap: map
|
||||
v3SourceMap: JSON.stringify v3SourceMap, <span class="hljs-literal">null</span>, <span class="hljs-number">2</span>
|
||||
}
|
||||
<span class="hljs-keyword">else</span>
|
||||
js</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-17">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-17">¶</a>
|
||||
</div>
|
||||
<p>Tokenize a string of CoffeeScript code, and return the array of tokens.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.tokens = withPrettyErrors (code, options) ->
|
||||
lexer.tokenize code, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-18">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-18">¶</a>
|
||||
</div>
|
||||
<p>Parse a string of CoffeeScript code or an array of lexed tokens, and
|
||||
return the AST. You can then compile it by calling <code>.compile()</code> on the root,
|
||||
or traverse it by using <code>.traverseChildren()</code> with a callback.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.nodes = withPrettyErrors (source, options) ->
|
||||
<span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> source <span class="hljs-keyword">is</span> <span class="hljs-string">'string'</span>
|
||||
parser.parse lexer.tokenize source, options
|
||||
<span class="hljs-keyword">else</span>
|
||||
parser.parse source</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-19">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-19">¶</a>
|
||||
</div>
|
||||
<p>Compile and execute a string of CoffeeScript (on the server), correctly
|
||||
setting <code>__filename</code>, <code>__dirname</code>, and relative <code>require()</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.run = <span class="hljs-function"><span class="hljs-params">(code, options = {})</span> -></span>
|
||||
mainModule = <span class="hljs-built_in">require</span>.main</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-20">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-20">¶</a>
|
||||
</div>
|
||||
<p>Set the filename.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> mainModule.filename = process.argv[<span class="hljs-number">1</span>] =
|
||||
<span class="hljs-keyword">if</span> options.filename <span class="hljs-keyword">then</span> fs.realpathSync(options.filename) <span class="hljs-keyword">else</span> <span class="hljs-string">'<anonymous>'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-21">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-21">¶</a>
|
||||
</div>
|
||||
<p>Clear the module cache.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> mainModule.moduleCache <span class="hljs-keyword">and</span>= {}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-22">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-22">¶</a>
|
||||
</div>
|
||||
<p>Assign paths for node_modules loading</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> dir = <span class="hljs-keyword">if</span> options.filename?
|
||||
path.dirname fs.realpathSync options.filename
|
||||
<span class="hljs-keyword">else</span>
|
||||
fs.realpathSync <span class="hljs-string">'.'</span>
|
||||
mainModule.paths = <span class="hljs-built_in">require</span>(<span class="hljs-string">'module'</span>)._nodeModulePaths dir</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-23">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-23">¶</a>
|
||||
</div>
|
||||
<p>Compile.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> helpers.isCoffee(mainModule.filename) <span class="hljs-keyword">or</span> <span class="hljs-built_in">require</span>.extensions
|
||||
answer = compile code, options
|
||||
code = answer.js ? answer
|
||||
|
||||
mainModule._compile code, mainModule.filename</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-24">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-24">¶</a>
|
||||
</div>
|
||||
<p>Compile and evaluate a string of CoffeeScript (in a Node.js-like environment).
|
||||
The CoffeeScript REPL uses this to run the input.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.eval = <span class="hljs-function"><span class="hljs-params">(code, options = {})</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> code = code.trim()
|
||||
createContext = vm.Script.createContext ? vm.createContext
|
||||
|
||||
isContext = vm.isContext ? (ctx) ->
|
||||
options.sandbox <span class="hljs-keyword">instanceof</span> createContext().constructor
|
||||
|
||||
<span class="hljs-keyword">if</span> createContext
|
||||
<span class="hljs-keyword">if</span> options.sandbox?
|
||||
<span class="hljs-keyword">if</span> isContext options.sandbox
|
||||
sandbox = options.sandbox
|
||||
<span class="hljs-keyword">else</span>
|
||||
sandbox = createContext()
|
||||
sandbox[k] = v <span class="hljs-keyword">for</span> own k, v <span class="hljs-keyword">of</span> options.sandbox
|
||||
sandbox.<span class="hljs-built_in">global</span> = sandbox.root = sandbox.GLOBAL = sandbox
|
||||
<span class="hljs-keyword">else</span>
|
||||
sandbox = <span class="hljs-built_in">global</span>
|
||||
sandbox.__filename = options.filename || <span class="hljs-string">'eval'</span>
|
||||
sandbox.__dirname = path.dirname sandbox.__filename</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-25">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-25">¶</a>
|
||||
</div>
|
||||
<p>define module/require only if they chose not to specify their own</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">unless</span> sandbox <span class="hljs-keyword">isnt</span> <span class="hljs-built_in">global</span> <span class="hljs-keyword">or</span> sandbox.<span class="hljs-built_in">module</span> <span class="hljs-keyword">or</span> sandbox.<span class="hljs-built_in">require</span>
|
||||
Module = <span class="hljs-built_in">require</span> <span class="hljs-string">'module'</span>
|
||||
sandbox.<span class="hljs-built_in">module</span> = _module = <span class="hljs-keyword">new</span> Module(options.modulename || <span class="hljs-string">'eval'</span>)
|
||||
sandbox.<span class="hljs-built_in">require</span> = _require = <span class="hljs-function"><span class="hljs-params">(path)</span> -></span> Module._load path, _module, <span class="hljs-literal">true</span>
|
||||
_module.filename = sandbox.__filename
|
||||
<span class="hljs-keyword">for</span> r <span class="hljs-keyword">in</span> Object.getOwnPropertyNames <span class="hljs-built_in">require</span> <span class="hljs-keyword">when</span> r <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> [<span class="hljs-string">'paths'</span>, <span class="hljs-string">'arguments'</span>, <span class="hljs-string">'caller'</span>]
|
||||
_require[r] = <span class="hljs-built_in">require</span>[r]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-26">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-26">¶</a>
|
||||
</div>
|
||||
<p>use the same hack node currently uses for their own REPL</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> _require.paths = _module.paths = Module._nodeModulePaths process.cwd()
|
||||
_require.resolve = <span class="hljs-function"><span class="hljs-params">(request)</span> -></span> Module._resolveFilename request, _module
|
||||
o = {}
|
||||
o[k] = v <span class="hljs-keyword">for</span> own k, v <span class="hljs-keyword">of</span> options
|
||||
o.bare = <span class="hljs-literal">on</span> <span class="hljs-comment"># ensure return value</span>
|
||||
js = compile code, o
|
||||
<span class="hljs-keyword">if</span> sandbox <span class="hljs-keyword">is</span> <span class="hljs-built_in">global</span>
|
||||
vm.runInThisContext js
|
||||
<span class="hljs-keyword">else</span>
|
||||
vm.runInContext js, sandbox
|
||||
|
||||
exports.register = <span class="hljs-function">-></span> <span class="hljs-built_in">require</span> <span class="hljs-string">'./register'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-27">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-27">¶</a>
|
||||
</div>
|
||||
<p>Throw error with deprecation warning when depending upon implicit <code>require.extensions</code> registration</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> <span class="hljs-built_in">require</span>.extensions
|
||||
<span class="hljs-keyword">for</span> ext <span class="hljs-keyword">in</span> @FILE_EXTENSIONS <span class="hljs-keyword">then</span> <span class="hljs-keyword">do</span> (ext) ->
|
||||
<span class="hljs-built_in">require</span>.extensions[ext] ?= <span class="hljs-function">-></span>
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error <span class="hljs-string">"""
|
||||
Use CoffeeScript.register() or require the coffeescript/register module to require <span class="hljs-subst">#{ext}</span> files.
|
||||
"""</span>
|
||||
|
||||
exports._compileFile = <span class="hljs-function"><span class="hljs-params">(filename, sourceMap = <span class="hljs-literal">no</span>, inlineMap = <span class="hljs-literal">no</span>)</span> -></span>
|
||||
raw = fs.readFileSync filename, <span class="hljs-string">'utf8'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-28">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-28">¶</a>
|
||||
</div>
|
||||
<p>Strip the Unicode byte order mark, if this file begins with one.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> stripped = <span class="hljs-keyword">if</span> raw.charCodeAt(<span class="hljs-number">0</span>) <span class="hljs-keyword">is</span> <span class="hljs-number">0xFEFF</span> <span class="hljs-keyword">then</span> raw.substring <span class="hljs-number">1</span> <span class="hljs-keyword">else</span> raw
|
||||
|
||||
<span class="hljs-keyword">try</span>
|
||||
answer = compile stripped, {
|
||||
filename, sourceMap, inlineMap
|
||||
sourceFiles: [filename]
|
||||
literate: helpers.isLiterate filename
|
||||
}
|
||||
<span class="hljs-keyword">catch</span> err</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-29">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-29">¶</a>
|
||||
</div>
|
||||
<p>As the filename and code of a dynamically loaded file will be different
|
||||
from the original file compiled with CoffeeScript.run, add that
|
||||
information to error so it can be pretty-printed later.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">throw</span> helpers.updateSyntaxError err, stripped, filename
|
||||
|
||||
answer</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-30">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-30">¶</a>
|
||||
</div>
|
||||
<p>Instantiate a Lexer for our use here.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>lexer = <span class="hljs-keyword">new</span> Lexer</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-31">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-31">¶</a>
|
||||
</div>
|
||||
<p>The real Lexer produces a generic stream of tokens. This object provides a
|
||||
thin wrapper around it, compatible with the Jison API. We can then pass it
|
||||
directly as a “Jison lexer”.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>parser.lexer =
|
||||
lex: <span class="hljs-function">-></span>
|
||||
token = parser.tokens[@pos++]
|
||||
<span class="hljs-keyword">if</span> token
|
||||
[tag, @yytext, @yylloc] = token
|
||||
parser.errorToken = token.origin <span class="hljs-keyword">or</span> token
|
||||
@yylineno = @yylloc.first_line
|
||||
<span class="hljs-keyword">else</span>
|
||||
tag = <span class="hljs-string">''</span>
|
||||
|
||||
tag
|
||||
setInput: <span class="hljs-function"><span class="hljs-params">(tokens)</span> -></span>
|
||||
parser.tokens = tokens
|
||||
@pos = <span class="hljs-number">0</span>
|
||||
upcomingInput: <span class="hljs-function">-></span>
|
||||
<span class="hljs-string">""</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-32">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-32">¶</a>
|
||||
</div>
|
||||
<p>Make all the AST nodes visible to the parser.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>parser.yy = <span class="hljs-built_in">require</span> <span class="hljs-string">'./nodes'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-33">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-33">¶</a>
|
||||
</div>
|
||||
<p>Override Jison’s default error handling function.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>parser.yy.parseError = <span class="hljs-function"><span class="hljs-params">(message, {token})</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-34">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-34">¶</a>
|
||||
</div>
|
||||
<p>Disregard Jison’s message, it contains redundant line number information.
|
||||
Disregard the token, we take its value directly from the lexer in case
|
||||
the error is caused by a generated token which might refer to its origin.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> {errorToken, tokens} = parser
|
||||
[errorTag, errorText, errorLoc] = errorToken
|
||||
|
||||
errorText = <span class="hljs-keyword">switch</span>
|
||||
<span class="hljs-keyword">when</span> errorToken <span class="hljs-keyword">is</span> tokens[tokens.length - <span class="hljs-number">1</span>]
|
||||
<span class="hljs-string">'end of input'</span>
|
||||
<span class="hljs-keyword">when</span> errorTag <span class="hljs-keyword">in</span> [<span class="hljs-string">'INDENT'</span>, <span class="hljs-string">'OUTDENT'</span>]
|
||||
<span class="hljs-string">'indentation'</span>
|
||||
<span class="hljs-keyword">when</span> errorTag <span class="hljs-keyword">in</span> [<span class="hljs-string">'IDENTIFIER'</span>, <span class="hljs-string">'NUMBER'</span>, <span class="hljs-string">'INFINITY'</span>, <span class="hljs-string">'STRING'</span>, <span class="hljs-string">'STRING_START'</span>, <span class="hljs-string">'REGEX'</span>, <span class="hljs-string">'REGEX_START'</span>]
|
||||
errorTag.replace(<span class="hljs-regexp">/_START$/</span>, <span class="hljs-string">''</span>).toLowerCase()
|
||||
<span class="hljs-keyword">else</span>
|
||||
helpers.nameWhitespaceCharacter errorText</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-35">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-35">¶</a>
|
||||
</div>
|
||||
<p>The second argument has a <code>loc</code> property, which should have the location
|
||||
data for this token. Unfortunately, Jison seems to send an outdated <code>loc</code>
|
||||
(from the previous token), so we take the location information directly
|
||||
from the lexer.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> helpers.throwSyntaxError <span class="hljs-string">"unexpected <span class="hljs-subst">#{errorText}</span>"</span>, errorLoc</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-36">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-36">¶</a>
|
||||
</div>
|
||||
<p>Based on <a href="http://v8.googlecode.com/svn/branches/bleeding_edge/src/messages.js">http://v8.googlecode.com/svn/branches/bleeding_edge/src/messages.js</a>
|
||||
Modified to handle sourceMap</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">formatSourcePosition</span> = <span class="hljs-params">(frame, getSourceMapping)</span> -></span>
|
||||
filename = <span class="hljs-literal">undefined</span>
|
||||
fileLocation = <span class="hljs-string">''</span>
|
||||
|
||||
<span class="hljs-keyword">if</span> frame.isNative()
|
||||
fileLocation = <span class="hljs-string">"native"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-keyword">if</span> frame.isEval()
|
||||
filename = frame.getScriptNameOrSourceURL()
|
||||
fileLocation = <span class="hljs-string">"<span class="hljs-subst">#{frame.getEvalOrigin()}</span>, "</span> <span class="hljs-keyword">unless</span> filename
|
||||
<span class="hljs-keyword">else</span>
|
||||
filename = frame.getFileName()
|
||||
|
||||
filename <span class="hljs-keyword">or</span>= <span class="hljs-string">"<anonymous>"</span>
|
||||
|
||||
line = frame.getLineNumber()
|
||||
column = frame.getColumnNumber()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-37">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-37">¶</a>
|
||||
</div>
|
||||
<p>Check for a sourceMap position</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> source = getSourceMapping filename, line, column
|
||||
fileLocation =
|
||||
<span class="hljs-keyword">if</span> source
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{filename}</span>:<span class="hljs-subst">#{source[<span class="hljs-number">0</span>]}</span>:<span class="hljs-subst">#{source[<span class="hljs-number">1</span>]}</span>"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{filename}</span>:<span class="hljs-subst">#{line}</span>:<span class="hljs-subst">#{column}</span>"</span>
|
||||
|
||||
functionName = frame.getFunctionName()
|
||||
isConstructor = frame.isConstructor()
|
||||
isMethodCall = <span class="hljs-keyword">not</span> (frame.isToplevel() <span class="hljs-keyword">or</span> isConstructor)
|
||||
|
||||
<span class="hljs-keyword">if</span> isMethodCall
|
||||
methodName = frame.getMethodName()
|
||||
typeName = frame.getTypeName()
|
||||
|
||||
<span class="hljs-keyword">if</span> functionName
|
||||
tp = <span class="hljs-keyword">as</span> = <span class="hljs-string">''</span>
|
||||
<span class="hljs-keyword">if</span> typeName <span class="hljs-keyword">and</span> functionName.indexOf typeName
|
||||
tp = <span class="hljs-string">"<span class="hljs-subst">#{typeName}</span>."</span>
|
||||
<span class="hljs-keyword">if</span> methodName <span class="hljs-keyword">and</span> functionName.indexOf(<span class="hljs-string">".<span class="hljs-subst">#{methodName}</span>"</span>) <span class="hljs-keyword">isnt</span> functionName.length - methodName.length - <span class="hljs-number">1</span>
|
||||
<span class="hljs-keyword">as</span> = <span class="hljs-string">" [as <span class="hljs-subst">#{methodName}</span>]"</span>
|
||||
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{tp}</span><span class="hljs-subst">#{functionName}</span><span class="hljs-subst">#{<span class="hljs-keyword">as</span>}</span> (<span class="hljs-subst">#{fileLocation}</span>)"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{typeName}</span>.<span class="hljs-subst">#{methodName <span class="hljs-keyword">or</span> <span class="hljs-string">'<anonymous>'</span>}</span> (<span class="hljs-subst">#{fileLocation}</span>)"</span>
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> isConstructor
|
||||
<span class="hljs-string">"new <span class="hljs-subst">#{functionName <span class="hljs-keyword">or</span> <span class="hljs-string">'<anonymous>'</span>}</span> (<span class="hljs-subst">#{fileLocation}</span>)"</span>
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> functionName
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{functionName}</span> (<span class="hljs-subst">#{fileLocation}</span>)"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
fileLocation
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">getSourceMap</span> = <span class="hljs-params">(filename)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> sourceMaps[filename]?
|
||||
sourceMaps[filename]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-38">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-38">¶</a>
|
||||
</div>
|
||||
<p>CoffeeScript compiled in a browser may get compiled with <code>options.filename</code>
|
||||
of <code><anonymous></code>, but the browser may request the stack trace with the
|
||||
filename of the script file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> sourceMaps[<span class="hljs-string">'<anonymous>'</span>]?
|
||||
sourceMaps[<span class="hljs-string">'<anonymous>'</span>]
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> sources[filename]?
|
||||
answer = compile sources[filename],
|
||||
filename: filename
|
||||
sourceMap: <span class="hljs-literal">yes</span>
|
||||
literate: helpers.isLiterate filename
|
||||
answer.sourceMap
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-literal">null</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-39">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-39">¶</a>
|
||||
</div>
|
||||
<p>Based on <a href="http://goo.gl/ZTx1p">michaelficarra/CoffeeScriptRedux</a>
|
||||
NodeJS / V8 have no support for transforming positions in stack traces using
|
||||
sourceMap, so we must monkey-patch Error to display CoffeeScript source
|
||||
positions.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>Error.prepareStackTrace = <span class="hljs-function"><span class="hljs-params">(err, stack)</span> -></span>
|
||||
<span class="hljs-function"> <span class="hljs-title">getSourceMapping</span> = <span class="hljs-params">(filename, line, column)</span> -></span>
|
||||
sourceMap = getSourceMap filename
|
||||
answer = sourceMap.sourceLocation [line - <span class="hljs-number">1</span>, column - <span class="hljs-number">1</span>] <span class="hljs-keyword">if</span> sourceMap?
|
||||
<span class="hljs-keyword">if</span> answer? <span class="hljs-keyword">then</span> [answer[<span class="hljs-number">0</span>] + <span class="hljs-number">1</span>, answer[<span class="hljs-number">1</span>] + <span class="hljs-number">1</span>] <span class="hljs-keyword">else</span> <span class="hljs-literal">null</span>
|
||||
|
||||
frames = <span class="hljs-keyword">for</span> frame <span class="hljs-keyword">in</span> stack
|
||||
<span class="hljs-keyword">break</span> <span class="hljs-keyword">if</span> frame.getFunction() <span class="hljs-keyword">is</span> exports.run
|
||||
<span class="hljs-string">" at <span class="hljs-subst">#{formatSourcePosition frame, getSourceMapping}</span>"</span>
|
||||
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{err.toString()}</span>\n<span class="hljs-subst">#{frames.join <span class="hljs-string">'\n'</span>}</span>\n"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
882
docs/v2/annotated-source/command.html
Normal file
882
docs/v2/annotated-source/command.html
Normal file
@@ -0,0 +1,882 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>command.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>command.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
<p>The <code>coffee</code> utility. Handles command-line compilation of CoffeeScript
|
||||
into various forms: saved into <code>.js</code> files or printed to stdout
|
||||
or recompiled every time the source is saved,
|
||||
printed as a token stream or as the syntax tree, or launch an
|
||||
interactive REPL.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-2">¶</a>
|
||||
</div>
|
||||
<p>External dependencies.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>fs = <span class="hljs-built_in">require</span> <span class="hljs-string">'fs'</span>
|
||||
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
|
||||
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
|
||||
optparse = <span class="hljs-built_in">require</span> <span class="hljs-string">'./optparse'</span>
|
||||
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span>
|
||||
{spawn, exec} = <span class="hljs-built_in">require</span> <span class="hljs-string">'child_process'</span>
|
||||
{EventEmitter} = <span class="hljs-built_in">require</span> <span class="hljs-string">'events'</span>
|
||||
|
||||
useWinPathSep = path.sep <span class="hljs-keyword">is</span> <span class="hljs-string">'\\'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-3">¶</a>
|
||||
</div>
|
||||
<p>Allow CoffeeScript to emit Node.js events.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>helpers.extend CoffeeScript, <span class="hljs-keyword">new</span> EventEmitter
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">printLine</span> = <span class="hljs-params">(line)</span> -></span> process.stdout.write line + <span class="hljs-string">'\n'</span>
|
||||
<span class="hljs-function"><span class="hljs-title">printWarn</span> = <span class="hljs-params">(line)</span> -></span> process.stderr.write line + <span class="hljs-string">'\n'</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">hidden</span> = <span class="hljs-params">(file)</span> -></span> <span class="hljs-regexp">/^\.|~$/</span>.test file</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-4">¶</a>
|
||||
</div>
|
||||
<p>The help banner that is printed in conjunction with <code>-h</code>/<code>--help</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>BANNER = <span class="hljs-string">'''
|
||||
Usage: coffee [options] path/to/script.coffee -- [args]
|
||||
|
||||
If called without options, `coffee` will run your script.
|
||||
'''</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-5">¶</a>
|
||||
</div>
|
||||
<p>The list of all the valid option flags that <code>coffee</code> knows how to handle.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>SWITCHES = [
|
||||
[<span class="hljs-string">'-b'</span>, <span class="hljs-string">'--bare'</span>, <span class="hljs-string">'compile without a top-level function wrapper'</span>]
|
||||
[<span class="hljs-string">'-c'</span>, <span class="hljs-string">'--compile'</span>, <span class="hljs-string">'compile to JavaScript and save as .js files'</span>]
|
||||
[<span class="hljs-string">'-e'</span>, <span class="hljs-string">'--eval'</span>, <span class="hljs-string">'pass a string from the command line as input'</span>]
|
||||
[<span class="hljs-string">'-h'</span>, <span class="hljs-string">'--help'</span>, <span class="hljs-string">'display this help message'</span>]
|
||||
[<span class="hljs-string">'-i'</span>, <span class="hljs-string">'--interactive'</span>, <span class="hljs-string">'run an interactive CoffeeScript REPL'</span>]
|
||||
[<span class="hljs-string">'-j'</span>, <span class="hljs-string">'--join [FILE]'</span>, <span class="hljs-string">'concatenate the source CoffeeScript before compiling'</span>]
|
||||
[<span class="hljs-string">'-m'</span>, <span class="hljs-string">'--map'</span>, <span class="hljs-string">'generate source map and save as .js.map files'</span>]
|
||||
[<span class="hljs-string">'-M'</span>, <span class="hljs-string">'--inline-map'</span>, <span class="hljs-string">'generate source map and include it directly in output'</span>]
|
||||
[<span class="hljs-string">'-n'</span>, <span class="hljs-string">'--nodes'</span>, <span class="hljs-string">'print out the parse tree that the parser produces'</span>]
|
||||
[ <span class="hljs-string">'--nodejs [ARGS]'</span>, <span class="hljs-string">'pass options directly to the "node" binary'</span>]
|
||||
[ <span class="hljs-string">'--no-header'</span>, <span class="hljs-string">'suppress the "Generated by" header'</span>]
|
||||
[<span class="hljs-string">'-o'</span>, <span class="hljs-string">'--output [DIR]'</span>, <span class="hljs-string">'set the output directory for compiled JavaScript'</span>]
|
||||
[<span class="hljs-string">'-p'</span>, <span class="hljs-string">'--print'</span>, <span class="hljs-string">'print out the compiled JavaScript'</span>]
|
||||
[<span class="hljs-string">'-r'</span>, <span class="hljs-string">'--require [MODULE*]'</span>, <span class="hljs-string">'require the given module before eval or REPL'</span>]
|
||||
[<span class="hljs-string">'-s'</span>, <span class="hljs-string">'--stdio'</span>, <span class="hljs-string">'listen for and compile scripts over stdio'</span>]
|
||||
[<span class="hljs-string">'-l'</span>, <span class="hljs-string">'--literate'</span>, <span class="hljs-string">'treat stdio as literate style coffeescript'</span>]
|
||||
[<span class="hljs-string">'-t'</span>, <span class="hljs-string">'--tokens'</span>, <span class="hljs-string">'print out the tokens that the lexer/rewriter produce'</span>]
|
||||
[<span class="hljs-string">'-v'</span>, <span class="hljs-string">'--version'</span>, <span class="hljs-string">'display the version number'</span>]
|
||||
[<span class="hljs-string">'-w'</span>, <span class="hljs-string">'--watch'</span>, <span class="hljs-string">'watch scripts for changes and rerun commands'</span>]
|
||||
]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-6">¶</a>
|
||||
</div>
|
||||
<p>Top-level objects shared by all the functions.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>opts = {}
|
||||
sources = []
|
||||
sourceCode = []
|
||||
notSources = {}
|
||||
watchedDirs = {}
|
||||
optionParser = <span class="hljs-literal">null</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-7">¶</a>
|
||||
</div>
|
||||
<p>Run <code>coffee</code> by parsing passed options and determining what action to take.
|
||||
Many flags cause us to divert before compiling anything. Flags passed after
|
||||
<code>--</code> will be passed verbatim to your script as arguments in <code>process.argv</code></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.run = <span class="hljs-function">-></span>
|
||||
parseOptions()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-8">¶</a>
|
||||
</div>
|
||||
<p>Make the REPL <em>CLI</em> use the global context so as to (a) be consistent with the
|
||||
<code>node</code> REPL CLI and, therefore, (b) make packages that modify native prototypes
|
||||
(such as ‘colors’ and ‘sugar’) work as expected.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> replCliOpts = useGlobal: <span class="hljs-literal">yes</span>
|
||||
opts.prelude = makePrelude opts.<span class="hljs-built_in">require</span> <span class="hljs-keyword">if</span> opts.<span class="hljs-built_in">require</span>
|
||||
replCliOpts.prelude = opts.prelude
|
||||
<span class="hljs-keyword">return</span> forkNode() <span class="hljs-keyword">if</span> opts.nodejs
|
||||
<span class="hljs-keyword">return</span> usage() <span class="hljs-keyword">if</span> opts.help
|
||||
<span class="hljs-keyword">return</span> version() <span class="hljs-keyword">if</span> opts.version
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">'./repl'</span>).start(replCliOpts) <span class="hljs-keyword">if</span> opts.interactive
|
||||
<span class="hljs-keyword">return</span> compileStdio() <span class="hljs-keyword">if</span> opts.stdio
|
||||
<span class="hljs-keyword">return</span> compileScript <span class="hljs-literal">null</span>, opts.arguments[<span class="hljs-number">0</span>] <span class="hljs-keyword">if</span> opts.eval
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">'./repl'</span>).start(replCliOpts) <span class="hljs-keyword">unless</span> opts.arguments.length
|
||||
literals = <span class="hljs-keyword">if</span> opts.run <span class="hljs-keyword">then</span> opts.arguments.splice <span class="hljs-number">1</span> <span class="hljs-keyword">else</span> []
|
||||
process.argv = process.argv[<span class="hljs-number">0.</span><span class="hljs-number">.1</span>].concat literals
|
||||
process.argv[<span class="hljs-number">0</span>] = <span class="hljs-string">'coffee'</span>
|
||||
|
||||
opts.output = path.resolve opts.output <span class="hljs-keyword">if</span> opts.output
|
||||
<span class="hljs-keyword">if</span> opts.join
|
||||
opts.join = path.resolve opts.join
|
||||
<span class="hljs-built_in">console</span>.error <span class="hljs-string">'''
|
||||
|
||||
The --join option is deprecated and will be removed in a future version.
|
||||
|
||||
If for some reason it's necessary to share local variables between files,
|
||||
replace...
|
||||
|
||||
$ coffee --compile --join bundle.js -- a.coffee b.coffee c.coffee
|
||||
|
||||
with...
|
||||
|
||||
$ cat a.coffee b.coffee c.coffee | coffee --compile --stdio > bundle.js
|
||||
|
||||
'''</span>
|
||||
<span class="hljs-keyword">for</span> source <span class="hljs-keyword">in</span> opts.arguments
|
||||
source = path.resolve source
|
||||
compilePath source, <span class="hljs-literal">yes</span>, source
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">makePrelude</span> = <span class="hljs-params">(requires)</span> -></span>
|
||||
requires.map (<span class="hljs-built_in">module</span>) ->
|
||||
[_, name, <span class="hljs-built_in">module</span>] = match <span class="hljs-keyword">if</span> match = <span class="hljs-built_in">module</span>.match(<span class="hljs-regexp">/^(.*)=(.*)$/</span>)
|
||||
name ||= helpers.baseFileName <span class="hljs-built_in">module</span>, <span class="hljs-literal">yes</span>, useWinPathSep
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{name}</span> = require('<span class="hljs-subst">#{<span class="hljs-built_in">module</span>}</span>')"</span>
|
||||
.join <span class="hljs-string">';'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-9">¶</a>
|
||||
</div>
|
||||
<p>Compile a path, which could be a script or a directory. If a directory
|
||||
is passed, recursively compile all ‘.coffee’, ‘.litcoffee’, and ‘.coffee.md’
|
||||
extension source files in it and all subdirectories.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">compilePath</span> = <span class="hljs-params">(source, topLevel, base)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> source <span class="hljs-keyword">in</span> sources <span class="hljs-keyword">or</span>
|
||||
watchedDirs[source] <span class="hljs-keyword">or</span>
|
||||
<span class="hljs-keyword">not</span> topLevel <span class="hljs-keyword">and</span> (notSources[source] <span class="hljs-keyword">or</span> hidden source)
|
||||
<span class="hljs-keyword">try</span>
|
||||
stats = fs.statSync source
|
||||
<span class="hljs-keyword">catch</span> err
|
||||
<span class="hljs-keyword">if</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span>
|
||||
<span class="hljs-built_in">console</span>.error <span class="hljs-string">"File not found: <span class="hljs-subst">#{source}</span>"</span>
|
||||
process.exit <span class="hljs-number">1</span>
|
||||
<span class="hljs-keyword">throw</span> err
|
||||
<span class="hljs-keyword">if</span> stats.isDirectory()
|
||||
<span class="hljs-keyword">if</span> path.basename(source) <span class="hljs-keyword">is</span> <span class="hljs-string">'node_modules'</span>
|
||||
notSources[source] = <span class="hljs-literal">yes</span>
|
||||
<span class="hljs-keyword">return</span>
|
||||
<span class="hljs-keyword">if</span> opts.run
|
||||
compilePath findDirectoryIndex(source), topLevel, base
|
||||
<span class="hljs-keyword">return</span>
|
||||
watchDir source, base <span class="hljs-keyword">if</span> opts.watch
|
||||
<span class="hljs-keyword">try</span>
|
||||
files = fs.readdirSync source
|
||||
<span class="hljs-keyword">catch</span> err
|
||||
<span class="hljs-keyword">if</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span> <span class="hljs-keyword">then</span> <span class="hljs-keyword">return</span> <span class="hljs-keyword">else</span> <span class="hljs-keyword">throw</span> err
|
||||
<span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> files
|
||||
compilePath (path.join source, file), <span class="hljs-literal">no</span>, base
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> topLevel <span class="hljs-keyword">or</span> helpers.isCoffee source
|
||||
sources.push source
|
||||
sourceCode.push <span class="hljs-literal">null</span>
|
||||
<span class="hljs-keyword">delete</span> notSources[source]
|
||||
watch source, base <span class="hljs-keyword">if</span> opts.watch
|
||||
<span class="hljs-keyword">try</span>
|
||||
code = fs.readFileSync source
|
||||
<span class="hljs-keyword">catch</span> err
|
||||
<span class="hljs-keyword">if</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span> <span class="hljs-keyword">then</span> <span class="hljs-keyword">return</span> <span class="hljs-keyword">else</span> <span class="hljs-keyword">throw</span> err
|
||||
compileScript(source, code.toString(), base)
|
||||
<span class="hljs-keyword">else</span>
|
||||
notSources[source] = <span class="hljs-literal">yes</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">findDirectoryIndex</span> = <span class="hljs-params">(source)</span> -></span>
|
||||
<span class="hljs-keyword">for</span> ext <span class="hljs-keyword">in</span> CoffeeScript.FILE_EXTENSIONS
|
||||
index = path.join source, <span class="hljs-string">"index<span class="hljs-subst">#{ext}</span>"</span>
|
||||
<span class="hljs-keyword">try</span>
|
||||
<span class="hljs-keyword">return</span> index <span class="hljs-keyword">if</span> (fs.statSync index).isFile()
|
||||
<span class="hljs-keyword">catch</span> err
|
||||
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span>
|
||||
<span class="hljs-built_in">console</span>.error <span class="hljs-string">"Missing index.coffee or index.litcoffee in <span class="hljs-subst">#{source}</span>"</span>
|
||||
process.exit <span class="hljs-number">1</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-10">¶</a>
|
||||
</div>
|
||||
<p>Compile a single source script, containing the given code, according to the
|
||||
requested options. If evaluating the script directly sets <code>__filename</code>,
|
||||
<code>__dirname</code> and <code>module.filename</code> to be correct relative to the script’s path.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">compileScript</span> = <span class="hljs-params">(file, input, base = <span class="hljs-literal">null</span>)</span> -></span>
|
||||
o = opts
|
||||
options = compileOptions file, base
|
||||
<span class="hljs-keyword">try</span>
|
||||
t = task = {file, input, options}
|
||||
CoffeeScript.emit <span class="hljs-string">'compile'</span>, task
|
||||
<span class="hljs-keyword">if</span> o.tokens
|
||||
printTokens CoffeeScript.tokens t.input, t.options
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> o.nodes
|
||||
printLine CoffeeScript.nodes(t.input, t.options).toString().trim()
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> o.run
|
||||
CoffeeScript.register()
|
||||
CoffeeScript.eval opts.prelude, t.options <span class="hljs-keyword">if</span> opts.prelude
|
||||
CoffeeScript.run t.input, t.options
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> o.join <span class="hljs-keyword">and</span> t.file <span class="hljs-keyword">isnt</span> o.join
|
||||
t.input = helpers.invertLiterate t.input <span class="hljs-keyword">if</span> helpers.isLiterate file
|
||||
sourceCode[sources.indexOf(t.file)] = t.input
|
||||
compileJoin()
|
||||
<span class="hljs-keyword">else</span>
|
||||
compiled = CoffeeScript.compile t.input, t.options
|
||||
t.output = compiled
|
||||
<span class="hljs-keyword">if</span> o.map
|
||||
t.output = compiled.js
|
||||
t.sourceMap = compiled.v3SourceMap
|
||||
|
||||
CoffeeScript.emit <span class="hljs-string">'success'</span>, task
|
||||
<span class="hljs-keyword">if</span> o.<span class="hljs-built_in">print</span>
|
||||
printLine t.output.trim()
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> o.compile <span class="hljs-keyword">or</span> o.map
|
||||
writeJs base, t.file, t.output, options.jsPath, t.sourceMap
|
||||
<span class="hljs-keyword">catch</span> err
|
||||
CoffeeScript.emit <span class="hljs-string">'failure'</span>, err, task
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> CoffeeScript.listeners(<span class="hljs-string">'failure'</span>).length
|
||||
message = err?.stack <span class="hljs-keyword">or</span> <span class="hljs-string">"<span class="hljs-subst">#{err}</span>"</span>
|
||||
<span class="hljs-keyword">if</span> o.watch
|
||||
printLine message + <span class="hljs-string">'\x07'</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
printWarn message
|
||||
process.exit <span class="hljs-number">1</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-11">¶</a>
|
||||
</div>
|
||||
<p>Attach the appropriate listeners to compile scripts incoming over <strong>stdin</strong>,
|
||||
and write them back to <strong>stdout</strong>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">compileStdio</span> = -></span>
|
||||
buffers = []
|
||||
stdin = process.openStdin()
|
||||
stdin.<span class="hljs-literal">on</span> <span class="hljs-string">'data'</span>, <span class="hljs-function"><span class="hljs-params">(buffer)</span> -></span>
|
||||
buffers.push buffer <span class="hljs-keyword">if</span> buffer
|
||||
stdin.<span class="hljs-literal">on</span> <span class="hljs-string">'end'</span>, <span class="hljs-function">-></span>
|
||||
compileScript <span class="hljs-literal">null</span>, Buffer.concat(buffers).toString()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-12">¶</a>
|
||||
</div>
|
||||
<p>If all of the source files are done being read, concatenate and compile
|
||||
them together.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>joinTimeout = <span class="hljs-literal">null</span>
|
||||
<span class="hljs-function"><span class="hljs-title">compileJoin</span> = -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> opts.join
|
||||
<span class="hljs-keyword">unless</span> sourceCode.some(<span class="hljs-function"><span class="hljs-params">(code)</span> -></span> code <span class="hljs-keyword">is</span> <span class="hljs-literal">null</span>)
|
||||
clearTimeout joinTimeout
|
||||
joinTimeout = wait <span class="hljs-number">100</span>, <span class="hljs-function">-></span>
|
||||
compileScript opts.join, sourceCode.join(<span class="hljs-string">'\n'</span>), opts.join</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-13">¶</a>
|
||||
</div>
|
||||
<p>Watch a source CoffeeScript file using <code>fs.watch</code>, recompiling it every
|
||||
time the file is updated. May be used in combination with other options,
|
||||
such as <code>--print</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">watch</span> = <span class="hljs-params">(source, base)</span> -></span>
|
||||
watcher = <span class="hljs-literal">null</span>
|
||||
prevStats = <span class="hljs-literal">null</span>
|
||||
compileTimeout = <span class="hljs-literal">null</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">watchErr</span> = <span class="hljs-params">(err)</span> -></span>
|
||||
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> source <span class="hljs-keyword">in</span> sources
|
||||
<span class="hljs-keyword">try</span>
|
||||
rewatch()
|
||||
compile()
|
||||
<span class="hljs-keyword">catch</span>
|
||||
removeSource source, base
|
||||
compileJoin()
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">compile</span> = -></span>
|
||||
clearTimeout compileTimeout
|
||||
compileTimeout = wait <span class="hljs-number">25</span>, <span class="hljs-function">-></span>
|
||||
fs.stat source, <span class="hljs-function"><span class="hljs-params">(err, stats)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> watchErr err <span class="hljs-keyword">if</span> err
|
||||
<span class="hljs-keyword">return</span> rewatch() <span class="hljs-keyword">if</span> prevStats <span class="hljs-keyword">and</span>
|
||||
stats.size <span class="hljs-keyword">is</span> prevStats.size <span class="hljs-keyword">and</span>
|
||||
stats.mtime.getTime() <span class="hljs-keyword">is</span> prevStats.mtime.getTime()
|
||||
prevStats = stats
|
||||
fs.readFile source, <span class="hljs-function"><span class="hljs-params">(err, code)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> watchErr err <span class="hljs-keyword">if</span> err
|
||||
compileScript(source, code.toString(), base)
|
||||
rewatch()
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">startWatcher</span> = -></span>
|
||||
watcher = fs.watch source
|
||||
.<span class="hljs-literal">on</span> <span class="hljs-string">'change'</span>, compile
|
||||
.<span class="hljs-literal">on</span> <span class="hljs-string">'error'</span>, <span class="hljs-function"><span class="hljs-params">(err)</span> -></span>
|
||||
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'EPERM'</span>
|
||||
removeSource source, base
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">rewatch</span> = -></span>
|
||||
watcher?.close()
|
||||
startWatcher()
|
||||
|
||||
<span class="hljs-keyword">try</span>
|
||||
startWatcher()
|
||||
<span class="hljs-keyword">catch</span> err
|
||||
watchErr err</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-14">¶</a>
|
||||
</div>
|
||||
<p>Watch a directory of files for new additions.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">watchDir</span> = <span class="hljs-params">(source, base)</span> -></span>
|
||||
watcher = <span class="hljs-literal">null</span>
|
||||
readdirTimeout = <span class="hljs-literal">null</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">startWatcher</span> = -></span>
|
||||
watcher = fs.watch source
|
||||
.<span class="hljs-literal">on</span> <span class="hljs-string">'error'</span>, <span class="hljs-function"><span class="hljs-params">(err)</span> -></span>
|
||||
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'EPERM'</span>
|
||||
stopWatcher()
|
||||
.<span class="hljs-literal">on</span> <span class="hljs-string">'change'</span>, <span class="hljs-function">-></span>
|
||||
clearTimeout readdirTimeout
|
||||
readdirTimeout = wait <span class="hljs-number">25</span>, <span class="hljs-function">-></span>
|
||||
<span class="hljs-keyword">try</span>
|
||||
files = fs.readdirSync source
|
||||
<span class="hljs-keyword">catch</span> err
|
||||
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span>
|
||||
<span class="hljs-keyword">return</span> stopWatcher()
|
||||
<span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> files
|
||||
compilePath (path.join source, file), <span class="hljs-literal">no</span>, base
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">stopWatcher</span> = -></span>
|
||||
watcher.close()
|
||||
removeSourceDir source, base
|
||||
|
||||
watchedDirs[source] = <span class="hljs-literal">yes</span>
|
||||
<span class="hljs-keyword">try</span>
|
||||
startWatcher()
|
||||
<span class="hljs-keyword">catch</span> err
|
||||
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">removeSourceDir</span> = <span class="hljs-params">(source, base)</span> -></span>
|
||||
<span class="hljs-keyword">delete</span> watchedDirs[source]
|
||||
sourcesChanged = <span class="hljs-literal">no</span>
|
||||
<span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> sources <span class="hljs-keyword">when</span> source <span class="hljs-keyword">is</span> path.dirname file
|
||||
removeSource file, base
|
||||
sourcesChanged = <span class="hljs-literal">yes</span>
|
||||
compileJoin() <span class="hljs-keyword">if</span> sourcesChanged</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-15">¶</a>
|
||||
</div>
|
||||
<p>Remove a file from our source list, and source code cache. Optionally remove
|
||||
the compiled JS version as well.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">removeSource</span> = <span class="hljs-params">(source, base)</span> -></span>
|
||||
index = sources.indexOf source
|
||||
sources.splice index, <span class="hljs-number">1</span>
|
||||
sourceCode.splice index, <span class="hljs-number">1</span>
|
||||
<span class="hljs-keyword">unless</span> opts.join
|
||||
silentUnlink outputPath source, base
|
||||
silentUnlink outputPath source, base, <span class="hljs-string">'.js.map'</span>
|
||||
timeLog <span class="hljs-string">"removed <span class="hljs-subst">#{source}</span>"</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">silentUnlink</span> = <span class="hljs-params">(path)</span> -></span>
|
||||
<span class="hljs-keyword">try</span>
|
||||
fs.unlinkSync path
|
||||
<span class="hljs-keyword">catch</span> err
|
||||
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">in</span> [<span class="hljs-string">'ENOENT'</span>, <span class="hljs-string">'EPERM'</span>]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-16">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-16">¶</a>
|
||||
</div>
|
||||
<p>Get the corresponding output JavaScript path for a source file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">outputPath</span> = <span class="hljs-params">(source, base, extension=<span class="hljs-string">".js"</span>)</span> -></span>
|
||||
basename = helpers.baseFileName source, <span class="hljs-literal">yes</span>, useWinPathSep
|
||||
srcDir = path.dirname source
|
||||
<span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> opts.output
|
||||
dir = srcDir
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> source <span class="hljs-keyword">is</span> base
|
||||
dir = opts.output
|
||||
<span class="hljs-keyword">else</span>
|
||||
dir = path.join opts.output, path.relative base, srcDir
|
||||
path.join dir, basename + extension</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-17">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-17">¶</a>
|
||||
</div>
|
||||
<p>Recursively mkdir, like <code>mkdir -p</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">mkdirp</span> = <span class="hljs-params">(dir, fn)</span> -></span>
|
||||
mode = <span class="hljs-number">0</span>o777 & ~process.umask()
|
||||
|
||||
<span class="hljs-keyword">do</span> mkdirs = <span class="hljs-function"><span class="hljs-params">(p = dir, fn)</span> -></span>
|
||||
fs.exists p, <span class="hljs-function"><span class="hljs-params">(exists)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> exists
|
||||
fn()
|
||||
<span class="hljs-keyword">else</span>
|
||||
mkdirs path.dirname(p), <span class="hljs-function">-></span>
|
||||
fs.mkdir p, mode, <span class="hljs-function"><span class="hljs-params">(err)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> fn err <span class="hljs-keyword">if</span> err
|
||||
fn()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-18">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-18">¶</a>
|
||||
</div>
|
||||
<p>Write out a JavaScript source file with the compiled code. By default, files
|
||||
are written out in <code>cwd</code> as <code>.js</code> files with the same name, but the output
|
||||
directory can be customized with <code>--output</code>.</p>
|
||||
<p>If <code>generatedSourceMap</code> is provided, this will write a <code>.js.map</code> file into the
|
||||
same directory as the <code>.js</code> file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">writeJs</span> = <span class="hljs-params">(base, sourcePath, js, jsPath, generatedSourceMap = <span class="hljs-literal">null</span>)</span> -></span>
|
||||
sourceMapPath = outputPath sourcePath, base, <span class="hljs-string">".js.map"</span>
|
||||
jsDir = path.dirname jsPath
|
||||
<span class="hljs-function"> <span class="hljs-title">compile</span> = -></span>
|
||||
<span class="hljs-keyword">if</span> opts.compile
|
||||
js = <span class="hljs-string">' '</span> <span class="hljs-keyword">if</span> js.length <= <span class="hljs-number">0</span>
|
||||
<span class="hljs-keyword">if</span> generatedSourceMap <span class="hljs-keyword">then</span> js = <span class="hljs-string">"<span class="hljs-subst">#{js}</span>\n//# sourceMappingURL=<span class="hljs-subst">#{helpers.baseFileName sourceMapPath, <span class="hljs-literal">no</span>, useWinPathSep}</span>\n"</span>
|
||||
fs.writeFile jsPath, js, <span class="hljs-function"><span class="hljs-params">(err)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> err
|
||||
printLine err.message
|
||||
process.exit <span class="hljs-number">1</span>
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> opts.compile <span class="hljs-keyword">and</span> opts.watch
|
||||
timeLog <span class="hljs-string">"compiled <span class="hljs-subst">#{sourcePath}</span>"</span>
|
||||
<span class="hljs-keyword">if</span> generatedSourceMap
|
||||
fs.writeFile sourceMapPath, generatedSourceMap, <span class="hljs-function"><span class="hljs-params">(err)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> err
|
||||
printLine <span class="hljs-string">"Could not write source map: <span class="hljs-subst">#{err.message}</span>"</span>
|
||||
process.exit <span class="hljs-number">1</span>
|
||||
fs.exists jsDir, <span class="hljs-function"><span class="hljs-params">(itExists)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> itExists <span class="hljs-keyword">then</span> compile() <span class="hljs-keyword">else</span> mkdirp jsDir, compile</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-19">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-19">¶</a>
|
||||
</div>
|
||||
<p>Convenience for cleaner setTimeouts.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">wait</span> = <span class="hljs-params">(milliseconds, func)</span> -></span> setTimeout func, milliseconds</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-20">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-20">¶</a>
|
||||
</div>
|
||||
<p>When watching scripts, it’s useful to log changes with the timestamp.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">timeLog</span> = <span class="hljs-params">(message)</span> -></span>
|
||||
<span class="hljs-built_in">console</span>.log <span class="hljs-string">"<span class="hljs-subst">#{(<span class="hljs-keyword">new</span> Date).toLocaleTimeString()}</span> - <span class="hljs-subst">#{message}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-21">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-21">¶</a>
|
||||
</div>
|
||||
<p>Pretty-print a stream of tokens, sans location data.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">printTokens</span> = <span class="hljs-params">(tokens)</span> -></span>
|
||||
strings = <span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> tokens
|
||||
tag = token[<span class="hljs-number">0</span>]
|
||||
value = token[<span class="hljs-number">1</span>].toString().replace(<span class="hljs-regexp">/\n/</span>, <span class="hljs-string">'\\n'</span>)
|
||||
<span class="hljs-string">"[<span class="hljs-subst">#{tag}</span> <span class="hljs-subst">#{value}</span>]"</span>
|
||||
printLine strings.join(<span class="hljs-string">' '</span>)</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-22">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-22">¶</a>
|
||||
</div>
|
||||
<p>Use the <a href="optparse.html">OptionParser module</a> to extract all options from
|
||||
<code>process.argv</code> that are specified in <code>SWITCHES</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">parseOptions</span> = -></span>
|
||||
optionParser = <span class="hljs-keyword">new</span> optparse.OptionParser SWITCHES, BANNER
|
||||
o = opts = optionParser.parse process.argv[<span class="hljs-number">2.</span>.]
|
||||
o.compile <span class="hljs-keyword">or</span>= !!o.output
|
||||
o.run = <span class="hljs-keyword">not</span> (o.compile <span class="hljs-keyword">or</span> o.<span class="hljs-built_in">print</span> <span class="hljs-keyword">or</span> o.map)
|
||||
o.<span class="hljs-built_in">print</span> = !! (o.<span class="hljs-built_in">print</span> <span class="hljs-keyword">or</span> (o.eval <span class="hljs-keyword">or</span> o.stdio <span class="hljs-keyword">and</span> o.compile))</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-23">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-23">¶</a>
|
||||
</div>
|
||||
<p>The compile-time options to pass to the CoffeeScript compiler.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">compileOptions</span> = <span class="hljs-params">(filename, base)</span> -></span>
|
||||
answer = {
|
||||
filename
|
||||
literate: opts.literate <span class="hljs-keyword">or</span> helpers.isLiterate(filename)
|
||||
bare: opts.bare
|
||||
header: opts.compile <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> opts[<span class="hljs-string">'no-header'</span>]
|
||||
sourceMap: opts.map
|
||||
inlineMap: opts[<span class="hljs-string">'inline-map'</span>]
|
||||
}
|
||||
<span class="hljs-keyword">if</span> filename
|
||||
<span class="hljs-keyword">if</span> base
|
||||
cwd = process.cwd()
|
||||
jsPath = outputPath filename, base
|
||||
jsDir = path.dirname jsPath
|
||||
answer = helpers.merge answer, {
|
||||
jsPath
|
||||
sourceRoot: path.relative jsDir, cwd
|
||||
sourceFiles: [path.relative cwd, filename]
|
||||
generatedFile: helpers.baseFileName(jsPath, <span class="hljs-literal">no</span>, useWinPathSep)
|
||||
}
|
||||
<span class="hljs-keyword">else</span>
|
||||
answer = helpers.merge answer,
|
||||
sourceRoot: <span class="hljs-string">""</span>
|
||||
sourceFiles: [helpers.baseFileName filename, <span class="hljs-literal">no</span>, useWinPathSep]
|
||||
generatedFile: helpers.baseFileName(filename, <span class="hljs-literal">yes</span>, useWinPathSep) + <span class="hljs-string">".js"</span>
|
||||
answer</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-24">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-24">¶</a>
|
||||
</div>
|
||||
<p>Start up a new Node.js instance with the arguments in <code>--nodejs</code> passed to
|
||||
the <code>node</code> binary, preserving the other options.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">forkNode</span> = -></span>
|
||||
nodeArgs = opts.nodejs.split <span class="hljs-regexp">/\s+/</span>
|
||||
args = process.argv[<span class="hljs-number">1.</span>.]
|
||||
args.splice args.indexOf(<span class="hljs-string">'--nodejs'</span>), <span class="hljs-number">2</span>
|
||||
p = spawn process.execPath, nodeArgs.concat(args),
|
||||
cwd: process.cwd()
|
||||
env: process.env
|
||||
stdio: [<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>]
|
||||
p.<span class="hljs-literal">on</span> <span class="hljs-string">'exit'</span>, <span class="hljs-function"><span class="hljs-params">(code)</span> -></span> process.exit code</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-25">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-25">¶</a>
|
||||
</div>
|
||||
<p>Print the <code>--help</code> usage message and exit. Deprecated switches are not
|
||||
shown.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">usage</span> = -></span>
|
||||
printLine (<span class="hljs-keyword">new</span> optparse.OptionParser SWITCHES, BANNER).help()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-26">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-26">¶</a>
|
||||
</div>
|
||||
<p>Print the <code>--version</code> message and exit.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">version</span> = -></span>
|
||||
printLine <span class="hljs-string">"CoffeeScript version <span class="hljs-subst">#{CoffeeScript.VERSION}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
518
docs/v2/annotated-source/docco.css
Normal file
518
docs/v2/annotated-source/docco.css
Normal file
@@ -0,0 +1,518 @@
|
||||
/*--------------------- Typography ----------------------------*/
|
||||
|
||||
@font-face {
|
||||
font-family: 'aller-light';
|
||||
src: url('public/fonts/aller-light.eot');
|
||||
src: url('public/fonts/aller-light.eot?#iefix') format('embedded-opentype'),
|
||||
url('public/fonts/aller-light.woff') format('woff'),
|
||||
url('public/fonts/aller-light.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'aller-bold';
|
||||
src: url('public/fonts/aller-bold.eot');
|
||||
src: url('public/fonts/aller-bold.eot?#iefix') format('embedded-opentype'),
|
||||
url('public/fonts/aller-bold.woff') format('woff'),
|
||||
url('public/fonts/aller-bold.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'roboto-black';
|
||||
src: url('public/fonts/roboto-black.eot');
|
||||
src: url('public/fonts/roboto-black.eot?#iefix') format('embedded-opentype'),
|
||||
url('public/fonts/roboto-black.woff') format('woff'),
|
||||
url('public/fonts/roboto-black.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/*--------------------- Layout ----------------------------*/
|
||||
html { height: 100%; }
|
||||
body {
|
||||
font-family: "aller-light";
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
color: #30404f;
|
||||
margin: 0; padding: 0;
|
||||
height:100%;
|
||||
}
|
||||
#container { min-height: 100%; }
|
||||
|
||||
a {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
b, strong {
|
||||
font-weight: normal;
|
||||
font-family: "aller-bold";
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 15px 0 0px;
|
||||
}
|
||||
.annotation ul, .annotation ol {
|
||||
margin: 25px 0;
|
||||
}
|
||||
.annotation ul li, .annotation ol li {
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
color: #112233;
|
||||
line-height: 1em;
|
||||
font-weight: normal;
|
||||
font-family: "roboto-black";
|
||||
text-transform: uppercase;
|
||||
margin: 30px 0 15px 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-top: 40px;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.26em;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: 0;
|
||||
background: 1px #ddd;
|
||||
height: 1px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
pre, tt, code {
|
||||
font-size: 12px; line-height: 16px;
|
||||
font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
|
||||
margin: 0; padding: 0;
|
||||
}
|
||||
.annotation pre {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 7px 10px;
|
||||
background: #fcfcfc;
|
||||
-moz-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
|
||||
-webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
|
||||
box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
|
||||
overflow-x: auto;
|
||||
}
|
||||
.annotation pre code {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
|
||||
blockquote {
|
||||
border-left: 5px solid #ccc;
|
||||
margin: 0;
|
||||
padding: 1px 0 1px 1em;
|
||||
}
|
||||
.sections blockquote p {
|
||||
font-family: Menlo, Consolas, Monaco, monospace;
|
||||
font-size: 12px; line-height: 16px;
|
||||
color: #999;
|
||||
margin: 10px 0 0;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
ul.sections {
|
||||
list-style: none;
|
||||
padding:0 0 5px 0;;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
/*
|
||||
Force border-box so that % widths fit the parent
|
||||
container without overlap because of margin/padding.
|
||||
|
||||
More Info : http://www.quirksmode.org/css/box.html
|
||||
*/
|
||||
ul.sections > li > div {
|
||||
-moz-box-sizing: border-box; /* firefox */
|
||||
-ms-box-sizing: border-box; /* ie */
|
||||
-webkit-box-sizing: border-box; /* webkit */
|
||||
-khtml-box-sizing: border-box; /* konqueror */
|
||||
box-sizing: border-box; /* css3 */
|
||||
}
|
||||
|
||||
|
||||
/*---------------------- Jump Page -----------------------------*/
|
||||
#jump_to, #jump_page {
|
||||
margin: 0;
|
||||
background: white;
|
||||
-webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
|
||||
-webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
|
||||
font: 16px Arial;
|
||||
cursor: pointer;
|
||||
text-align: right;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#jump_to a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#jump_to a.large {
|
||||
display: none;
|
||||
}
|
||||
#jump_to a.small {
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
color: #676767;
|
||||
}
|
||||
|
||||
#jump_to, #jump_wrapper {
|
||||
position: fixed;
|
||||
right: 0; top: 0;
|
||||
padding: 10px 15px;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
#jump_wrapper {
|
||||
display: none;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
#jump_to:hover #jump_wrapper {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#jump_page_wrapper{
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
#jump_page {
|
||||
padding: 5px 0 3px;
|
||||
margin: 0 0 25px 25px;
|
||||
max-height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#jump_page .source {
|
||||
display: block;
|
||||
padding: 15px;
|
||||
text-decoration: none;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
#jump_page .source:hover {
|
||||
background: #f5f5ff;
|
||||
}
|
||||
|
||||
#jump_page .source:first-child {
|
||||
}
|
||||
|
||||
/*---------------------- Low resolutions (> 320px) ---------------------*/
|
||||
@media only screen and (min-width: 320px) {
|
||||
.pilwrap { display: none; }
|
||||
|
||||
ul.sections > li > div {
|
||||
display: block;
|
||||
padding:5px 10px 0 10px;
|
||||
}
|
||||
|
||||
ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
ul.sections > li > div.content {
|
||||
overflow-x:auto;
|
||||
-webkit-box-shadow: inset 0 0 5px #e5e5ee;
|
||||
box-shadow: inset 0 0 5px #e5e5ee;
|
||||
border: 1px solid #dedede;
|
||||
margin:5px 10px 5px 10px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
ul.sections > li > div.annotation pre {
|
||||
margin: 7px 0 7px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
ul.sections > li > div.annotation p tt, .annotation code {
|
||||
background: #f8f8ff;
|
||||
border: 1px solid #dedede;
|
||||
font-size: 12px;
|
||||
padding: 0 0.2em;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------- (> 481px) ---------------------*/
|
||||
@media only screen and (min-width: 481px) {
|
||||
#container {
|
||||
position: relative;
|
||||
}
|
||||
body {
|
||||
background-color: #F5F5FF;
|
||||
font-size: 15px;
|
||||
line-height: 21px;
|
||||
}
|
||||
pre, tt, code {
|
||||
line-height: 18px;
|
||||
}
|
||||
p, ul, ol {
|
||||
margin: 0 0 15px;
|
||||
}
|
||||
|
||||
|
||||
#jump_to {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
#jump_wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
#jump_to, #jump_page {
|
||||
font: 10px Arial;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
#jump_page .source {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
#jump_to a.large {
|
||||
display: inline-block;
|
||||
}
|
||||
#jump_to a.small {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#background {
|
||||
position: absolute;
|
||||
top: 0; bottom: 0;
|
||||
width: 350px;
|
||||
background: #fff;
|
||||
border-right: 1px solid #e5e5ee;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
|
||||
padding-left: 40px;
|
||||
}
|
||||
|
||||
ul.sections > li {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
ul.sections > li > div {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
ul.sections > li > div.annotation {
|
||||
max-width: 350px;
|
||||
min-width: 350px;
|
||||
min-height: 5px;
|
||||
padding: 13px;
|
||||
overflow-x: hidden;
|
||||
white-space: normal;
|
||||
vertical-align: top;
|
||||
text-align: left;
|
||||
}
|
||||
ul.sections > li > div.annotation pre {
|
||||
margin: 15px 0 15px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
ul.sections > li > div.content {
|
||||
padding: 13px;
|
||||
vertical-align: top;
|
||||
border: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.pilwrap {
|
||||
position: relative;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.pilcrow {
|
||||
font: 12px Arial;
|
||||
text-decoration: none;
|
||||
color: #454545;
|
||||
position: absolute;
|
||||
top: 3px; left: -20px;
|
||||
padding: 1px 2px;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.2s linear;
|
||||
}
|
||||
.for-h1 .pilcrow {
|
||||
top: 47px;
|
||||
}
|
||||
.for-h2 .pilcrow, .for-h3 .pilcrow, .for-h4 .pilcrow {
|
||||
top: 35px;
|
||||
}
|
||||
|
||||
ul.sections > li > div.annotation:hover .pilcrow {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------- (> 1025px) ---------------------*/
|
||||
@media only screen and (min-width: 1025px) {
|
||||
|
||||
body {
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
#background {
|
||||
width: 525px;
|
||||
}
|
||||
ul.sections > li > div.annotation {
|
||||
max-width: 525px;
|
||||
min-width: 525px;
|
||||
padding: 10px 25px 1px 50px;
|
||||
}
|
||||
ul.sections > li > div.content {
|
||||
padding: 9px 15px 16px 25px;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------- Syntax Highlighting -----------------------------*/
|
||||
|
||||
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
|
||||
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
|
||||
/*
|
||||
|
||||
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||
|
||||
*/
|
||||
|
||||
pre code {
|
||||
display: block; padding: 0.5em;
|
||||
color: #000;
|
||||
background: #f8f8ff
|
||||
}
|
||||
|
||||
pre .hljs-comment,
|
||||
pre .hljs-template_comment,
|
||||
pre .hljs-diff .hljs-header,
|
||||
pre .hljs-javadoc {
|
||||
color: #408080;
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
pre .hljs-keyword,
|
||||
pre .hljs-assignment,
|
||||
pre .hljs-literal,
|
||||
pre .hljs-css .hljs-rule .hljs-keyword,
|
||||
pre .hljs-winutils,
|
||||
pre .hljs-javascript .hljs-title,
|
||||
pre .hljs-lisp .hljs-title,
|
||||
pre .hljs-subst {
|
||||
color: #954121;
|
||||
/*font-weight: bold*/
|
||||
}
|
||||
|
||||
pre .hljs-number,
|
||||
pre .hljs-hexcolor {
|
||||
color: #40a070
|
||||
}
|
||||
|
||||
pre .hljs-string,
|
||||
pre .hljs-tag .hljs-value,
|
||||
pre .hljs-phpdoc,
|
||||
pre .hljs-tex .hljs-formula {
|
||||
color: #219161;
|
||||
}
|
||||
|
||||
pre .hljs-title,
|
||||
pre .hljs-id {
|
||||
color: #19469D;
|
||||
}
|
||||
pre .hljs-params {
|
||||
color: #00F;
|
||||
}
|
||||
|
||||
pre .hljs-javascript .hljs-title,
|
||||
pre .hljs-lisp .hljs-title,
|
||||
pre .hljs-subst {
|
||||
font-weight: normal
|
||||
}
|
||||
|
||||
pre .hljs-class .hljs-title,
|
||||
pre .hljs-haskell .hljs-label,
|
||||
pre .hljs-tex .hljs-command {
|
||||
color: #458;
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
pre .hljs-tag,
|
||||
pre .hljs-tag .hljs-title,
|
||||
pre .hljs-rules .hljs-property,
|
||||
pre .hljs-django .hljs-tag .hljs-keyword {
|
||||
color: #000080;
|
||||
font-weight: normal
|
||||
}
|
||||
|
||||
pre .hljs-attribute,
|
||||
pre .hljs-variable,
|
||||
pre .hljs-instancevar,
|
||||
pre .hljs-lisp .hljs-body {
|
||||
color: #008080
|
||||
}
|
||||
|
||||
pre .hljs-regexp {
|
||||
color: #B68
|
||||
}
|
||||
|
||||
pre .hljs-class {
|
||||
color: #458;
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
pre .hljs-symbol,
|
||||
pre .hljs-ruby .hljs-symbol .hljs-string,
|
||||
pre .hljs-ruby .hljs-symbol .hljs-keyword,
|
||||
pre .hljs-ruby .hljs-symbol .hljs-keymethods,
|
||||
pre .hljs-lisp .hljs-keyword,
|
||||
pre .hljs-tex .hljs-special,
|
||||
pre .hljs-input_number {
|
||||
color: #990073
|
||||
}
|
||||
|
||||
pre .hljs-builtin,
|
||||
pre .hljs-constructor,
|
||||
pre .hljs-built_in,
|
||||
pre .hljs-lisp .hljs-title {
|
||||
color: #0086b3
|
||||
}
|
||||
|
||||
pre .hljs-preprocessor,
|
||||
pre .hljs-pi,
|
||||
pre .hljs-doctype,
|
||||
pre .hljs-shebang,
|
||||
pre .hljs-cdata {
|
||||
color: #999;
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
pre .hljs-deletion {
|
||||
background: #fdd
|
||||
}
|
||||
|
||||
pre .hljs-addition {
|
||||
background: #dfd
|
||||
}
|
||||
|
||||
pre .hljs-diff .hljs-change {
|
||||
background: #0086b3
|
||||
}
|
||||
|
||||
pre .hljs-chunk {
|
||||
color: #aaa
|
||||
}
|
||||
|
||||
pre .hljs-tex .hljs-formula {
|
||||
opacity: 0.5;
|
||||
}
|
||||
1741
docs/v2/annotated-source/grammar.html
Normal file
1741
docs/v2/annotated-source/grammar.html
Normal file
File diff suppressed because it is too large
Load Diff
681
docs/v2/annotated-source/helpers.html
Normal file
681
docs/v2/annotated-source/helpers.html
Normal file
@@ -0,0 +1,681 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>helpers.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>helpers.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
<p>This file contains the common helper functions that we’d like to share among
|
||||
the <strong>Lexer</strong>, <strong>Rewriter</strong>, and the <strong>Nodes</strong>. Merge objects, flatten
|
||||
arrays, count characters, that sort of thing.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>
|
||||
marked = <span class="hljs-built_in">require</span> <span class="hljs-string">'marked'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-2">¶</a>
|
||||
</div>
|
||||
<p>marked.setOptions
|
||||
renderer: new marked.Renderer()
|
||||
gfm: true
|
||||
tables: true
|
||||
breaks: false
|
||||
pedantic: false
|
||||
sanitize: true
|
||||
smartLists: true
|
||||
smartypants: false</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-3">¶</a>
|
||||
</div>
|
||||
<p>Peek at the beginning of a given string to see if it matches a sequence.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.starts = <span class="hljs-function"><span class="hljs-params">(string, literal, start)</span> -></span>
|
||||
literal <span class="hljs-keyword">is</span> string.substr start, literal.length</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-4">¶</a>
|
||||
</div>
|
||||
<p>Peek at the end of a given string to see if it matches a sequence.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.ends = <span class="hljs-function"><span class="hljs-params">(string, literal, back)</span> -></span>
|
||||
len = literal.length
|
||||
literal <span class="hljs-keyword">is</span> string.substr string.length - len - (back <span class="hljs-keyword">or</span> <span class="hljs-number">0</span>), len</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-5">¶</a>
|
||||
</div>
|
||||
<p>Repeat a string <code>n</code> times.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.repeat = repeat = <span class="hljs-function"><span class="hljs-params">(str, n)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-6">¶</a>
|
||||
</div>
|
||||
<p>Use clever algorithm to have O(log(n)) string concatenation operations.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> res = <span class="hljs-string">''</span>
|
||||
<span class="hljs-keyword">while</span> n > <span class="hljs-number">0</span>
|
||||
res += str <span class="hljs-keyword">if</span> n & <span class="hljs-number">1</span>
|
||||
n >>>= <span class="hljs-number">1</span>
|
||||
str += str
|
||||
res</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-7">¶</a>
|
||||
</div>
|
||||
<p>Trim out all falsy values from an array.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.compact = <span class="hljs-function"><span class="hljs-params">(array)</span> -></span>
|
||||
item <span class="hljs-keyword">for</span> item <span class="hljs-keyword">in</span> array <span class="hljs-keyword">when</span> item</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-8">¶</a>
|
||||
</div>
|
||||
<p>Count the number of occurrences of a string in a string.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.count = <span class="hljs-function"><span class="hljs-params">(string, substr)</span> -></span>
|
||||
num = pos = <span class="hljs-number">0</span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-number">1</span>/<span class="hljs-number">0</span> <span class="hljs-keyword">unless</span> substr.length
|
||||
num++ <span class="hljs-keyword">while</span> pos = <span class="hljs-number">1</span> + string.indexOf substr, pos
|
||||
num</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-9">¶</a>
|
||||
</div>
|
||||
<p>Merge objects, returning a fresh copy with attributes from both sides.
|
||||
Used every time <code>Base#compile</code> is called, to allow properties in the
|
||||
options hash to propagate down the tree without polluting other branches.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.merge = <span class="hljs-function"><span class="hljs-params">(options, overrides)</span> -></span>
|
||||
extend (extend {}, options), overrides</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-10">¶</a>
|
||||
</div>
|
||||
<p>Extend a source object with the properties of another object (shallow copy).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>extend = exports.extend = <span class="hljs-function"><span class="hljs-params">(object, properties)</span> -></span>
|
||||
<span class="hljs-keyword">for</span> key, val <span class="hljs-keyword">of</span> properties
|
||||
object[key] = val
|
||||
object</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-11">¶</a>
|
||||
</div>
|
||||
<p>Return a flattened version of an array.
|
||||
Handy for getting a list of <code>children</code> from the nodes.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.flatten = flatten = <span class="hljs-function"><span class="hljs-params">(array)</span> -></span>
|
||||
flattened = []
|
||||
<span class="hljs-keyword">for</span> element <span class="hljs-keyword">in</span> array
|
||||
<span class="hljs-keyword">if</span> <span class="hljs-string">'[object Array]'</span> <span class="hljs-keyword">is</span> Object::toString.call element
|
||||
flattened = flattened.concat flatten element
|
||||
<span class="hljs-keyword">else</span>
|
||||
flattened.push element
|
||||
flattened</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-12">¶</a>
|
||||
</div>
|
||||
<p>Delete a key from an object, returning the value. Useful when a node is
|
||||
looking for a particular method in an options hash.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.del = <span class="hljs-function"><span class="hljs-params">(obj, key)</span> -></span>
|
||||
val = obj[key]
|
||||
<span class="hljs-keyword">delete</span> obj[key]
|
||||
val</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-13">¶</a>
|
||||
</div>
|
||||
<p>Typical Array::some</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.some = Array::some ? (fn) ->
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-literal">true</span> <span class="hljs-keyword">for</span> e <span class="hljs-keyword">in</span> <span class="hljs-keyword">this</span> <span class="hljs-keyword">when</span> fn e
|
||||
<span class="hljs-literal">false</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-14">¶</a>
|
||||
</div>
|
||||
<p>Simple function for extracting code from Literate CoffeeScript by stripping
|
||||
out all non-code blocks, producing a string of CoffeeScript code that can
|
||||
be compiled “normally.”</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.invertLiterate = <span class="hljs-function"><span class="hljs-params">(code)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-15">¶</a>
|
||||
</div>
|
||||
<p>Create a placeholder for tabs, that isn’t used anywhere in <code>code</code>, and then
|
||||
re-insert the tabs after code extraction.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"> <span class="hljs-title">generateRandomToken</span> = -></span>
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{Math.random() * Date.now()}</span>"</span>
|
||||
<span class="hljs-keyword">while</span> token <span class="hljs-keyword">is</span> <span class="hljs-literal">undefined</span> <span class="hljs-keyword">or</span> code.indexOf(token) <span class="hljs-keyword">isnt</span> <span class="hljs-number">-1</span>
|
||||
token = generateRandomToken()
|
||||
|
||||
code = code.replace <span class="hljs-string">"\t"</span>, token</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-16">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-16">¶</a>
|
||||
</div>
|
||||
<p>Parse as markdown, discard everything except code blocks.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> out = <span class="hljs-string">""</span>
|
||||
<span class="hljs-keyword">for</span> item <span class="hljs-keyword">in</span> marked.lexer code, {}
|
||||
out += <span class="hljs-string">"<span class="hljs-subst">#{item.text}</span>\n"</span> <span class="hljs-keyword">if</span> item.type <span class="hljs-keyword">is</span> <span class="hljs-string">'code'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-17">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-17">¶</a>
|
||||
</div>
|
||||
<p>Put the tabs back in.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> out.replace token, <span class="hljs-string">"\t"</span>
|
||||
out</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-18">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-18">¶</a>
|
||||
</div>
|
||||
<p>Merge two jison-style location data objects together.
|
||||
If <code>last</code> is not provided, this will simply return <code>first</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">buildLocationData</span> = <span class="hljs-params">(first, last)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> last
|
||||
first
|
||||
<span class="hljs-keyword">else</span>
|
||||
first_line: first.first_line
|
||||
first_column: first.first_column
|
||||
last_line: last.last_line
|
||||
last_column: last.last_column</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-19">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-19">¶</a>
|
||||
</div>
|
||||
<p>This returns a function which takes an object as a parameter, and if that
|
||||
object is an AST node, updates that object’s locationData.
|
||||
The object is returned either way.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.addLocationDataFn = <span class="hljs-function"><span class="hljs-params">(first, last)</span> -></span>
|
||||
(obj) ->
|
||||
<span class="hljs-keyword">if</span> ((<span class="hljs-keyword">typeof</span> obj) <span class="hljs-keyword">is</span> <span class="hljs-string">'object'</span>) <span class="hljs-keyword">and</span> (!!obj[<span class="hljs-string">'updateLocationDataIfMissing'</span>])
|
||||
obj.updateLocationDataIfMissing buildLocationData(first, last)
|
||||
|
||||
<span class="hljs-keyword">return</span> obj</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-20">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-20">¶</a>
|
||||
</div>
|
||||
<p>Convert jison location data to a string.
|
||||
<code>obj</code> can be a token, or a locationData.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.locationDataToString = <span class="hljs-function"><span class="hljs-params">(obj)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> (<span class="hljs-string">"2"</span> <span class="hljs-keyword">of</span> obj) <span class="hljs-keyword">and</span> (<span class="hljs-string">"first_line"</span> <span class="hljs-keyword">of</span> obj[<span class="hljs-number">2</span>]) <span class="hljs-keyword">then</span> locationData = obj[<span class="hljs-number">2</span>]
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> <span class="hljs-string">"first_line"</span> <span class="hljs-keyword">of</span> obj <span class="hljs-keyword">then</span> locationData = obj
|
||||
|
||||
<span class="hljs-keyword">if</span> locationData
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{locationData.first_line + <span class="hljs-number">1</span>}</span>:<span class="hljs-subst">#{locationData.first_column + <span class="hljs-number">1</span>}</span>-"</span> +
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{locationData.last_line + <span class="hljs-number">1</span>}</span>:<span class="hljs-subst">#{locationData.last_column + <span class="hljs-number">1</span>}</span>"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-string">"No location data"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-21">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-21">¶</a>
|
||||
</div>
|
||||
<p>A <code>.coffee.md</code> compatible version of <code>basename</code>, that returns the file sans-extension.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.baseFileName = <span class="hljs-function"><span class="hljs-params">(file, stripExt = <span class="hljs-literal">no</span>, useWinPathSep = <span class="hljs-literal">no</span>)</span> -></span>
|
||||
pathSep = <span class="hljs-keyword">if</span> useWinPathSep <span class="hljs-keyword">then</span> <span class="hljs-regexp">/\\|\//</span> <span class="hljs-keyword">else</span> <span class="hljs-regexp">/\//</span>
|
||||
parts = file.split(pathSep)
|
||||
file = parts[parts.length - <span class="hljs-number">1</span>]
|
||||
<span class="hljs-keyword">return</span> file <span class="hljs-keyword">unless</span> stripExt <span class="hljs-keyword">and</span> file.indexOf(<span class="hljs-string">'.'</span>) >= <span class="hljs-number">0</span>
|
||||
parts = file.split(<span class="hljs-string">'.'</span>)
|
||||
parts.pop()
|
||||
parts.pop() <span class="hljs-keyword">if</span> parts[parts.length - <span class="hljs-number">1</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'coffee'</span> <span class="hljs-keyword">and</span> parts.length > <span class="hljs-number">1</span>
|
||||
parts.join(<span class="hljs-string">'.'</span>)</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-22">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-22">¶</a>
|
||||
</div>
|
||||
<p>Determine if a filename represents a CoffeeScript file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.isCoffee = <span class="hljs-function"><span class="hljs-params">(file)</span> -></span> <span class="hljs-regexp">/\.((lit)?coffee|coffee\.md)$/</span>.test file</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-23">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-23">¶</a>
|
||||
</div>
|
||||
<p>Determine if a filename represents a Literate CoffeeScript file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.isLiterate = <span class="hljs-function"><span class="hljs-params">(file)</span> -></span> <span class="hljs-regexp">/\.(litcoffee|coffee\.md)$/</span>.test file</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-24">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-24">¶</a>
|
||||
</div>
|
||||
<p>Throws a SyntaxError from a given location.
|
||||
The error’s <code>toString</code> will return an error message following the “standard”
|
||||
format <code><filename>:<line>:<col>: <message></code> plus the line with the error and a
|
||||
marker showing where the error is.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.throwSyntaxError = <span class="hljs-function"><span class="hljs-params">(message, location)</span> -></span>
|
||||
error = <span class="hljs-keyword">new</span> SyntaxError message
|
||||
error.location = location
|
||||
error.toString = syntaxErrorToString</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-25">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-25">¶</a>
|
||||
</div>
|
||||
<p>Instead of showing the compiler’s stacktrace, show our custom error message
|
||||
(this is useful when the error bubbles up in Node.js applications that
|
||||
compile CoffeeScript for example).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> error.stack = error.toString()
|
||||
|
||||
<span class="hljs-keyword">throw</span> error</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-26">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-26">¶</a>
|
||||
</div>
|
||||
<p>Update a compiler SyntaxError with source code information if it didn’t have
|
||||
it already.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.updateSyntaxError = <span class="hljs-function"><span class="hljs-params">(error, code, filename)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-27">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-27">¶</a>
|
||||
</div>
|
||||
<p>Avoid screwing up the <code>stack</code> property of other errors (i.e. possible bugs).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> error.toString <span class="hljs-keyword">is</span> syntaxErrorToString
|
||||
error.code <span class="hljs-keyword">or</span>= code
|
||||
error.filename <span class="hljs-keyword">or</span>= filename
|
||||
error.stack = error.toString()
|
||||
error
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">syntaxErrorToString</span> = -></span>
|
||||
<span class="hljs-keyword">return</span> Error::toString.call @ <span class="hljs-keyword">unless</span> @code <span class="hljs-keyword">and</span> @location
|
||||
|
||||
{first_line, first_column, last_line, last_column} = @location
|
||||
last_line ?= first_line
|
||||
last_column ?= first_column
|
||||
|
||||
filename = @filename <span class="hljs-keyword">or</span> <span class="hljs-string">'[stdin]'</span>
|
||||
codeLine = @code.split(<span class="hljs-string">'\n'</span>)[first_line]
|
||||
start = first_column</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-28">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-28">¶</a>
|
||||
</div>
|
||||
<p>Show only the first line on multi-line errors.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> end = <span class="hljs-keyword">if</span> first_line <span class="hljs-keyword">is</span> last_line <span class="hljs-keyword">then</span> last_column + <span class="hljs-number">1</span> <span class="hljs-keyword">else</span> codeLine.length
|
||||
marker = codeLine[...start].replace(<span class="hljs-regexp">/[^\s]/g</span>, <span class="hljs-string">' '</span>) + repeat(<span class="hljs-string">'^'</span>, end - start)</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-29">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-29">¶</a>
|
||||
</div>
|
||||
<p>Check to see if we’re running on a color-enabled TTY.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> process?
|
||||
colorsEnabled = process.stdout?.isTTY <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> process.env?.NODE_DISABLE_COLORS
|
||||
|
||||
<span class="hljs-keyword">if</span> @colorful ? colorsEnabled
|
||||
<span class="hljs-function"> <span class="hljs-title">colorize</span> = <span class="hljs-params">(str)</span> -></span> <span class="hljs-string">"\x1B[1;31m<span class="hljs-subst">#{str}</span>\x1B[0m"</span>
|
||||
codeLine = codeLine[...start] + colorize(codeLine[start...end]) + codeLine[end..]
|
||||
marker = colorize marker
|
||||
|
||||
<span class="hljs-string">"""
|
||||
<span class="hljs-subst">#{filename}</span>:<span class="hljs-subst">#{first_line + <span class="hljs-number">1</span>}</span>:<span class="hljs-subst">#{first_column + <span class="hljs-number">1</span>}</span>: error: <span class="hljs-subst">#{@message}</span>
|
||||
<span class="hljs-subst">#{codeLine}</span>
|
||||
<span class="hljs-subst">#{marker}</span>
|
||||
"""</span>
|
||||
|
||||
exports.nameWhitespaceCharacter = <span class="hljs-function"><span class="hljs-params">(string)</span> -></span>
|
||||
<span class="hljs-keyword">switch</span> string
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-string">' '</span> <span class="hljs-keyword">then</span> <span class="hljs-string">'space'</span>
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-string">'\n'</span> <span class="hljs-keyword">then</span> <span class="hljs-string">'newline'</span>
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-string">'\r'</span> <span class="hljs-keyword">then</span> <span class="hljs-string">'carriage return'</span>
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-string">'\t'</span> <span class="hljs-keyword">then</span> <span class="hljs-string">'tab'</span>
|
||||
<span class="hljs-keyword">else</span> string</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
129
docs/v2/annotated-source/index.html
Normal file
129
docs/v2/annotated-source/index.html
Normal file
@@ -0,0 +1,129 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>index.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>index.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
<p>Loader for CoffeeScript as a Node.js library.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports[key] = val <span class="hljs-keyword">for</span> key, val <span class="hljs-keyword">of</span> <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
2255
docs/v2/annotated-source/lexer.html
Normal file
2255
docs/v2/annotated-source/lexer.html
Normal file
File diff suppressed because it is too large
Load Diff
5958
docs/v2/annotated-source/nodes.html
Normal file
5958
docs/v2/annotated-source/nodes.html
Normal file
File diff suppressed because it is too large
Load Diff
366
docs/v2/annotated-source/optparse.html
Normal file
366
docs/v2/annotated-source/optparse.html
Normal file
@@ -0,0 +1,366 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>optparse.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>optparse.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>{repeat} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-2">¶</a>
|
||||
</div>
|
||||
<p>A simple <strong>OptionParser</strong> class to parse option flags from the command-line.
|
||||
Use it like so:</p>
|
||||
<pre><code>parser = <span class="hljs-keyword">new</span> OptionParser switches, helpBanner
|
||||
options = parser.parse process.argv
|
||||
</code></pre><p>The first non-option is considered to be the start of the file (and file
|
||||
option) list, and all subsequent arguments are left unparsed.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.OptionParser = <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">OptionParser</span></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-3">¶</a>
|
||||
</div>
|
||||
<p>Initialize with a list of valid options, in the form:</p>
|
||||
<pre><code>[short-flag, long-flag, description]
|
||||
</code></pre><p>Along with an optional banner for the usage help.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> constructor: <span class="hljs-function"><span class="hljs-params">(rules, @banner)</span> -></span>
|
||||
@rules = buildRules rules</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-4">¶</a>
|
||||
</div>
|
||||
<p>Parse the list of arguments, populating an <code>options</code> object with all of the
|
||||
specified options, and return it. Options after the first non-option
|
||||
argument are treated as arguments. <code>options.arguments</code> will be an array
|
||||
containing the remaining arguments. This is a simpler API than many option
|
||||
parsers that allow you to attach callback actions for every flag. Instead,
|
||||
you’re responsible for interpreting the options object.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> parse: <span class="hljs-function"><span class="hljs-params">(args)</span> -></span>
|
||||
options = arguments: []
|
||||
skippingArgument = <span class="hljs-literal">no</span>
|
||||
originalArgs = args
|
||||
args = normalizeArguments args
|
||||
<span class="hljs-keyword">for</span> arg, i <span class="hljs-keyword">in</span> args
|
||||
<span class="hljs-keyword">if</span> skippingArgument
|
||||
skippingArgument = <span class="hljs-literal">no</span>
|
||||
<span class="hljs-keyword">continue</span>
|
||||
<span class="hljs-keyword">if</span> arg <span class="hljs-keyword">is</span> <span class="hljs-string">'--'</span>
|
||||
pos = originalArgs.indexOf <span class="hljs-string">'--'</span>
|
||||
options.arguments = options.arguments.concat originalArgs[(pos + <span class="hljs-number">1</span>)..]
|
||||
<span class="hljs-keyword">break</span>
|
||||
isOption = !!(arg.match(LONG_FLAG) <span class="hljs-keyword">or</span> arg.match(SHORT_FLAG))</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-5">¶</a>
|
||||
</div>
|
||||
<p>the CS option parser is a little odd; options after the first
|
||||
non-option argument are treated as non-option arguments themselves</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> seenNonOptionArg = options.arguments.length > <span class="hljs-number">0</span>
|
||||
<span class="hljs-keyword">unless</span> seenNonOptionArg
|
||||
matchedRule = <span class="hljs-literal">no</span>
|
||||
<span class="hljs-keyword">for</span> rule <span class="hljs-keyword">in</span> @rules
|
||||
<span class="hljs-keyword">if</span> rule.shortFlag <span class="hljs-keyword">is</span> arg <span class="hljs-keyword">or</span> rule.longFlag <span class="hljs-keyword">is</span> arg
|
||||
value = <span class="hljs-literal">true</span>
|
||||
<span class="hljs-keyword">if</span> rule.hasArgument
|
||||
skippingArgument = <span class="hljs-literal">yes</span>
|
||||
value = args[i + <span class="hljs-number">1</span>]
|
||||
options[rule.name] = <span class="hljs-keyword">if</span> rule.isList <span class="hljs-keyword">then</span> (options[rule.name] <span class="hljs-keyword">or</span> []).concat value <span class="hljs-keyword">else</span> value
|
||||
matchedRule = <span class="hljs-literal">yes</span>
|
||||
<span class="hljs-keyword">break</span>
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error <span class="hljs-string">"unrecognized option: <span class="hljs-subst">#{arg}</span>"</span> <span class="hljs-keyword">if</span> isOption <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> matchedRule
|
||||
<span class="hljs-keyword">if</span> seenNonOptionArg <span class="hljs-keyword">or</span> <span class="hljs-keyword">not</span> isOption
|
||||
options.arguments.push arg
|
||||
options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-6">¶</a>
|
||||
</div>
|
||||
<p>Return the help text for this <strong>OptionParser</strong>, listing and describing all
|
||||
of the valid options, for <code>--help</code> and such.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> help: <span class="hljs-function">-></span>
|
||||
lines = []
|
||||
lines.unshift <span class="hljs-string">"<span class="hljs-subst">#{@banner}</span>\n"</span> <span class="hljs-keyword">if</span> @banner
|
||||
<span class="hljs-keyword">for</span> rule <span class="hljs-keyword">in</span> @rules
|
||||
spaces = <span class="hljs-number">15</span> - rule.longFlag.length
|
||||
spaces = <span class="hljs-keyword">if</span> spaces > <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> repeat <span class="hljs-string">' '</span>, spaces <span class="hljs-keyword">else</span> <span class="hljs-string">''</span>
|
||||
letPart = <span class="hljs-keyword">if</span> rule.shortFlag <span class="hljs-keyword">then</span> rule.shortFlag + <span class="hljs-string">', '</span> <span class="hljs-keyword">else</span> <span class="hljs-string">' '</span>
|
||||
lines.push <span class="hljs-string">' '</span> + letPart + rule.longFlag + spaces + rule.description
|
||||
<span class="hljs-string">"\n<span class="hljs-subst">#{ lines.join(<span class="hljs-string">'\n'</span>) }</span>\n"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-7">¶</a>
|
||||
</div>
|
||||
<h2 id="helpers">Helpers</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-8">¶</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-9">¶</a>
|
||||
</div>
|
||||
<p>Regex matchers for option flags.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>LONG_FLAG = <span class="hljs-regexp">/^(--\w[\w\-]*)/</span>
|
||||
SHORT_FLAG = <span class="hljs-regexp">/^(-\w)$/</span>
|
||||
MULTI_FLAG = <span class="hljs-regexp">/^-(\w{2,})/</span>
|
||||
OPTIONAL = <span class="hljs-regexp">/\[(\w+(\*?))\]/</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-10">¶</a>
|
||||
</div>
|
||||
<p>Build and return the list of option rules. If the optional <em>short-flag</em> is
|
||||
unspecified, leave it out by padding with <code>null</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">buildRules</span> = <span class="hljs-params">(rules)</span> -></span>
|
||||
<span class="hljs-keyword">for</span> tuple <span class="hljs-keyword">in</span> rules
|
||||
tuple.unshift <span class="hljs-literal">null</span> <span class="hljs-keyword">if</span> tuple.length < <span class="hljs-number">3</span>
|
||||
buildRule tuple...</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-11">¶</a>
|
||||
</div>
|
||||
<p>Build a rule from a <code>-o</code> short flag, a <code>--output [DIR]</code> long flag, and the
|
||||
description of what the option does.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">buildRule</span> = <span class="hljs-params">(shortFlag, longFlag, description, options = {})</span> -></span>
|
||||
match = longFlag.match(OPTIONAL)
|
||||
longFlag = longFlag.match(LONG_FLAG)[<span class="hljs-number">1</span>]
|
||||
{
|
||||
name: longFlag.substr <span class="hljs-number">2</span>
|
||||
shortFlag: shortFlag
|
||||
longFlag: longFlag
|
||||
description: description
|
||||
hasArgument: !!(match <span class="hljs-keyword">and</span> match[<span class="hljs-number">1</span>])
|
||||
isList: !!(match <span class="hljs-keyword">and</span> match[<span class="hljs-number">2</span>])
|
||||
}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-12">¶</a>
|
||||
</div>
|
||||
<p>Normalize arguments by expanding merged flags into multiple flags. This allows
|
||||
you to have <code>-wl</code> be the same as <code>--watch --lint</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">normalizeArguments</span> = <span class="hljs-params">(args)</span> -></span>
|
||||
args = args[..]
|
||||
result = []
|
||||
<span class="hljs-keyword">for</span> arg <span class="hljs-keyword">in</span> args
|
||||
<span class="hljs-keyword">if</span> match = arg.match MULTI_FLAG
|
||||
result.push <span class="hljs-string">'-'</span> + l <span class="hljs-keyword">for</span> l <span class="hljs-keyword">in</span> match[<span class="hljs-number">1</span>].split <span class="hljs-string">''</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
result.push arg
|
||||
result</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
docs/v2/annotated-source/public/fonts/aller-bold.eot
Normal file
BIN
docs/v2/annotated-source/public/fonts/aller-bold.eot
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/aller-bold.ttf
Normal file
BIN
docs/v2/annotated-source/public/fonts/aller-bold.ttf
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/aller-bold.woff
Normal file
BIN
docs/v2/annotated-source/public/fonts/aller-bold.woff
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/aller-light.eot
Normal file
BIN
docs/v2/annotated-source/public/fonts/aller-light.eot
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/aller-light.ttf
Normal file
BIN
docs/v2/annotated-source/public/fonts/aller-light.ttf
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/aller-light.woff
Normal file
BIN
docs/v2/annotated-source/public/fonts/aller-light.woff
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/roboto-black.eot
Executable file
BIN
docs/v2/annotated-source/public/fonts/roboto-black.eot
Executable file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/roboto-black.ttf
Executable file
BIN
docs/v2/annotated-source/public/fonts/roboto-black.ttf
Executable file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/roboto-black.woff
Executable file
BIN
docs/v2/annotated-source/public/fonts/roboto-black.woff
Executable file
Binary file not shown.
375
docs/v2/annotated-source/public/stylesheets/normalize.css
vendored
Normal file
375
docs/v2/annotated-source/public/stylesheets/normalize.css
vendored
Normal file
@@ -0,0 +1,375 @@
|
||||
/*! normalize.css v2.0.1 | MIT License | git.io/normalize */
|
||||
|
||||
/* ==========================================================================
|
||||
HTML5 display definitions
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Corrects `block` display not defined in IE 8/9.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Corrects `inline-block` display not defined in IE 8/9.
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
video {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevents modern browsers from displaying `audio` without controls.
|
||||
* Remove excess height in iOS 5 devices.
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses styling for `hidden` attribute not present in IE 8/9.
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Base
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* 1. Sets default font family to sans-serif.
|
||||
* 2. Prevents iOS text size adjust after orientation change, without disabling
|
||||
* user zoom.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: sans-serif; /* 1 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes default margin.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Links
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Addresses `outline` inconsistency between Chrome and other browsers.
|
||||
*/
|
||||
|
||||
a:focus {
|
||||
outline: thin dotted;
|
||||
}
|
||||
|
||||
/*
|
||||
* Improves readability when focused and also mouse hovered in all browsers.
|
||||
*/
|
||||
|
||||
a:active,
|
||||
a:hover {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Typography
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Addresses `h1` font sizes within `section` and `article` in Firefox 4+,
|
||||
* Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses styling not present in IE 8/9, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: 1px dotted;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses styling not present in Safari 5 and Chrome.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses styling not present in IE 8/9.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Corrects font family set oddly in Safari 5 and Chrome.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/*
|
||||
* Improves readability of pre-formatted text in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
white-space: pre;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets consistent quote types.
|
||||
*/
|
||||
|
||||
q {
|
||||
quotes: "\201C" "\201D" "\2018" "\2019";
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses inconsistent and variable font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevents `sub` and `sup` affecting `line-height` in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Removes border when inside `a` element in IE 8/9.
|
||||
*/
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Corrects overflow displayed oddly in IE 9.
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Figures
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Addresses margin not present in IE 8/9 and Safari 5.
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Forms
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Define consistent border, margin, and padding.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Corrects color not being inherited in IE 8/9.
|
||||
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
||||
*/
|
||||
|
||||
legend {
|
||||
border: 0; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Corrects font family not being inherited in all browsers.
|
||||
* 2. Corrects font size not being inherited in all browsers.
|
||||
* 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit; /* 1 */
|
||||
font-size: 100%; /* 2 */
|
||||
margin: 0; /* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses Firefox 4+ setting `line-height` on `input` using `!important` in
|
||||
* the UA stylesheet.
|
||||
*/
|
||||
|
||||
button,
|
||||
input {
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
||||
* and `video` controls.
|
||||
* 2. Corrects inability to style clickable `input` types in iOS.
|
||||
* 3. Improves usability and consistency of cursor style between image-type
|
||||
* `input` and others.
|
||||
*/
|
||||
|
||||
button,
|
||||
html input[type="button"], /* 1 */
|
||||
input[type="reset"],
|
||||
input[type="submit"] {
|
||||
-webkit-appearance: button; /* 2 */
|
||||
cursor: pointer; /* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Re-set default cursor for disabled elements.
|
||||
*/
|
||||
|
||||
button[disabled],
|
||||
input[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Addresses box sizing set to `content-box` in IE 8/9.
|
||||
* 2. Removes excess padding in IE 8/9.
|
||||
*/
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
|
||||
* 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
|
||||
* (include `-moz` to future-proof).
|
||||
*/
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box; /* 2 */
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes inner padding and search cancel button in Safari 5 and Chrome
|
||||
* on OS X.
|
||||
*/
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes inner padding and border in Firefox 4+.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Removes default vertical scrollbar in IE 8/9.
|
||||
* 2. Improves readability and alignment in all browsers.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto; /* 1 */
|
||||
vertical-align: top; /* 2 */
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Tables
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Remove most spacing between table cells.
|
||||
*/
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
251
docs/v2/annotated-source/register.html
Normal file
251
docs/v2/annotated-source/register.html
Normal file
@@ -0,0 +1,251 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>register.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>register.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span>
|
||||
child_process = <span class="hljs-built_in">require</span> <span class="hljs-string">'child_process'</span>
|
||||
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
|
||||
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-2">¶</a>
|
||||
</div>
|
||||
<p>Load and run a CoffeeScript file for Node, stripping any <code>BOM</code>s.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">loadFile</span> = <span class="hljs-params">(<span class="hljs-built_in">module</span>, filename)</span> -></span>
|
||||
answer = CoffeeScript._compileFile filename, <span class="hljs-literal">no</span>, <span class="hljs-literal">yes</span>
|
||||
<span class="hljs-built_in">module</span>._compile answer, filename</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-3">¶</a>
|
||||
</div>
|
||||
<p>If the installed version of Node supports <code>require.extensions</code>, register
|
||||
CoffeeScript as an extension.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> <span class="hljs-built_in">require</span>.extensions
|
||||
<span class="hljs-keyword">for</span> ext <span class="hljs-keyword">in</span> CoffeeScript.FILE_EXTENSIONS
|
||||
<span class="hljs-built_in">require</span>.extensions[ext] = loadFile</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-4">¶</a>
|
||||
</div>
|
||||
<p>Patch Node’s module loader to be able to handle multi-dot extensions.
|
||||
This is a horrible thing that should not be required.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> Module = <span class="hljs-built_in">require</span> <span class="hljs-string">'module'</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">findExtension</span> = <span class="hljs-params">(filename)</span> -></span>
|
||||
extensions = path.basename(filename).split <span class="hljs-string">'.'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-5">¶</a>
|
||||
</div>
|
||||
<p>Remove the initial dot from dotfiles.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> extensions.shift() <span class="hljs-keyword">if</span> extensions[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">''</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-6">¶</a>
|
||||
</div>
|
||||
<p>Start with the longest possible extension and work our way shortwards.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">while</span> extensions.shift()
|
||||
curExtension = <span class="hljs-string">'.'</span> + extensions.join <span class="hljs-string">'.'</span>
|
||||
<span class="hljs-keyword">return</span> curExtension <span class="hljs-keyword">if</span> Module._extensions[curExtension]
|
||||
<span class="hljs-string">'.js'</span>
|
||||
|
||||
Module::load = <span class="hljs-function"><span class="hljs-params">(filename)</span> -></span>
|
||||
@filename = filename
|
||||
@paths = Module._nodeModulePaths path.dirname filename
|
||||
extension = findExtension filename
|
||||
Module._extensions[extension](<span class="hljs-keyword">this</span>, filename)
|
||||
@loaded = <span class="hljs-literal">true</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-7">¶</a>
|
||||
</div>
|
||||
<p>If we’re on Node, patch <code>child_process.fork</code> so that Coffee scripts are able
|
||||
to fork both CoffeeScript files, and JavaScript files, directly.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> child_process
|
||||
{fork} = child_process
|
||||
binary = <span class="hljs-built_in">require</span>.resolve <span class="hljs-string">'../../bin/coffee'</span>
|
||||
child_process.fork = <span class="hljs-function"><span class="hljs-params">(path, args, options)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> helpers.isCoffee path
|
||||
<span class="hljs-keyword">unless</span> Array.isArray args
|
||||
options = args <span class="hljs-keyword">or</span> {}
|
||||
args = []
|
||||
args = [path].concat args
|
||||
path = binary
|
||||
fork path, args, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
624
docs/v2/annotated-source/repl.html
Normal file
624
docs/v2/annotated-source/repl.html
Normal file
@@ -0,0 +1,624 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>repl.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>repl.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>fs = <span class="hljs-built_in">require</span> <span class="hljs-string">'fs'</span>
|
||||
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
|
||||
vm = <span class="hljs-built_in">require</span> <span class="hljs-string">'vm'</span>
|
||||
nodeREPL = <span class="hljs-built_in">require</span> <span class="hljs-string">'repl'</span>
|
||||
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span>
|
||||
{merge, updateSyntaxError} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
|
||||
|
||||
replDefaults =
|
||||
prompt: <span class="hljs-string">'coffee> '</span>,
|
||||
historyFile: path.join process.env.HOME, <span class="hljs-string">'.coffee_history'</span> <span class="hljs-keyword">if</span> process.env.HOME
|
||||
historyMaxInputSize: <span class="hljs-number">10240</span>
|
||||
eval: <span class="hljs-function"><span class="hljs-params">(input, context, filename, cb)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-2">¶</a>
|
||||
</div>
|
||||
<p>XXX: multiline hack.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> input = input.replace <span class="hljs-regexp">/\uFF00/g</span>, <span class="hljs-string">'\n'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-3">¶</a>
|
||||
</div>
|
||||
<p>Node’s REPL sends the input ending with a newline and then wrapped in
|
||||
parens. Unwrap all that.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> input = input.replace <span class="hljs-regexp">/^\(([\s\S]*)\n\)$/m</span>, <span class="hljs-string">'$1'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-4">¶</a>
|
||||
</div>
|
||||
<p>Node’s REPL v6.9.1+ sends the input wrapped in a try/catch statement.
|
||||
Unwrap that too.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> input = input.replace <span class="hljs-regexp">/^\s*try\s*{([\s\S]*)}\s*catch.*$/m</span>, <span class="hljs-string">'$1'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-5">¶</a>
|
||||
</div>
|
||||
<p>Require AST nodes to do some AST manipulation.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> {Block, Assign, Value, Literal} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./nodes'</span>
|
||||
|
||||
<span class="hljs-keyword">try</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-6">¶</a>
|
||||
</div>
|
||||
<p>Tokenize the clean input.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> tokens = CoffeeScript.tokens input</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-7">¶</a>
|
||||
</div>
|
||||
<p>Collect referenced variable names just like in <code>CoffeeScript.compile</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> referencedVars = (
|
||||
token[<span class="hljs-number">1</span>] <span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> tokens <span class="hljs-keyword">when</span> token[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'IDENTIFIER'</span>
|
||||
)</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-8">¶</a>
|
||||
</div>
|
||||
<p>Generate the AST of the tokens.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> ast = CoffeeScript.nodes tokens</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-9">¶</a>
|
||||
</div>
|
||||
<p>Add assignment to <code>_</code> variable to force the input to be an expression.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> ast = <span class="hljs-keyword">new</span> Block [
|
||||
<span class="hljs-keyword">new</span> Assign (<span class="hljs-keyword">new</span> Value <span class="hljs-keyword">new</span> Literal <span class="hljs-string">'_'</span>), ast, <span class="hljs-string">'='</span>
|
||||
]
|
||||
js = ast.compile {bare: <span class="hljs-literal">yes</span>, locals: Object.keys(context), referencedVars}
|
||||
cb <span class="hljs-literal">null</span>, runInContext js, context, filename
|
||||
<span class="hljs-keyword">catch</span> err</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-10">¶</a>
|
||||
</div>
|
||||
<p>AST’s <code>compile</code> does not add source code information to syntax errors.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> updateSyntaxError err, input
|
||||
cb err
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">runInContext</span> = <span class="hljs-params">(js, context, filename)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> context <span class="hljs-keyword">is</span> <span class="hljs-built_in">global</span>
|
||||
vm.runInThisContext js, filename
|
||||
<span class="hljs-keyword">else</span>
|
||||
vm.runInContext js, context, filename
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">addMultilineHandler</span> = <span class="hljs-params">(repl)</span> -></span>
|
||||
{rli, inputStream, outputStream} = repl</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-11">¶</a>
|
||||
</div>
|
||||
<p>Node 0.11.12 changed API, prompt is now _prompt.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> origPrompt = repl._prompt ? repl.prompt
|
||||
|
||||
multiline =
|
||||
enabled: <span class="hljs-literal">off</span>
|
||||
initialPrompt: origPrompt.replace <span class="hljs-regexp">/^[^> ]*/</span>, <span class="hljs-function"><span class="hljs-params">(x)</span> -></span> x.replace <span class="hljs-regexp">/./g</span>, <span class="hljs-string">'-'</span>
|
||||
prompt: origPrompt.replace <span class="hljs-regexp">/^[^> ]*>?/</span>, <span class="hljs-function"><span class="hljs-params">(x)</span> -></span> x.replace <span class="hljs-regexp">/./g</span>, <span class="hljs-string">'.'</span>
|
||||
buffer: <span class="hljs-string">''</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-12">¶</a>
|
||||
</div>
|
||||
<p>Proxy node’s line listener</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> nodeLineListener = rli.listeners(<span class="hljs-string">'line'</span>)[<span class="hljs-number">0</span>]
|
||||
rli.removeListener <span class="hljs-string">'line'</span>, nodeLineListener
|
||||
rli.<span class="hljs-literal">on</span> <span class="hljs-string">'line'</span>, <span class="hljs-function"><span class="hljs-params">(cmd)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> multiline.enabled
|
||||
multiline.buffer += <span class="hljs-string">"<span class="hljs-subst">#{cmd}</span>\n"</span>
|
||||
rli.setPrompt multiline.prompt
|
||||
rli.prompt <span class="hljs-literal">true</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
rli.setPrompt origPrompt
|
||||
nodeLineListener cmd
|
||||
<span class="hljs-keyword">return</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-13">¶</a>
|
||||
</div>
|
||||
<p>Handle Ctrl-v</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> inputStream.<span class="hljs-literal">on</span> <span class="hljs-string">'keypress'</span>, <span class="hljs-function"><span class="hljs-params">(char, key)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> key <span class="hljs-keyword">and</span> key.ctrl <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> key.meta <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> key.shift <span class="hljs-keyword">and</span> key.name <span class="hljs-keyword">is</span> <span class="hljs-string">'v'</span>
|
||||
<span class="hljs-keyword">if</span> multiline.enabled</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-14">¶</a>
|
||||
</div>
|
||||
<p>allow arbitrarily switching between modes any time before multiple lines are entered</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">unless</span> multiline.buffer.match <span class="hljs-regexp">/\n/</span>
|
||||
multiline.enabled = <span class="hljs-keyword">not</span> multiline.enabled
|
||||
rli.setPrompt origPrompt
|
||||
rli.prompt <span class="hljs-literal">true</span>
|
||||
<span class="hljs-keyword">return</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-15">¶</a>
|
||||
</div>
|
||||
<p>no-op unless the current line is empty</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> rli.line? <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> rli.line.match <span class="hljs-regexp">/^\s*$/</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-16">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-16">¶</a>
|
||||
</div>
|
||||
<p>eval, print, loop</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> multiline.enabled = <span class="hljs-keyword">not</span> multiline.enabled
|
||||
rli.line = <span class="hljs-string">''</span>
|
||||
rli.cursor = <span class="hljs-number">0</span>
|
||||
rli.output.cursorTo <span class="hljs-number">0</span>
|
||||
rli.output.clearLine <span class="hljs-number">1</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-17">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-17">¶</a>
|
||||
</div>
|
||||
<p>XXX: multiline hack</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> multiline.buffer = multiline.buffer.replace <span class="hljs-regexp">/\n/g</span>, <span class="hljs-string">'\uFF00'</span>
|
||||
rli.emit <span class="hljs-string">'line'</span>, multiline.buffer
|
||||
multiline.buffer = <span class="hljs-string">''</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
multiline.enabled = <span class="hljs-keyword">not</span> multiline.enabled
|
||||
rli.setPrompt multiline.initialPrompt
|
||||
rli.prompt <span class="hljs-literal">true</span>
|
||||
<span class="hljs-keyword">return</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-18">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-18">¶</a>
|
||||
</div>
|
||||
<p>Store and load command history from a file</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">addHistory</span> = <span class="hljs-params">(repl, filename, maxSize)</span> -></span>
|
||||
lastLine = <span class="hljs-literal">null</span>
|
||||
<span class="hljs-keyword">try</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-19">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-19">¶</a>
|
||||
</div>
|
||||
<p>Get file info and at most maxSize of command history</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> stat = fs.statSync filename
|
||||
size = Math.min maxSize, stat.size</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-20">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-20">¶</a>
|
||||
</div>
|
||||
<p>Read last <code>size</code> bytes from the file</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> readFd = fs.openSync filename, <span class="hljs-string">'r'</span>
|
||||
buffer = Buffer.alloc size
|
||||
fs.readSync readFd, buffer, <span class="hljs-number">0</span>, size, stat.size - size
|
||||
fs.closeSync readFd</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-21">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-21">¶</a>
|
||||
</div>
|
||||
<p>Set the history on the interpreter</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> repl.rli.history = buffer.toString().split(<span class="hljs-string">'\n'</span>).reverse()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-22">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-22">¶</a>
|
||||
</div>
|
||||
<p>If the history file was truncated we should pop off a potential partial line</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> repl.rli.history.pop() <span class="hljs-keyword">if</span> stat.size > maxSize</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-23">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-23">¶</a>
|
||||
</div>
|
||||
<p>Shift off the final blank newline</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> repl.rli.history.shift() <span class="hljs-keyword">if</span> repl.rli.history[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">''</span>
|
||||
repl.rli.historyIndex = <span class="hljs-number">-1</span>
|
||||
lastLine = repl.rli.history[<span class="hljs-number">0</span>]
|
||||
|
||||
fd = fs.openSync filename, <span class="hljs-string">'a'</span>
|
||||
|
||||
repl.rli.addListener <span class="hljs-string">'line'</span>, <span class="hljs-function"><span class="hljs-params">(code)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> code <span class="hljs-keyword">and</span> code.length <span class="hljs-keyword">and</span> code <span class="hljs-keyword">isnt</span> <span class="hljs-string">'.history'</span> <span class="hljs-keyword">and</span> code <span class="hljs-keyword">isnt</span> <span class="hljs-string">'.exit'</span> <span class="hljs-keyword">and</span> lastLine <span class="hljs-keyword">isnt</span> code</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-24">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-24">¶</a>
|
||||
</div>
|
||||
<p>Save the latest command in the file</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> fs.writeSync fd, <span class="hljs-string">"<span class="hljs-subst">#{code}</span>\n"</span>
|
||||
lastLine = code
|
||||
|
||||
repl.<span class="hljs-literal">on</span> <span class="hljs-string">'exit'</span>, <span class="hljs-function">-></span> fs.closeSync fd</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-25">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-25">¶</a>
|
||||
</div>
|
||||
<p>Add a command to show the history stack</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> repl.commands[getCommandId(repl, <span class="hljs-string">'history'</span>)] =
|
||||
help: <span class="hljs-string">'Show command history'</span>
|
||||
action: <span class="hljs-function">-></span>
|
||||
repl.outputStream.write <span class="hljs-string">"<span class="hljs-subst">#{repl.rli.history[..].reverse().join <span class="hljs-string">'\n'</span>}</span>\n"</span>
|
||||
repl.displayPrompt()
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">getCommandId</span> = <span class="hljs-params">(repl, commandName)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-26">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-26">¶</a>
|
||||
</div>
|
||||
<p>Node 0.11 changed API, a command such as ‘.help’ is now stored as ‘help’</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> commandsHaveLeadingDot = repl.commands[<span class="hljs-string">'.help'</span>]?
|
||||
<span class="hljs-keyword">if</span> commandsHaveLeadingDot <span class="hljs-keyword">then</span> <span class="hljs-string">".<span class="hljs-subst">#{commandName}</span>"</span> <span class="hljs-keyword">else</span> commandName
|
||||
|
||||
<span class="hljs-built_in">module</span>.exports =
|
||||
start: <span class="hljs-function"><span class="hljs-params">(opts = {})</span> -></span>
|
||||
[major, minor, build] = process.versions.node.split(<span class="hljs-string">'.'</span>).map (n) -> parseInt(n)
|
||||
|
||||
<span class="hljs-keyword">if</span> major < <span class="hljs-number">6</span>
|
||||
<span class="hljs-built_in">console</span>.warn <span class="hljs-string">"Node 6+ required for CoffeeScript REPL"</span>
|
||||
process.exit <span class="hljs-number">1</span>
|
||||
|
||||
CoffeeScript.register()
|
||||
process.argv = [<span class="hljs-string">'coffee'</span>].concat process.argv[<span class="hljs-number">2.</span>.]
|
||||
opts = merge replDefaults, opts
|
||||
repl = nodeREPL.start opts
|
||||
runInContext opts.prelude, repl.context, <span class="hljs-string">'prelude'</span> <span class="hljs-keyword">if</span> opts.prelude
|
||||
repl.<span class="hljs-literal">on</span> <span class="hljs-string">'exit'</span>, <span class="hljs-function">-></span> repl.outputStream.write <span class="hljs-string">'\n'</span> <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> repl.rli.closed
|
||||
addMultilineHandler repl
|
||||
addHistory repl, opts.historyFile, opts.historyMaxInputSize <span class="hljs-keyword">if</span> opts.historyFile</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-27">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-27">¶</a>
|
||||
</div>
|
||||
<p>Adapt help inherited from the node REPL</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> repl.commands[getCommandId(repl, <span class="hljs-string">'load'</span>)].help = <span class="hljs-string">'Load code from a file into this REPL session'</span>
|
||||
repl</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
1241
docs/v2/annotated-source/rewriter.html
Normal file
1241
docs/v2/annotated-source/rewriter.html
Normal file
File diff suppressed because it is too large
Load Diff
398
docs/v2/annotated-source/scope.html
Normal file
398
docs/v2/annotated-source/scope.html
Normal file
@@ -0,0 +1,398 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>scope.litcoffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>scope.litcoffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
<p>The <strong>Scope</strong> class regulates lexical scoping within CoffeeScript. As you
|
||||
generate code, you create a tree of scopes in the same shape as the nested
|
||||
function bodies. Each scope knows about the variables declared within it,
|
||||
and has a reference to its parent enclosing scope. In this way, we know which
|
||||
variables are new and need to be declared with <code>var</code>, and which are shared
|
||||
with external scopes.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>exports.Scope = <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Scope</span></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-2">¶</a>
|
||||
</div>
|
||||
<p>Initialize a scope with its parent, for lookups up the chain,
|
||||
as well as a reference to the <strong>Block</strong> node it belongs to, which is
|
||||
where it should declare its variables, a reference to the function that
|
||||
it belongs to, and a list of variables referenced in the source code
|
||||
and therefore should be avoided when generating variables.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> constructor: <span class="hljs-function"><span class="hljs-params">(@parent, @expressions, @method, @referencedVars)</span> -></span>
|
||||
@variables = [{name: <span class="hljs-string">'arguments'</span>, type: <span class="hljs-string">'arguments'</span>}]
|
||||
@positions = {}
|
||||
@utilities = {} <span class="hljs-keyword">unless</span> @parent</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-3">¶</a>
|
||||
</div>
|
||||
<p>The <code>@root</code> is the top-level <strong>Scope</strong> object for a given file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> @root = @parent?.root ? <span class="hljs-keyword">this</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-4">¶</a>
|
||||
</div>
|
||||
<p>Adds a new variable or overrides an existing one.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> add: <span class="hljs-function"><span class="hljs-params">(name, type, immediate)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> @parent.add name, type, immediate <span class="hljs-keyword">if</span> @shared <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> immediate
|
||||
<span class="hljs-keyword">if</span> Object::hasOwnProperty.call @positions, name
|
||||
@variables[@positions[name]].type = type
|
||||
<span class="hljs-keyword">else</span>
|
||||
@positions[name] = @variables.push({name, type}) - <span class="hljs-number">1</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-5">¶</a>
|
||||
</div>
|
||||
<p>When <code>super</code> is called, we need to find the name of the current method we’re
|
||||
in, so that we know how to invoke the same method of the parent class. This
|
||||
can get complicated if super is being called from an inner function.
|
||||
<code>namedMethod</code> will walk up the scope tree until it either finds the first
|
||||
function object that has a name filled in, or bottoms out.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> namedMethod: <span class="hljs-function">-></span>
|
||||
<span class="hljs-keyword">return</span> @method <span class="hljs-keyword">if</span> @method?.name <span class="hljs-keyword">or</span> !@parent
|
||||
@parent.namedMethod()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-6">¶</a>
|
||||
</div>
|
||||
<p>Look up a variable name in lexical scope, and declare it if it does not
|
||||
already exist.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> find: <span class="hljs-function"><span class="hljs-params">(name, type = <span class="hljs-string">'var'</span>)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-literal">yes</span> <span class="hljs-keyword">if</span> @check name
|
||||
@add name, type
|
||||
<span class="hljs-literal">no</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-7">¶</a>
|
||||
</div>
|
||||
<p>Reserve a variable name as originating from a function parameter for this
|
||||
scope. No <code>var</code> required for internal references.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> parameter: <span class="hljs-function"><span class="hljs-params">(name)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> @shared <span class="hljs-keyword">and</span> @parent.check name, <span class="hljs-literal">yes</span>
|
||||
@add name, <span class="hljs-string">'param'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-8">¶</a>
|
||||
</div>
|
||||
<p>Just check to see if a variable has already been declared, without reserving,
|
||||
walks up to the root scope.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> check: <span class="hljs-function"><span class="hljs-params">(name)</span> -></span>
|
||||
!!(@type(name) <span class="hljs-keyword">or</span> @parent?.check(name))</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-9">¶</a>
|
||||
</div>
|
||||
<p>Generate a temporary variable name at the given index.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> temporary: <span class="hljs-function"><span class="hljs-params">(name, index, single=<span class="hljs-literal">false</span>)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> single
|
||||
startCode = name.charCodeAt(<span class="hljs-number">0</span>)
|
||||
endCode = <span class="hljs-string">'z'</span>.charCodeAt(<span class="hljs-number">0</span>)
|
||||
diff = endCode - startCode
|
||||
newCode = startCode + index % (diff + <span class="hljs-number">1</span>)
|
||||
letter = String.fromCharCode(newCode)
|
||||
num = index <span class="hljs-regexp">//</span> (diff + <span class="hljs-number">1</span>)
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{letter}</span><span class="hljs-subst">#{num <span class="hljs-keyword">or</span> <span class="hljs-string">''</span>}</span>"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{name}</span><span class="hljs-subst">#{index <span class="hljs-keyword">or</span> <span class="hljs-string">''</span>}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-10">¶</a>
|
||||
</div>
|
||||
<p>Gets the type of a variable.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> type: <span class="hljs-function"><span class="hljs-params">(name)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> v.type <span class="hljs-keyword">for</span> v <span class="hljs-keyword">in</span> @variables <span class="hljs-keyword">when</span> v.name <span class="hljs-keyword">is</span> name
|
||||
<span class="hljs-literal">null</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-11">¶</a>
|
||||
</div>
|
||||
<p>If we need to store an intermediate result, find an available name for a
|
||||
compiler-generated variable. <code>_var</code>, <code>_var2</code>, and so on…</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> freeVariable: <span class="hljs-function"><span class="hljs-params">(name, options={})</span> -></span>
|
||||
index = <span class="hljs-number">0</span>
|
||||
<span class="hljs-keyword">loop</span>
|
||||
temp = @temporary name, index, options.single
|
||||
<span class="hljs-keyword">break</span> <span class="hljs-keyword">unless</span> @check(temp) <span class="hljs-keyword">or</span> temp <span class="hljs-keyword">in</span> @root.referencedVars
|
||||
index++
|
||||
@add temp, <span class="hljs-string">'var'</span>, <span class="hljs-literal">yes</span> <span class="hljs-keyword">if</span> options.reserve ? <span class="hljs-literal">true</span>
|
||||
temp</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-12">¶</a>
|
||||
</div>
|
||||
<p>Ensure that an assignment is made at the top of this scope
|
||||
(or at the top-level scope, if requested).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> assign: <span class="hljs-function"><span class="hljs-params">(name, value)</span> -></span>
|
||||
@add name, {value, assigned: <span class="hljs-literal">yes</span>}, <span class="hljs-literal">yes</span>
|
||||
@hasAssignments = <span class="hljs-literal">yes</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-13">¶</a>
|
||||
</div>
|
||||
<p>Does this scope have any declared variables?</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> hasDeclarations: <span class="hljs-function">-></span>
|
||||
!!@declaredVariables().length</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-14">¶</a>
|
||||
</div>
|
||||
<p>Return the list of variables first declared in this scope.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> declaredVariables: <span class="hljs-function">-></span>
|
||||
(v.name <span class="hljs-keyword">for</span> v <span class="hljs-keyword">in</span> @variables <span class="hljs-keyword">when</span> v.type <span class="hljs-keyword">is</span> <span class="hljs-string">'var'</span>).sort()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-15">¶</a>
|
||||
</div>
|
||||
<p>Return the list of assignments that are supposed to be made at the top
|
||||
of this scope.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> assignedVariables: <span class="hljs-function">-></span>
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{v.name}</span> = <span class="hljs-subst">#{v.type.value}</span>"</span> <span class="hljs-keyword">for</span> v <span class="hljs-keyword">in</span> @variables <span class="hljs-keyword">when</span> v.type.assigned</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
523
docs/v2/annotated-source/sourcemap.html
Normal file
523
docs/v2/annotated-source/sourcemap.html
Normal file
@@ -0,0 +1,523 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>sourcemap.litcoffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>sourcemap.litcoffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
<p>Source maps allow JavaScript runtimes to match running JavaScript back to
|
||||
the original source code that corresponds to it. This can be minified
|
||||
JavaScript, but in our case, we’re concerned with mapping pretty-printed
|
||||
JavaScript back to CoffeeScript.</p>
|
||||
<p>In order to produce maps, we must keep track of positions (line number, column number)
|
||||
that originated every node in the syntax tree, and be able to generate a
|
||||
<a href="https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit">map file</a>
|
||||
— which is a compact, VLQ-encoded representation of the JSON serialization
|
||||
of this information — to write out alongside the generated JavaScript.</p>
|
||||
<h2 id="linemap">LineMap</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-2">¶</a>
|
||||
</div>
|
||||
<p>A <strong>LineMap</strong> object keeps track of information about original line and column
|
||||
positions for a single line of output JavaScript code.
|
||||
<strong>SourceMaps</strong> are implemented in terms of <strong>LineMaps</strong>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">LineMap</span></span>
|
||||
constructor: <span class="hljs-function"><span class="hljs-params">(@line)</span> -></span>
|
||||
@columns = []
|
||||
|
||||
add: <span class="hljs-function"><span class="hljs-params">(column, [sourceLine, sourceColumn], options={})</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> @columns[column] <span class="hljs-keyword">and</span> options.noReplace
|
||||
@columns[column] = {line: @line, column, sourceLine, sourceColumn}
|
||||
|
||||
sourceLocation: <span class="hljs-function"><span class="hljs-params">(column)</span> -></span>
|
||||
column-- <span class="hljs-keyword">until</span> (mapping = @columns[column]) <span class="hljs-keyword">or</span> (column <= <span class="hljs-number">0</span>)
|
||||
mapping <span class="hljs-keyword">and</span> [mapping.sourceLine, mapping.sourceColumn]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-3">¶</a>
|
||||
</div>
|
||||
<h2 id="sourcemap">SourceMap</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-4">¶</a>
|
||||
</div>
|
||||
<p>Maps locations in a single generated JavaScript file back to locations in
|
||||
the original CoffeeScript source file.</p>
|
||||
<p>This is intentionally agnostic towards how a source map might be represented on
|
||||
disk. Once the compiler is ready to produce a “v3”-style source map, we can walk
|
||||
through the arrays of line and column buffer to produce it.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SourceMap</span></span>
|
||||
constructor: <span class="hljs-function">-></span>
|
||||
@lines = []</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-5">¶</a>
|
||||
</div>
|
||||
<p>Adds a mapping to this SourceMap. <code>sourceLocation</code> and <code>generatedLocation</code>
|
||||
are both <code>[line, column]</code> arrays. If <code>options.noReplace</code> is true, then if there
|
||||
is already a mapping for the specified <code>line</code> and <code>column</code>, this will have no
|
||||
effect.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> add: <span class="hljs-function"><span class="hljs-params">(sourceLocation, generatedLocation, options = {})</span> -></span>
|
||||
[line, column] = generatedLocation
|
||||
lineMap = (@lines[line] <span class="hljs-keyword">or</span>= <span class="hljs-keyword">new</span> LineMap(line))
|
||||
lineMap.add column, sourceLocation, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-6">¶</a>
|
||||
</div>
|
||||
<p>Look up the original position of a given <code>line</code> and <code>column</code> in the generated
|
||||
code.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> sourceLocation: <span class="hljs-function"><span class="hljs-params">([line, column])</span> -></span>
|
||||
line-- <span class="hljs-keyword">until</span> (lineMap = @lines[line]) <span class="hljs-keyword">or</span> (line <= <span class="hljs-number">0</span>)
|
||||
lineMap <span class="hljs-keyword">and</span> lineMap.sourceLocation column</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-7">¶</a>
|
||||
</div>
|
||||
<h2 id="v3-sourcemap-generation">V3 SourceMap Generation</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-8">¶</a>
|
||||
</div>
|
||||
<p>Builds up a V3 source map, returning the generated JSON as a string.
|
||||
<code>options.sourceRoot</code> may be used to specify the sourceRoot written to the source
|
||||
map. Also, <code>options.sourceFiles</code> and <code>options.generatedFile</code> may be passed to
|
||||
set “sources” and “file”, respectively.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> generate: <span class="hljs-function"><span class="hljs-params">(options = {}, code = <span class="hljs-literal">null</span>)</span> -></span>
|
||||
writingline = <span class="hljs-number">0</span>
|
||||
lastColumn = <span class="hljs-number">0</span>
|
||||
lastSourceLine = <span class="hljs-number">0</span>
|
||||
lastSourceColumn = <span class="hljs-number">0</span>
|
||||
needComma = <span class="hljs-literal">no</span>
|
||||
buffer = <span class="hljs-string">""</span>
|
||||
|
||||
<span class="hljs-keyword">for</span> lineMap, lineNumber <span class="hljs-keyword">in</span> @lines <span class="hljs-keyword">when</span> lineMap
|
||||
<span class="hljs-keyword">for</span> mapping <span class="hljs-keyword">in</span> lineMap.columns <span class="hljs-keyword">when</span> mapping
|
||||
<span class="hljs-keyword">while</span> writingline < mapping.line
|
||||
lastColumn = <span class="hljs-number">0</span>
|
||||
needComma = <span class="hljs-literal">no</span>
|
||||
buffer += <span class="hljs-string">";"</span>
|
||||
writingline++</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-9">¶</a>
|
||||
</div>
|
||||
<p>Write a comma if we’ve already written a segment on this line.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> needComma
|
||||
buffer += <span class="hljs-string">","</span>
|
||||
needComma = <span class="hljs-literal">no</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-10">¶</a>
|
||||
</div>
|
||||
<p>Write the next segment. Segments can be 1, 4, or 5 values. If just one, then it
|
||||
is a generated column which doesn’t match anything in the source code.</p>
|
||||
<p>The starting column in the generated source, relative to any previous recorded
|
||||
column for the current line:</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> buffer += @encodeVlq mapping.column - lastColumn
|
||||
lastColumn = mapping.column</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-11">¶</a>
|
||||
</div>
|
||||
<p>The index into the list of sources:</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> buffer += @encodeVlq <span class="hljs-number">0</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-12">¶</a>
|
||||
</div>
|
||||
<p>The starting line in the original source, relative to the previous source line.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> buffer += @encodeVlq mapping.sourceLine - lastSourceLine
|
||||
lastSourceLine = mapping.sourceLine</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-13">¶</a>
|
||||
</div>
|
||||
<p>The starting column in the original source, relative to the previous column.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> buffer += @encodeVlq mapping.sourceColumn - lastSourceColumn
|
||||
lastSourceColumn = mapping.sourceColumn
|
||||
needComma = <span class="hljs-literal">yes</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-14">¶</a>
|
||||
</div>
|
||||
<p>Produce the canonical JSON object format for a “v3” source map.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> v3 =
|
||||
version: <span class="hljs-number">3</span>
|
||||
file: options.generatedFile <span class="hljs-keyword">or</span> <span class="hljs-string">''</span>
|
||||
sourceRoot: options.sourceRoot <span class="hljs-keyword">or</span> <span class="hljs-string">''</span>
|
||||
sources: options.sourceFiles <span class="hljs-keyword">or</span> [<span class="hljs-string">''</span>]
|
||||
names: []
|
||||
mappings: buffer
|
||||
|
||||
v3.sourcesContent = [code] <span class="hljs-keyword">if</span> options.inlineMap
|
||||
|
||||
v3</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-15">¶</a>
|
||||
</div>
|
||||
<h2 id="base64-vlq-encoding">Base64 VLQ Encoding</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-16">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-16">¶</a>
|
||||
</div>
|
||||
<p>Note that SourceMap VLQ encoding is “backwards”. MIDI-style VLQ encoding puts
|
||||
the most-significant-bit (MSB) from the original value into the MSB of the VLQ
|
||||
encoded value (see <a href="http://en.wikipedia.org/wiki/File:Uintvar_coding.svg">Wikipedia</a>).
|
||||
SourceMap VLQ does things the other way around, with the least significat four
|
||||
bits of the original value encoded into the first byte of the VLQ encoded value.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> VLQ_SHIFT = <span class="hljs-number">5</span>
|
||||
VLQ_CONTINUATION_BIT = <span class="hljs-number">1</span> << VLQ_SHIFT <span class="hljs-comment"># 0010 0000</span>
|
||||
VLQ_VALUE_MASK = VLQ_CONTINUATION_BIT - <span class="hljs-number">1</span> <span class="hljs-comment"># 0001 1111</span>
|
||||
|
||||
encodeVlq: <span class="hljs-function"><span class="hljs-params">(value)</span> -></span>
|
||||
answer = <span class="hljs-string">''</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-17">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-17">¶</a>
|
||||
</div>
|
||||
<p>Least significant bit represents the sign.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> signBit = <span class="hljs-keyword">if</span> value < <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> <span class="hljs-number">1</span> <span class="hljs-keyword">else</span> <span class="hljs-number">0</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-18">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-18">¶</a>
|
||||
</div>
|
||||
<p>The next bits are the actual value.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> valueToEncode = (Math.abs(value) << <span class="hljs-number">1</span>) + signBit</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-19">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-19">¶</a>
|
||||
</div>
|
||||
<p>Make sure we encode at least one character, even if valueToEncode is 0.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">while</span> valueToEncode <span class="hljs-keyword">or</span> <span class="hljs-keyword">not</span> answer
|
||||
nextChunk = valueToEncode & VLQ_VALUE_MASK
|
||||
valueToEncode = valueToEncode >> VLQ_SHIFT
|
||||
nextChunk |= VLQ_CONTINUATION_BIT <span class="hljs-keyword">if</span> valueToEncode
|
||||
answer += @encodeBase64 nextChunk
|
||||
|
||||
answer</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-20">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-20">¶</a>
|
||||
</div>
|
||||
<h2 id="regular-base64-encoding">Regular Base64 Encoding</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-21">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-21">¶</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> BASE64_CHARS = <span class="hljs-string">'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'</span>
|
||||
|
||||
encodeBase64: <span class="hljs-function"><span class="hljs-params">(value)</span> -></span>
|
||||
BASE64_CHARS[value] <span class="hljs-keyword">or</span> <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error <span class="hljs-string">"Cannot Base64 encode value: <span class="hljs-subst">#{value}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-22">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-22">¶</a>
|
||||
</div>
|
||||
<p>Our API for source maps is just the <code>SourceMap</code> class.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">module</span>.exports = SourceMap</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
457
docs/v2/browser-compiler/coffeescript.js
Normal file
457
docs/v2/browser-compiler/coffeescript.js
Normal file
@@ -0,0 +1,457 @@
|
||||
/**
|
||||
* CoffeeScript Compiler v2.0.0-alpha1
|
||||
* http://coffeescript.org
|
||||
*
|
||||
* Copyright 2011, Jeremy Ashkenas
|
||||
* Released under the MIT License
|
||||
*/
|
||||
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(q,ra,ua){if(ua.get||ua.set)throw new TypeError("ES3 does not support getters and setters.");q!=Array.prototype&&q!=Object.prototype&&(q[ra]=ua.value)};$jscomp.getGlobal=function(q){return"undefined"!=typeof window&&window===q?q:"undefined"!=typeof global&&null!=global?global:q};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
|
||||
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(q){return $jscomp.SYMBOL_PREFIX+(q||"")+$jscomp.symbolCounter_++};
|
||||
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var q=$jscomp.global.Symbol.iterator;q||(q=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[q]&&$jscomp.defineProperty(Array.prototype,q,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};
|
||||
$jscomp.arrayIterator=function(q){var ra=0;return $jscomp.iteratorPrototype(function(){return ra<q.length?{done:!1,value:q[ra++]}:{done:!0}})};$jscomp.iteratorPrototype=function(q){$jscomp.initSymbolIterator();q={next:q};q[$jscomp.global.Symbol.iterator]=function(){return this};return q};$jscomp.makeIterator=function(q){$jscomp.initSymbolIterator();var ra=q[Symbol.iterator];return ra?ra.call(q):$jscomp.arrayIterator(q)};
|
||||
$jscomp.arrayFromIterator=function(q){for(var ra,ua=[];!(ra=q.next()).done;)ua.push(ra.value);return ua};$jscomp.arrayFromIterable=function(q){return q instanceof Array?q:$jscomp.arrayFromIterator($jscomp.makeIterator(q))};$jscomp.inherits=function(q,ra){function ua(){}ua.prototype=ra.prototype;q.prototype=new ua;q.prototype.constructor=q;for(var k in ra)if(Object.defineProperties){var xa=Object.getOwnPropertyDescriptor(ra,k);xa&&Object.defineProperty(q,k,xa)}else q[k]=ra[k]};
|
||||
$jscomp.checkStringArgs=function(q,ra,ua){if(null==q)throw new TypeError("The 'this' value for String.prototype."+ua+" must not be null or undefined");if(ra instanceof RegExp)throw new TypeError("First argument to String.prototype."+ua+" must not be a regular expression");return q+""};
|
||||
$jscomp.polyfill=function(q,ra,ua,k){if(ra){ua=$jscomp.global;q=q.split(".");for(k=0;k<q.length-1;k++){var xa=q[k];xa in ua||(ua[xa]={});ua=ua[xa]}q=q[q.length-1];k=ua[q];ra=ra(k);ra!=k&&null!=ra&&$jscomp.defineProperty(ua,q,{configurable:!0,writable:!0,value:ra})}};
|
||||
$jscomp.polyfill("String.prototype.repeat",function(q){return q?q:function(q){var ua=$jscomp.checkStringArgs(this,null,"repeat");if(0>q||1342177279<q)throw new RangeError("Invalid count value");q|=0;for(var k="";q;)if(q&1&&(k+=ua),q>>>=1)ua+=ua;return k}},"es6-impl","es3");$jscomp.findInternal=function(q,ra,ua){q instanceof String&&(q=String(q));for(var k=q.length,xa=0;xa<k;xa++){var sa=q[xa];if(ra.call(ua,sa,xa,q))return{i:xa,v:sa}}return{i:-1,v:void 0}};
|
||||
$jscomp.polyfill("Array.prototype.find",function(q){return q?q:function(q,ua){return $jscomp.findInternal(this,q,ua).v}},"es6-impl","es3");$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(q,ra){$jscomp.initSymbolIterator();q instanceof String&&(q+="");var ua=0,k={next:function(){if(ua<q.length){var xa=ua++;return{value:ra(xa,q[xa]),done:!1}}k.next=function(){return{done:!0,value:void 0}};return k.next()}};k[Symbol.iterator]=function(){return k};return k};
|
||||
$jscomp.polyfill("Array.prototype.keys",function(q){return q?q:function(){return $jscomp.iteratorFromArray(this,function(q){return q})}},"es6-impl","es3");
|
||||
(function(q){var ra=function(){function q(k){return q[k]}q["../../package.json"]={name:"coffeescript",description:"Unfancy JavaScript",keywords:["javascript","language","coffeescript","compiler"],author:"Jeremy Ashkenas",version:"2.0.0-alpha1",license:"MIT",engines:{node:"\x3e\x3d7.2.1"},directories:{lib:"./lib/coffeescript"},main:"./lib/coffeescript/coffeescript",bin:{coffee:"./bin/coffee",cake:"./bin/cake"},files:["bin","lib","register.js","repl.js"],preferGlobal:!0,scripts:{test:"node ./bin/cake test",
|
||||
"test-harmony":"node --harmony ./bin/cake test"},homepage:"http://coffeescript.org",bugs:"https://github.com/jashkenas/coffeescript/issues",repository:{type:"git",url:"git://github.com/jashkenas/coffeescript.git"},devDependencies:{docco:"~0.7.0","google-closure-compiler-js":"^20170124.0.0","highlight.js":"~9.9.0",jison:"\x3e\x3d0.4.17",marked:"^0.3.6",underscore:"~1.8.3"},dependencies:{marked:"~0.3.6"}};q.marked=function(){var k={},q={exports:k};(function(){function sa(a){this.tokens=[];this.tokens.links=
|
||||
{};this.options=a||D.defaults;this.rules=w.normal;this.options.gfm&&(this.rules=this.options.tables?w.tables:w.gfm)}function ha(l,c){this.options=c||D.defaults;this.links=l;this.rules=z.normal;this.renderer=this.options.renderer||new a;this.renderer.options=this.options;if(!this.links)throw Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?z.breaks:z.gfm:this.options.pedantic&&(this.rules=z.pedantic)}function a(a){this.options=a||{}}function g(l){this.tokens=
|
||||
[];this.token=null;this.options=l||D.defaults;this.options.renderer=this.options.renderer||new a;this.renderer=this.options.renderer;this.renderer.options=this.options}function ta(a,c){return a.replace(c?/&/g:/&(?!#?\w+;)/g,"\x26amp;").replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;").replace(/"/g,"\x26quot;").replace(/'/g,"\x26#39;")}function m(a){return a.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(a,l){l=l.toLowerCase();return"colon"===l?":":"#"===l.charAt(0)?"x"===l.charAt(1)?String.fromCharCode(parseInt(l.substring(2),
|
||||
16)):String.fromCharCode(+l.substring(1)):""})}function c(a,c){a=a.source;c=c||"";return function B(l,e){if(!l)return new RegExp(a,c);e=e.source||e;e=e.replace(/(^|[^\[])\^/g,"$1");a=a.replace(l,e);return B}}function e(){}function y(a){for(var l=1,c,e;l<arguments.length;l++)for(e in c=arguments[l],c)Object.prototype.hasOwnProperty.call(c,e)&&(a[e]=c[e]);return a}function D(a,c,e){if(e||"function"===typeof c){e||(e=c,c=null);c=y({},D.defaults,c||{});var l=c.highlight,E,p,A=0;try{E=sa.lex(a,c)}catch(n){return e(n)}p=
|
||||
E.length;var h=function(a){if(a)return c.highlight=l,e(a);var h;try{h=g.parse(E,c)}catch(t){a=t}c.highlight=l;return a?e(a):e(null,h)};if(!l||3>l.length)return h();delete c.highlight;if(!p)return h();for(;A<E.length;A++)(function(a){return"code"!==a.type?--p||h():l(a.text,a.lang,function(l,c){if(l)return h(l);if(null==c||c===a.text)return--p||h();a.text=c;a.escaped=!0;--p||h()})})(E[A])}else try{return c&&(c=y({},D.defaults,c)),g.parse(sa.lex(a,c),c)}catch(n){n.message+="\nPlease report this to https://github.com/chjj/marked.";
|
||||
if((c||D.defaults).silent)return"\x3cp\x3eAn error occured:\x3c/p\x3e\x3cpre\x3e"+ta(n.message+"",!0)+"\x3c/pre\x3e";throw n;}}var w={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:e,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:e,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,
|
||||
def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:e,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/,bullet:/(?:[*+-]|\d+\.)/,item:/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/};w.item=c(w.item,"gm")(/bull/g,w.bullet)();w.list=c(w.list)(/bull/g,w.bullet)("hr","\\n+(?\x3d\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?\x3d"+w.def.source+")")();w.blockquote=c(w.blockquote)("def",w.def)();w._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";
|
||||
w.html=c(w.html)("comment",/\x3c!--[\s\S]*?--\x3e/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,w._tag)();w.paragraph=c(w.paragraph)("hr",w.hr)("heading",w.heading)("lheading",w.lheading)("blockquote",w.blockquote)("tag","\x3c"+w._tag)("def",w.def)();w.normal=y({},w);w.gfm=y({},w.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});w.gfm.paragraph=c(w.paragraph)("(?!",
|
||||
"(?!"+w.gfm.fences.source.replace("\\1","\\2")+"|"+w.list.source.replace("\\1","\\3")+"|")();w.tables=y({},w.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});sa.rules=w;sa.lex=function(a,c){return(new sa(c)).lex(a)};sa.prototype.lex=function(a){a=a.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(a,!0)};sa.prototype.token=function(a,c,e){a=
|
||||
a.replace(/^ +$/gm,"");for(var l,g,p,E,h,n,u;a;){if(p=this.rules.newline.exec(a))a=a.substring(p[0].length),1<p[0].length&&this.tokens.push({type:"space"});if(p=this.rules.code.exec(a))a=a.substring(p[0].length),p=p[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?p:p.replace(/\n+$/,"")});else if(p=this.rules.fences.exec(a))a=a.substring(p[0].length),this.tokens.push({type:"code",lang:p[2],text:p[3]||""});else if(p=this.rules.heading.exec(a))a=a.substring(p[0].length),
|
||||
this.tokens.push({type:"heading",depth:p[1].length,text:p[2]});else if(c&&(p=this.rules.nptable.exec(a))){a=a.substring(p[0].length);h={type:"table",header:p[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:p[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:p[3].replace(/\n$/,"").split("\n")};for(n=0;n<h.align.length;n++)/^ *-+: *$/.test(h.align[n])?h.align[n]="right":/^ *:-+: *$/.test(h.align[n])?h.align[n]="center":/^ *:-+ *$/.test(h.align[n])?h.align[n]="left":h.align[n]=null;for(n=0;n<h.cells.length;n++)h.cells[n]=
|
||||
h.cells[n].split(/ *\| */);this.tokens.push(h)}else if(p=this.rules.lheading.exec(a))a=a.substring(p[0].length),this.tokens.push({type:"heading",depth:"\x3d"===p[2]?1:2,text:p[1]});else if(p=this.rules.hr.exec(a))a=a.substring(p[0].length),this.tokens.push({type:"hr"});else if(p=this.rules.blockquote.exec(a))a=a.substring(p[0].length),this.tokens.push({type:"blockquote_start"}),p=p[0].replace(/^ *> ?/gm,""),this.token(p,c,!0),this.tokens.push({type:"blockquote_end"});else if(p=this.rules.list.exec(a)){a=
|
||||
a.substring(p[0].length);E=p[2];this.tokens.push({type:"list_start",ordered:1<E.length});p=p[0].match(this.rules.item);l=!1;u=p.length;for(n=0;n<u;n++)h=p[n],g=h.length,h=h.replace(/^ *([*+-]|\d+\.) +/,""),~h.indexOf("\n ")&&(g-=h.length,h=this.options.pedantic?h.replace(/^ {1,4}/gm,""):h.replace(new RegExp("^ {1,"+g+"}","gm"),"")),this.options.smartLists&&n!==u-1&&(g=w.bullet.exec(p[n+1])[0],E===g||1<E.length&&1<g.length||(a=p.slice(n+1).join("\n")+a,n=u-1)),g=l||/\n\n(?!\s*$)/.test(h),n!==u-1&&
|
||||
(l="\n"===h.charAt(h.length-1),g||(g=l)),this.tokens.push({type:g?"loose_item_start":"list_item_start"}),this.token(h,!1,e),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(p=this.rules.html.exec(a))a=a.substring(p[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===p[1]||"script"===p[1]||"style"===p[1]),text:p[0]});else if(!e&&c&&(p=this.rules.def.exec(a)))a=a.substring(p[0].length),this.tokens.links[p[1].toLowerCase()]=
|
||||
{href:p[2],title:p[3]};else if(c&&(p=this.rules.table.exec(a))){a=a.substring(p[0].length);h={type:"table",header:p[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:p[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:p[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(n=0;n<h.align.length;n++)/^ *-+: *$/.test(h.align[n])?h.align[n]="right":/^ *:-+: *$/.test(h.align[n])?h.align[n]="center":/^ *:-+ *$/.test(h.align[n])?h.align[n]="left":h.align[n]=null;for(n=0;n<h.cells.length;n++)h.cells[n]=h.cells[n].replace(/^ *\| *| *\| *$/g,
|
||||
"").split(/ *\| */);this.tokens.push(h)}else if(c&&(p=this.rules.paragraph.exec(a)))a=a.substring(p[0].length),this.tokens.push({type:"paragraph",text:"\n"===p[1].charAt(p[1].length-1)?p[1].slice(0,-1):p[1]});else if(p=this.rules.text.exec(a))a=a.substring(p[0].length),this.tokens.push({type:"text",text:p[0]});else if(a)throw Error("Infinite loop on byte: "+a.charCodeAt(0));}return this.tokens};var z={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:e,tag:/^\x3c!--[\s\S]*?--\x3e|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,
|
||||
link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:e,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/,_inside:/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,_href:/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/};z.link=c(z.link)("inside",z._inside)("href",z._href)();z.reflink=
|
||||
c(z.reflink)("inside",z._inside)();z.normal=y({},z);z.pedantic=y({},z.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});z.gfm=y({},z.normal,{escape:c(z.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:c(z.text)("]|","~]|")("|","|https?://|")()});z.breaks=y({},z.gfm,{br:c(z.br)("{2,}","*")(),text:c(z.gfm.text)("{2,}","*")()});ha.rules=z;ha.output=function(a,
|
||||
c,e){return(new ha(c,e)).output(a)};ha.prototype.output=function(a){for(var c="",e,l;a;)if(l=this.rules.escape.exec(a))a=a.substring(l[0].length),c+=l[1];else if(l=this.rules.autolink.exec(a))a=a.substring(l[0].length),"@"===l[2]?(e=":"===l[1].charAt(6)?this.mangle(l[1].substring(7)):this.mangle(l[1]),l=this.mangle("mailto:")+e):l=e=ta(l[1]),c+=this.renderer.link(l,null,e);else if(!this.inLink&&(l=this.rules.url.exec(a)))a=a.substring(l[0].length),l=e=ta(l[1]),c+=this.renderer.link(l,null,e);else if(l=
|
||||
this.rules.tag.exec(a))!this.inLink&&/^<a /i.test(l[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(l[0])&&(this.inLink=!1),a=a.substring(l[0].length),c+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):ta(l[0]):l[0];else if(l=this.rules.link.exec(a))a=a.substring(l[0].length),this.inLink=!0,c+=this.outputLink(l,{href:l[2],title:l[3]}),this.inLink=!1;else if((l=this.rules.reflink.exec(a))||(l=this.rules.nolink.exec(a)))a=a.substring(l[0].length),e=(l[2]||l[1]).replace(/\s+/g,
|
||||
" "),(e=this.links[e.toLowerCase()])&&e.href?(this.inLink=!0,c+=this.outputLink(l,e),this.inLink=!1):(c+=l[0].charAt(0),a=l[0].substring(1)+a);else if(l=this.rules.strong.exec(a))a=a.substring(l[0].length),c+=this.renderer.strong(this.output(l[2]||l[1]));else if(l=this.rules.em.exec(a))a=a.substring(l[0].length),c+=this.renderer.em(this.output(l[2]||l[1]));else if(l=this.rules.code.exec(a))a=a.substring(l[0].length),c+=this.renderer.codespan(ta(l[2],!0));else if(l=this.rules.br.exec(a))a=a.substring(l[0].length),
|
||||
c+=this.renderer.br();else if(l=this.rules.del.exec(a))a=a.substring(l[0].length),c+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(a))a=a.substring(l[0].length),c+=this.renderer.text(ta(this.smartypants(l[0])));else if(a)throw Error("Infinite loop on byte: "+a.charCodeAt(0));return c};ha.prototype.outputLink=function(a,c){var l=ta(c.href);c=c.title?ta(c.title):null;return"!"!==a[0].charAt(0)?this.renderer.link(l,c,this.output(a[1])):this.renderer.image(l,c,ta(a[1]))};ha.prototype.smartypants=
|
||||
function(a){return this.options.smartypants?a.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201c").replace(/"/g,"\u201d").replace(/\.{3}/g,"\u2026"):a};ha.prototype.mangle=function(a){if(!this.options.mangle)return a;for(var c="",l=a.length,e=0,g;e<l;e++)g=a.charCodeAt(e),.5<Math.random()&&(g="x"+g.toString(16)),c+="\x26#"+g+";";return c};a.prototype.code=function(a,c,e){if(this.options.highlight){var l=
|
||||
this.options.highlight(a,c);null!=l&&l!==a&&(e=!0,a=l)}return c?'\x3cpre\x3e\x3ccode class\x3d"'+this.options.langPrefix+ta(c,!0)+'"\x3e'+(e?a:ta(a,!0))+"\n\x3c/code\x3e\x3c/pre\x3e\n":"\x3cpre\x3e\x3ccode\x3e"+(e?a:ta(a,!0))+"\n\x3c/code\x3e\x3c/pre\x3e"};a.prototype.blockquote=function(a){return"\x3cblockquote\x3e\n"+a+"\x3c/blockquote\x3e\n"};a.prototype.html=function(a){return a};a.prototype.heading=function(a,c,e){return"\x3ch"+c+' id\x3d"'+this.options.headerPrefix+e.toLowerCase().replace(/[^\w]+/g,
|
||||
"-")+'"\x3e'+a+"\x3c/h"+c+"\x3e\n"};a.prototype.hr=function(){return this.options.xhtml?"\x3chr/\x3e\n":"\x3chr\x3e\n"};a.prototype.list=function(a,c){c=c?"ol":"ul";return"\x3c"+c+"\x3e\n"+a+"\x3c/"+c+"\x3e\n"};a.prototype.listitem=function(a){return"\x3cli\x3e"+a+"\x3c/li\x3e\n"};a.prototype.paragraph=function(a){return"\x3cp\x3e"+a+"\x3c/p\x3e\n"};a.prototype.table=function(a,c){return"\x3ctable\x3e\n\x3cthead\x3e\n"+a+"\x3c/thead\x3e\n\x3ctbody\x3e\n"+c+"\x3c/tbody\x3e\n\x3c/table\x3e\n"};a.prototype.tablerow=
|
||||
function(a){return"\x3ctr\x3e\n"+a+"\x3c/tr\x3e\n"};a.prototype.tablecell=function(a,c){var e=c.header?"th":"td";return(c.align?"\x3c"+e+' style\x3d"text-align:'+c.align+'"\x3e':"\x3c"+e+"\x3e")+a+"\x3c/"+e+"\x3e\n"};a.prototype.strong=function(a){return"\x3cstrong\x3e"+a+"\x3c/strong\x3e"};a.prototype.em=function(a){return"\x3cem\x3e"+a+"\x3c/em\x3e"};a.prototype.codespan=function(a){return"\x3ccode\x3e"+a+"\x3c/code\x3e"};a.prototype.br=function(){return this.options.xhtml?"\x3cbr/\x3e":"\x3cbr\x3e"};
|
||||
a.prototype.del=function(a){return"\x3cdel\x3e"+a+"\x3c/del\x3e"};a.prototype.link=function(a,c,e){if(this.options.sanitize){try{var l=decodeURIComponent(m(a)).replace(/[^\w:]/g,"").toLowerCase()}catch(J){return""}if(0===l.indexOf("javascript:")||0===l.indexOf("vbscript:"))return""}a='\x3ca href\x3d"'+a+'"';c&&(a+=' title\x3d"'+c+'"');return a+("\x3e"+e+"\x3c/a\x3e")};a.prototype.image=function(a,c,e){a='\x3cimg src\x3d"'+a+'" alt\x3d"'+e+'"';c&&(a+=' title\x3d"'+c+'"');return a+=this.options.xhtml?
|
||||
"/\x3e":"\x3e"};a.prototype.text=function(a){return a};g.parse=function(a,c,e){return(new g(c,e)).parse(a)};g.prototype.parse=function(a){this.inline=new ha(a.links,this.options,this.renderer);this.tokens=a.reverse();for(a="";this.next();)a+=this.tok();return a};g.prototype.next=function(){return this.token=this.tokens.pop()};g.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};g.prototype.parseText=function(){for(var a=this.token.text;"text"===this.peek().type;)a+="\n"+this.next().text;
|
||||
return this.inline.output(a)};g.prototype.tok=function(){switch(this.token.type){case "space":return"";case "hr":return this.renderer.hr();case "heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case "code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case "table":var a="",c="",e,g,y,p;y="";for(e=0;e<this.token.header.length;e++)y+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,
|
||||
align:this.token.align[e]});a+=this.renderer.tablerow(y);for(e=0;e<this.token.cells.length;e++){g=this.token.cells[e];y="";for(p=0;p<g.length;p++)y+=this.renderer.tablecell(this.inline.output(g[p]),{header:!1,align:this.token.align[p]});c+=this.renderer.tablerow(y)}return this.renderer.table(a,c);case "blockquote_start":for(c="";"blockquote_end"!==this.next().type;)c+=this.tok();return this.renderer.blockquote(c);case "list_start":c="";for(a=this.token.ordered;"list_end"!==this.next().type;)c+=this.tok();
|
||||
return this.renderer.list(c,a);case "list_item_start":for(c="";"list_item_end"!==this.next().type;)c+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(c);case "loose_item_start":for(c="";"list_item_end"!==this.next().type;)c+=this.tok();return this.renderer.listitem(c);case "html":return c=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text),this.renderer.html(c);case "paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));
|
||||
case "text":return this.renderer.paragraph(this.parseText())}};e.exec=e;D.options=D.setOptions=function(a){y(D.defaults,a);return D};D.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new a,xhtml:!1};D.Parser=g;D.parser=g.parse;D.Renderer=a;D.Lexer=sa;D.lexer=sa.lex;D.InlineLexer=ha;D.inlineLexer=ha.output;D.parse=D;"undefined"!==typeof q&&"object"===typeof k?q.exports=
|
||||
D:"function"===typeof define&&define.amd?define(function(){return D}):this.marked=D}).call(function(){return this||("undefined"!==typeof window?window:global)}());return q.exports}();q["./helpers"]=function(){var k={};(function(){var xa,sa,ha,a,g,ta,m;a=q("marked");k.starts=function(a,e,g){return e===a.substr(g,e.length)};k.ends=function(a,e,g){var c;c=e.length;return e===a.substr(a.length-c-(g||0),c)};k.repeat=ta=function(a,e){var c;for(c="";0<e;)e&1&&(c+=a),e>>>=1,a+=a;return c};k.compact=function(a){var c,
|
||||
g,m,k;k=[];c=0;for(m=a.length;c<m;c++)(g=a[c])&&k.push(g);return k};k.count=function(a,e){var c,g;c=g=0;if(!e.length)return 1/0;for(;g=1+a.indexOf(e,g);)c++;return c};k.merge=function(a,e){return sa(sa({},a),e)};sa=k.extend=function(a,e){var c,g;for(c in e)g=e[c],a[c]=g;return a};k.flatten=ha=function(a){var c,g,m,k;g=[];m=0;for(k=a.length;m<k;m++)c=a[m],"[object Array]"===Object.prototype.toString.call(c)?g=g.concat(ha(c)):g.push(c);return g};k.del=function(a,e){var c;c=a[e];delete a[e];return c};
|
||||
k.some=null!=(g=Array.prototype.some)?g:function(a){var c,g,m;g=0;for(m=this.length;g<m;g++)if(c=this[g],a(c))return!0;return!1};k.invertLiterate=function(c){var e,g,m,k,z;for(e=function(){return""+Math.random()*Date.now()};void 0===z||-1!==c.indexOf(z);)z=e();c=c.replace("\t",z);e="";k=a.lexer(c,{});c=0;for(m=k.length;c<m;c++)g=k[c],"code"===g.type&&(e+=g.text+"\n");e.replace(z,"\t");return e};xa=function(a,e){return e?{first_line:a.first_line,first_column:a.first_column,last_line:e.last_line,last_column:e.last_column}:
|
||||
a};k.addLocationDataFn=function(a,e){return function(c){"object"===typeof c&&c.updateLocationDataIfMissing&&c.updateLocationDataIfMissing(xa(a,e));return c}};k.locationDataToString=function(a){var c;"2"in a&&"first_line"in a[2]?c=a[2]:"first_line"in a&&(c=a);return c?c.first_line+1+":"+(c.first_column+1)+"-"+(c.last_line+1+":"+(c.last_column+1)):"No location data"};k.baseFileName=function(a,e,g){e=void 0===e?!1:e;a=a.split((void 0===g?0:g)?/\\|\//:/\//);a=a[a.length-1];if(!(e&&0<=a.indexOf(".")))return a;
|
||||
a=a.split(".");a.pop();"coffee"===a[a.length-1]&&1<a.length&&a.pop();return a.join(".")};k.isCoffee=function(a){return/\.((lit)?coffee|coffee\.md)$/.test(a)};k.isLiterate=function(a){return/\.(litcoffee|coffee\.md)$/.test(a)};k.throwSyntaxError=function(a,e){a=new SyntaxError(a);a.location=e;a.toString=m;a.stack=a.toString();throw a;};k.updateSyntaxError=function(a,e,g){a.toString===m&&(a.code||(a.code=e),a.filename||(a.filename=g),a.stack=a.toString());return a};m=function(){var a,e,g,m,k,z,l,E,
|
||||
A,B;if(!this.code||!this.location)return Error.prototype.toString.call(this);a=this.location;z=a.first_line;k=a.first_column;g=a.last_line;l=a.last_column;null==g&&(g=z);null==l&&(l=k);m=this.filename||"[stdin]";a=this.code.split("\n")[z];g=z===g?l+1:a.length;l=a.slice(0,k).replace(/[^\s]/g," ")+ta("^",g-k);"undefined"!==typeof process&&null!==process&&(e=(null!=(E=process.stdout)?E.isTTY:void 0)&&!(null!=(A=process.env)&&A.NODE_DISABLE_COLORS));if(null!=(B=this.colorful)?B:e)e=function(a){return"\u001b[1;31m"+
|
||||
a+"\u001b[0m"},a=a.slice(0,k)+e(a.slice(k,g))+a.slice(g),l=e(l);return m+":"+(z+1)+":"+(k+1)+": error: "+this.message+"\n"+a+"\n"+l};k.nameWhitespaceCharacter=function(a){switch(a){case " ":return"space";case "\n":return"newline";case "\r":return"carriage return";case "\t":return"tab";default:return a}}}).call(this);return k}();q["./rewriter"]=function(){var k={};(function(){var q,sa,ha,a,g,ta,m,c,e,y,D,w,z,l,E,A,B,J,p=[].indexOf||function(a){for(var c=0,e=this.length;c<e;c++)if(c in this&&this[c]===
|
||||
a)return c;return-1};l=function(a,c,e){a=[a,c];a.generated=!0;e&&(a.origin=e);return a};k.Rewriter=function(){var k=function(){};k.prototype.rewrite=function(a){this.tokens=a;this.removeLeadingNewlines();this.closeOpenCalls();this.closeOpenIndexes();this.normalizeLines();this.tagPostfixConditionals();this.addImplicitBracesAndParens();this.addLocationDataToGeneratedTokens();this.fixOutdentLocationData();return this.tokens};k.prototype.scanTokens=function(a){var c,h,e;e=this.tokens;for(c=0;h=e[c];)c+=
|
||||
a.call(this,h,c,e);return!0};k.prototype.detectEnd=function(c,e,u){var h,n,l,r,k;k=this.tokens;for(h=0;r=k[c];){if(0===h&&e.call(this,r,c))return u.call(this,r,c);if(!r||0>h)return u.call(this,r,c-1);(n=r[0],0<=p.call(g,n))?h+=1:(l=r[0],0<=p.call(a,l))&&--h;c+=1}return c-1};k.prototype.removeLeadingNewlines=function(){var a,c,e,g,l;g=this.tokens;a=c=0;for(e=g.length;c<e&&(l=g[a][0],"TERMINATOR"===l);a=++c);if(a)return this.tokens.splice(0,a)};k.prototype.closeOpenCalls=function(){var a,c;c=function(a,
|
||||
c){var h;return")"===(h=a[0])||"CALL_END"===h||"OUTDENT"===a[0]&&")"===this.tag(c-1)};a=function(a,c){return this.tokens["OUTDENT"===a[0]?c-1:c][0]="CALL_END"};return this.scanTokens(function(h,e){"CALL_START"===h[0]&&this.detectEnd(e+1,c,a);return 1})};k.prototype.closeOpenIndexes=function(){var a,c;c=function(a,c){var h;return"]"===(h=a[0])||"INDEX_END"===h};a=function(a,c){return a[0]="INDEX_END"};return this.scanTokens(function(h,e){"INDEX_START"===h[0]&&this.detectEnd(e+1,c,a);return 1})};k.prototype.indexOfTag=
|
||||
function(a,c){for(var h=[],e=1;e<arguments.length;++e)h[e-1]=arguments[e];var g,n,l,k;g=n=e=0;for(l=h.length;0<=l?n<l:n>l;g=0<=l?++n:--n){for(;"HERECOMMENT"===this.tag(a+g+e);)e+=2;if(null!=h[g]&&("string"===typeof h[g]&&(h[g]=[h[g]]),k=this.tag(a+g+e),0>p.call(h[g],k)))return-1}return a+g+e-1};k.prototype.looksObjectish=function(c){var e;if(-1<this.indexOfTag(c,"@",null,":")||-1<this.indexOfTag(c,null,":"))return!0;c=this.indexOfTag(c,g);return-1<c&&(e=null,this.detectEnd(c+1,function(c){var e;return e=
|
||||
c[0],0<=p.call(a,e)},function(a,c){return e=c}),":"===this.tag(e+1))?!0:!1};k.prototype.findTagsBackwards=function(c,e){var h,n,l,k,r,m,y;for(h=[];0<=c&&(h.length||(k=this.tag(c),0>p.call(e,k))&&((r=this.tag(c),0>p.call(g,r))||this.tokens[c].generated)&&(m=this.tag(c),0>p.call(D,m)));)(n=this.tag(c),0<=p.call(a,n))&&h.push(this.tag(c)),(l=this.tag(c),0<=p.call(g,l))&&h.length&&h.pop(),--c;return y=this.tag(c),0<=p.call(e,y)};k.prototype.addImplicitBracesAndParens=function(){var h,n;h=[];n=null;return this.scanTokens(function(u,
|
||||
t,k){var x,r,H,y,w,A,z,E,q,B,G,C,ha,F,J,S,V,K;K=u[0];B=(G=0<t?k[t-1]:[])[0];q=(t<k.length-1?k[t+1]:[])[0];J=function(){return h[h.length-1]};S=t;H=function(a){return t-S+a};y=function(){var a,c;return null!=(a=J())?null!=(c=a[2])?c.ours:void 0:void 0};w=function(){var a;return y()&&"("===(null!=(a=J())?a[0]:void 0)};z=function(){var a;return y()&&"{"===(null!=(a=J())?a[0]:void 0)};A=function(){var a;return y&&"CONTROL"===(null!=(a=J())?a[0]:void 0)};V=function(a){var c;c=null!=a?a:t;h.push(["(",c,
|
||||
{ours:!0}]);k.splice(c,0,l("CALL_START","("));if(null==a)return t+=1};x=function(){h.pop();k.splice(t,0,l("CALL_END",")",["","end of input",u[2]]));return t+=1};E=function(a,c){var e;e=null!=a?a:t;h.push(["{",e,{sameLine:!0,startsLine:void 0===c?!0:c,ours:!0}]);c=new String("{");c.generated=!0;k.splice(e,0,l("{",c,u));if(null==a)return t+=1};r=function(a){a=null!=a?a:t;h.pop();k.splice(a,0,l("}","}",u));return t+=1};if(w()&&("IF"===K||"TRY"===K||"FINALLY"===K||"CATCH"===K||"CLASS"===K||"SWITCH"===
|
||||
K))return h.push(["CONTROL",t,{ours:!0}]),H(1);if("INDENT"===K&&y()){if("\x3d\x3e"!==B&&"-\x3e"!==B&&"["!==B&&"("!==B&&","!==B&&"{"!==B&&"TRY"!==B&&"ELSE"!==B&&"\x3d"!==B)for(;w();)x();A()&&h.pop();h.push([K,t]);return H(1)}if(0<=p.call(g,K))return h.push([K,t]),H(1);if(0<=p.call(a,K)){for(;y();)w()?x():z()?r():h.pop();n=h.pop()}if((0<=p.call(c,K)&&u.spaced||"?"===K&&0<t&&!k[t-1].spaced)&&(0<=p.call(ta,q)||0<=p.call(e,q)&&(null==(C=k[t+1])||!C.spaced)&&(null==(ha=k[t+1])||!ha.newLine)))return"?"===
|
||||
K&&(K=u[0]="FUNC_EXIST"),V(t+1),H(2);if(0<=p.call(c,K)&&-1<this.indexOfTag(t+1,"INDENT")&&this.looksObjectish(t+2)&&!this.findTagsBackwards(t,"CLASS EXTENDS IF CATCH SWITCH LEADING_WHEN FOR WHILE UNTIL".split(" ")))return V(t+1),h.push(["INDENT",t+2]),H(3);if(":"===K){for(r=function(){var c;switch(!1){case c=this.tag(t-1),0>p.call(a,c):return n[1];case "@"!==this.tag(t-2):return t-2;default:return t-1}}.call(this);"HERECOMMENT"===this.tag(r-2);)r-=2;this.insideForDeclaration="FOR"===q;A=0===r||(F=
|
||||
this.tag(r-1),0<=p.call(D,F))||k[r-1].newLine;if(J()&&(z=J(),F=z[0],G=z[1],("{"===F||"INDENT"===F&&"{"===this.tag(G-1))&&(A||","===this.tag(r-1)||"{"===this.tag(r-1))))return H(1);E(r,!!A);return H(2)}z()&&0<=p.call(D,K)&&(J()[2].sameLine=!1);E="OUTDENT"===B||G.newLine;if(0<=p.call(m,K)||0<=p.call(sa,K)&&E)for(;y();)if(E=J(),F=E[0],G=E[1],F=E[2],E=F.sameLine,A=F.startsLine,w()&&","!==B)x();else if(z()&&!this.insideForDeclaration&&E&&"TERMINATOR"!==K&&":"!==B)r();else if(!z()||"TERMINATOR"!==K||","===
|
||||
B||A&&this.looksObjectish(t+1))break;else{if("HERECOMMENT"===q)return H(1);r()}if(!(","!==K||this.looksObjectish(t+1)||!z()||this.insideForDeclaration||"TERMINATOR"===q&&this.looksObjectish(t+2)))for(q="OUTDENT"===q?1:0;z();)r(t+q);return H(1)})};k.prototype.addLocationDataToGeneratedTokens=function(){return this.scanTokens(function(a,c,e){var h,g,n;if(a[2]||!a.generated&&!a.explicit)return 1;"{"===a[0]&&(h=null!=(n=e[c+1])?n[2]:void 0)?(g=h.first_line,h=h.first_column):(h=null!=(g=e[c-1])?g[2]:void 0)?
|
||||
(g=h.last_line,h=h.last_column):g=h=0;a[2]={first_line:g,first_column:h,last_line:g,last_column:h};return 1})};k.prototype.fixOutdentLocationData=function(){return this.scanTokens(function(a,c,e){if(!("OUTDENT"===a[0]||a.generated&&"CALL_END"===a[0]||a.generated&&"}"===a[0]))return 1;c=e[c-1][2];a[2]={first_line:c.last_line,first_column:c.last_column,last_line:c.last_line,last_column:c.last_column};return 1})};k.prototype.normalizeLines=function(){var a,c,e,g,l;l=e=g=null;c=function(a,c){var e,g,
|
||||
h,n;return";"!==a[1]&&(e=a[0],0<=p.call(w,e))&&!("TERMINATOR"===a[0]&&(g=this.tag(c+1),0<=p.call(ha,g)))&&!("ELSE"===a[0]&&"THEN"!==l)&&!!("CATCH"!==(h=a[0])&&"FINALLY"!==h||"-\x3e"!==l&&"\x3d\x3e"!==l)||(n=a[0],0<=p.call(sa,n))&&this.tokens[c-1].newLine};a=function(a,c){return this.tokens.splice(","===this.tag(c-1)?c-1:c,0,g)};return this.scanTokens(function(h,n,k){var t,m,u;h=h[0];if("TERMINATOR"===h){if("ELSE"===this.tag(n+1)&&"OUTDENT"!==this.tag(n-1))return k.splice.apply(k,[].concat([n,1],$jscomp.arrayFromIterable(this.indentation()))),
|
||||
1;if(t=this.tag(n+1),0<=p.call(ha,t))return k.splice(n,1),0}if("CATCH"===h)for(t=m=1;2>=m;t=++m)if("OUTDENT"===(u=this.tag(n+t))||"TERMINATOR"===u||"FINALLY"===u)return k.splice.apply(k,[].concat([n+t,0],$jscomp.arrayFromIterable(this.indentation()))),2+t;0<=p.call(z,h)&&"INDENT"!==this.tag(n+1)&&("ELSE"!==h||"IF"!==this.tag(n+1))&&(l=h,u=this.indentation(k[n]),e=u[0],g=u[1],"THEN"===l&&(e.fromThen=!0),k.splice(n+1,0,e),this.detectEnd(n+2,c,a),"THEN"===h&&k.splice(n,1));return 1})};k.prototype.tagPostfixConditionals=
|
||||
function(){var a,c,e;e=null;c=function(a,c){a=a[0];c=this.tokens[c-1][0];return"TERMINATOR"===a||"INDENT"===a&&0>p.call(z,c)};a=function(a,c){if("INDENT"!==a[0]||a.generated&&!a.fromThen)return e[0]="POST_"+e[0]};return this.scanTokens(function(h,g){if("IF"!==h[0])return 1;e=h;this.detectEnd(g+1,c,a);return 1})};k.prototype.indentation=function(a){var c,e;c=["INDENT",2];e=["OUTDENT",2];a?(c.generated=e.generated=!0,c.origin=e.origin=a):c.explicit=e.explicit=!0;return[c,e]};k.prototype.tag=function(a){var c;
|
||||
return null!=(c=this.tokens[a])?c[0]:void 0};k.prototype.generate=l;return k}();q=[["(",")"],["[","]"],["{","}"],["INDENT","OUTDENT"],["CALL_START","CALL_END"],["PARAM_START","PARAM_END"],["INDEX_START","INDEX_END"],["STRING_START","STRING_END"],["REGEX_START","REGEX_END"]];k.INVERSES=y={};g=[];a=[];E=0;for(B=q.length;E<B;E++)J=q[E],A=J[0],J=J[1],g.push(y[J]=A),a.push(y[A]=J);ha=["CATCH","THEN","ELSE","FINALLY"].concat(a);c="IDENTIFIER PROPERTY SUPER ) CALL_END ] INDEX_END @ THIS".split(" ");ta="IDENTIFIER PROPERTY NUMBER INFINITY NAN STRING STRING_START REGEX REGEX_START JS NEW PARAM_START CLASS IF TRY SWITCH THIS UNDEFINED NULL BOOL UNARY YIELD AWAIT UNARY_MATH SUPER THROW @ -\x3e \x3d\x3e [ ( { -- ++".split(" ");
|
||||
e=["+","-"];m="POST_IF FOR WHILE UNTIL WHEN BY LOOP TERMINATOR".split(" ");z="ELSE -\x3e \x3d\x3e TRY FINALLY THEN".split(" ");w="TERMINATOR CATCH FINALLY ELSE OUTDENT LEADING_WHEN".split(" ");D=["TERMINATOR","INDENT","OUTDENT"];sa=[".","?.","::","?::"]}).call(this);return k}();q["./lexer"]=function(){var k={};(function(){var xa,sa,ha,a,g,ta,m,c,e,y,D,w,z,l,E,A,B,J,p,ra,h,n,u,t,H,x,r,W,T,Q,R,M,U,O,P,G,C,Z,F,ca,S,V,K,aa,ba,Y,X,ua,Na,za,la,ma,I,ja,da,oa,ia,ka,pa,ea=[].indexOf||function(a){for(var c=
|
||||
0,e=this.length;c<e;c++)if(c in this&&this[c]===a)return c;return-1};ia=q("./rewriter");Z=ia.Rewriter;h=ia.INVERSES;ia=q("./helpers");ma=ia.count;ka=ia.repeat;I=ia.invertLiterate;pa=ia.throwSyntaxError;var N=function(){};N.prototype.tokenize=function(a,c){c=void 0===c?{}:c;var e,g,h,qa;this.literate=c.literate;this.outdebt=this.indebt=this.baseIndent=this.indent=0;this.indents=[];this.indentLiteral="";this.ends=[];this.tokens=[];this.exportSpecifierList=this.seenExport=this.seenImport=this.seenFor=
|
||||
!1;this.chunkLine=c.line||0;this.chunkColumn=c.column||0;a=this.clean(a);for(h=0;this.chunk=a.slice(h);)if(e=this.identifierToken()||this.commentToken()||this.whitespaceToken()||this.lineToken()||this.stringToken()||this.numberToken()||this.regexToken()||this.jsToken()||this.literalToken(),qa=this.getLineAndColumnFromChunk(e),this.chunkLine=qa[0],this.chunkColumn=qa[1],h+=e,c.untilBalanced&&0===this.ends.length)return{tokens:this.tokens,index:h};this.closeIndentation();(g=this.ends.pop())&&this.error("missing "+
|
||||
g.tag,g.origin[2]);return!1===c.rewrite?this.tokens:(new Z).rewrite(this.tokens)};N.prototype.clean=function(a){a.charCodeAt(0)===xa&&(a=a.slice(1));a=a.replace(/\r/g,"").replace(X,"");la.test(a)&&(a="\n"+a,this.chunkLine--);this.literate&&(a=I(a));return a};N.prototype.identifierToken=function(){var c,e,h,l,n,k,p,m,t,r,x;if(!(e=B.exec(this.chunk)))return 0;n=e[0];h=e[1];e=e[2];l=h.length;k=void 0;if("own"===h&&"FOR"===this.tag())return this.token("OWN",h),h.length;if("from"===h&&"YIELD"===this.tag())return this.token("FROM",
|
||||
h),h.length;if("as"===h&&this.seenImport){if("*"===this.value())this.tokens[this.tokens.length-1][0]="IMPORT_ALL";else if(p=this.value(),0<=ea.call(ta,p))this.tokens[this.tokens.length-1][0]="IDENTIFIER";if("DEFAULT"===(m=this.tag())||"IMPORT_ALL"===m||"IDENTIFIER"===m)return this.token("AS",h),h.length}if("as"===h&&this.seenExport&&"IDENTIFIER"===this.tag())return this.token("AS",h),h.length;if("default"===h&&this.seenExport)return this.token("DEFAULT",h),h.length;p=this.tokens;p=p[p.length-1];x=
|
||||
e||null!=p&&("."===(t=p[0])||"?."===t||"::"===t||"?::"===t||!p.spaced&&"@"===p[0])?"PROPERTY":"IDENTIFIER";"IDENTIFIER"!==x||!(0<=ea.call(u,h)||0<=ea.call(ta,h))||this.exportSpecifierList&&0<=ea.call(ta,h)?"IDENTIFIER"===x&&this.seenFor&&"from"===h&&ja(p)&&(x="FORFROM",this.seenFor=!1):(x=h.toUpperCase(),"WHEN"===x&&(r=this.tag(),0<=ea.call(H,r))?x="LEADING_WHEN":"FOR"===x?this.seenFor=!0:"UNLESS"===x?x="IF":"IMPORT"===x?this.seenImport=!0:"EXPORT"===x?this.seenExport=!0:0<=ea.call(ua,x)?x="UNARY":
|
||||
0<=ea.call(G,x)&&("INSTANCEOF"!==x&&this.seenFor?(x="FOR"+x,this.seenFor=!1):(x="RELATION","!"===this.value()&&(k=this.tokens.pop(),h="!"+h))));"IDENTIFIER"===x&&0<=ea.call(C,h)&&this.error("reserved word '"+h+"'",{length:h.length});"PROPERTY"!==x&&(0<=ea.call(a,h)&&(c=h,h=g[h]),x=function(){switch(h){case "!":return"UNARY";case "\x3d\x3d":case "!\x3d":return"COMPARE";case "true":case "false":return"BOOL";case "break":case "continue":case "debugger":return"STATEMENT";case "\x26\x26":case "||":return h;
|
||||
default:return x}}());t=this.token(x,h,0,l);c&&(t.origin=[x,c,t[2]]);k&&(c=[k[2].first_line,k[2].first_column],t[2].first_line=c[0],t[2].first_column=c[1]);e&&(c=n.lastIndexOf(":"),this.token(":",":",c,e.length));return n.length};N.prototype.numberToken=function(){var a,c,e;if(!(c=Q.exec(this.chunk)))return 0;e=c[0];c=e.length;switch(!1){case !/^0[BOX]/.test(e):this.error("radix prefix in '"+e+"' must be lowercase",{offset:1});break;case !/^(?!0x).*E/.test(e):this.error("exponential notation in '"+
|
||||
e+"' must be indicated with a lowercase 'e'",{offset:e.indexOf("E")});break;case !/^0\d*[89]/.test(e):this.error("decimal literal '"+e+"' must not be prefixed with '0'",{length:c});break;case !/^0\d+/.test(e):this.error("octal literal '"+e+"' must be prefixed with '0o'",{length:c})}a=function(){switch(e.charAt(1)){case "b":return 2;case "o":return 8;case "x":return 16;default:return null}}();a=null!=a?parseInt(e.slice(2),a):parseFloat(e);this.token(Infinity===a?"INFINITY":"NUMBER",e,0,c);return c};
|
||||
N.prototype.stringToken=function(){var a=this,c,e,h,g,l,n,k,p,m,u,x,r;m=(ba.exec(this.chunk)||[])[0];if(!m)return 0;this.tokens.length&&"from"===this.value()&&(this.seenImport||this.seenExport)&&(this.tokens[this.tokens.length-1][0]="FROM");h=function(){switch(m){case "'":return aa;case '"':return V;case "'''":return z;case '"""':return D}}();g=3===m.length;h=this.matchWithInterpolations(h,m);r=h.tokens;l=h.index;c=r.length-1;h=m.charAt(0);if(g){k=null;for(g=function(){var a,c,e;e=[];n=a=0;for(c=
|
||||
r.length;a<c;n=++a)x=r[n],"NEOSTRING"===x[0]&&e.push(x[1]);return e}().join("#{}");e=w.exec(g);)if(e=e[1],null===k||0<(u=e.length)&&u<k.length)k=e;k&&(p=RegExp("\\n"+k,"g"));this.mergeInterpolationTokens(r,{delimiter:h},function(e,h){e=a.formatString(e);p&&(e=e.replace(p,"\n"));0===h&&(e=e.replace(t,""));h===c&&(e=e.replace(Y,""));return e})}else this.mergeInterpolationTokens(r,{delimiter:h},function(e,h){e=a.formatString(e);return e=e.replace(ca,function(a,g){return 0===h&&0===g||h===c&&g+a.length===
|
||||
e.length?"":" "})});return l};N.prototype.commentToken=function(){var a,c,e;if(!(e=this.chunk.match(m)))return 0;a=e[0];if(c=e[1])(e=y.exec(a))&&this.error("block comments cannot contain "+e[0],{offset:e.index,length:e[0].length}),0<=c.indexOf("\n")&&(c=c.replace(RegExp("\\n"+ka(" ",this.indent),"g"),"\n")),this.token("HERECOMMENT",c,0,a.length);return a.length};N.prototype.jsToken=function(){var a,c;if("`"!==this.chunk.charAt(0)||!(a=A.exec(this.chunk)||n.exec(this.chunk)))return 0;c=a[1].replace(/\\+(`|$)/g,
|
||||
function(a){return a.slice(-Math.ceil(a.length/2))});this.token("JS",c,0,a[0].length);return a[0].length};N.prototype.regexToken=function(){var a,c,e,h,g,n,k,p;switch(!1){case !(c=P.exec(this.chunk)):this.error("regular expressions cannot begin with "+c[2],{offset:c.index+c[1].length});break;case !(c=this.matchWithInterpolations(l,"///")):p=c.tokens;g=c.index;break;case !(c=U.exec(this.chunk)):k=c[0];a=c[1];c=c[2];this.validateEscapes(a,{isRegex:!0,offsetInChunk:1});g=k.length;n=this.tokens;if(n=
|
||||
n[n.length-1])if(n.spaced&&(e=n[0],0<=ea.call(sa,e))){if(!c||M.test(k))return 0}else if(h=n[0],0<=ea.call(T,h))return 0;c||this.error("missing / (unclosed regex)");break;default:return 0}h=O.exec(this.chunk.slice(g))[0];e=g+h.length;c=this.makeToken("REGEX",null,0,e);switch(!1){case !!za.test(h):this.error("invalid regular expression flags "+h,{offset:g,length:h.length});break;case !(k||1===p.length):null==a&&(a=this.formatHeregex(p[0][1]));this.token("REGEX",""+this.makeDelimitedLiteral(a,{delimiter:"/"})+
|
||||
h,0,e,c);break;default:this.token("REGEX_START","(",0,0,c),this.token("IDENTIFIER","RegExp",0,0),this.token("CALL_START","(",0,0),this.mergeInterpolationTokens(p,{delimiter:'"',double:!0},this.formatHeregex),h&&(this.token(",",",",g-1,0),this.token("STRING",'"'+h+'"',g-1,h.length)),this.token(")",")",e-1,0),this.token("REGEX_END",")",e-1,0)}return e};N.prototype.lineToken=function(){var a,c,e,h,g;if(!(c=W.exec(this.chunk)))return 0;c=c[0];this.seenFor=!1;g=c.length-1-c.lastIndexOf("\n");h=this.unfinished();
|
||||
e=0<g?c.slice(-g):"";if(!/^(.?)\1*$/.exec(e))return this.error("mixed indentation",{offset:c.length}),c.length;a=Math.min(e.length,this.indentLiteral.length);if(e.slice(0,a)!==this.indentLiteral.slice(0,a))return this.error("indentation mismatch",{offset:c.length}),c.length;if(g-this.indebt===this.indent)return h?this.suppressNewlines():this.newlineToken(0),c.length;if(g>this.indent){if(h)return this.indebt=g-this.indent,this.suppressNewlines(),c.length;if(!this.tokens.length)return this.baseIndent=
|
||||
this.indent=g,this.indentLiteral=e,c.length;a=g-this.indent+this.outdebt;this.token("INDENT",a,c.length-g,g);this.indents.push(a);this.ends.push({tag:"OUTDENT"});this.outdebt=this.indebt=0;this.indent=g;this.indentLiteral=e}else g<this.baseIndent?this.error("missing indentation",{offset:c.length}):(this.indebt=0,this.outdentToken(this.indent-g,h,c.length));return c.length};N.prototype.outdentToken=function(a,c,e){var h,g,n,l;for(h=this.indent-a;0<a;)(n=this.indents[this.indents.length-1])?n===this.outdebt?
|
||||
(a-=this.outdebt,this.outdebt=0):n<this.outdebt?(this.outdebt-=n,a-=n):(g=this.indents.pop()+this.outdebt,e&&(l=this.chunk[e],0<=ea.call(J,l))&&(h-=g-a,a=g),this.outdebt=0,this.pair("OUTDENT"),this.token("OUTDENT",a,0,e),a-=g):a=0;g&&(this.outdebt-=a);for(;";"===this.value();)this.tokens.pop();"TERMINATOR"===this.tag()||c||this.token("TERMINATOR","\n",e,0);this.indent=h;this.indentLiteral=this.indentLiteral.slice(0,h);return this};N.prototype.whitespaceToken=function(){var a,c;if(!(a=la.exec(this.chunk))&&
|
||||
"\n"!==this.chunk.charAt(0))return 0;c=this.tokens;(c=c[c.length-1])&&(c[a?"spaced":"newLine"]=!0);return a?a[0].length:0};N.prototype.newlineToken=function(a){for(;";"===this.value();)this.tokens.pop();"TERMINATOR"!==this.tag()&&this.token("TERMINATOR","\n",a,0);return this};N.prototype.suppressNewlines=function(){"\\"===this.value()&&this.tokens.pop();return this};N.prototype.literalToken=function(){var a,g,n,l,k,m,t,u;(a=R.exec(this.chunk))?(a=a[0],ha.test(a)&&this.tagParameters()):a=this.chunk.charAt(0);
|
||||
u=a;l=this.tokens;if((l=l[l.length-1])&&0<=ea.call([].concat(["\x3d"],$jscomp.arrayFromIterable(e)),a)&&(t=!1,"\x3d"!==a||"||"!==(n=l[1])&&"\x26\x26"!==n||l.spaced||(l[0]="COMPOUND_ASSIGN",l[1]+="\x3d",l=this.tokens[this.tokens.length-2],t=!0),l&&"PROPERTY"!==l[0]&&(n=null!=(g=l.origin)?g:l,(g=da(l[1],n[1]))&&this.error(g,n[2])),t))return a.length;"{"===a&&"EXPORT"===(null!=l?l[0]:void 0)?this.exportSpecifierList=!0:this.exportSpecifierList&&"}"===a&&(this.exportSpecifierList=!1);if(";"===a)this.seenFor=
|
||||
this.seenImport=this.seenExport=!1,u="TERMINATOR";else if("*"===a&&"EXPORT"===l[0])u="EXPORT_ALL";else if(0<=ea.call(r,a))u="MATH";else if(0<=ea.call(c,a))u="COMPARE";else if(0<=ea.call(e,a))u="COMPOUND_ASSIGN";else if(0<=ea.call(ua,a))u="UNARY";else if(0<=ea.call(Na,a))u="UNARY_MATH";else if(0<=ea.call(F,a))u="SHIFT";else if("?"===a&&null!=l&&l.spaced)u="BIN?";else if(l&&!l.spaced)if("("===a&&(k=l[0],0<=ea.call(sa,k)))"?"===l[0]&&(l[0]="FUNC_EXIST"),u="CALL_START";else if("["===a&&(m=l[0],0<=ea.call(p,
|
||||
m)))switch(u="INDEX_START",l[0]){case "?":l[0]="INDEX_SOAK"}k=this.makeToken(u,a);switch(a){case "(":case "{":case "[":this.ends.push({tag:h[a],origin:k});break;case ")":case "}":case "]":this.pair(a)}this.tokens.push(k);return a.length};N.prototype.tagParameters=function(){var a,c,e,h;if(")"!==this.tag())return this;c=[];h=this.tokens;a=h.length;for(h[--a][0]="PARAM_END";e=h[--a];)switch(e[0]){case ")":c.push(e);break;case "(":case "CALL_START":if(c.length)c.pop();else return"("===e[0]&&(e[0]="PARAM_START"),
|
||||
this}return this};N.prototype.closeIndentation=function(){return this.outdentToken(this.indent)};N.prototype.matchWithInterpolations=function(a,c){var e,h,g,l,n,k,p,m;m=[];n=c.length;if(this.chunk.slice(0,n)!==c)return null;for(p=this.chunk.slice(n);;){l=a.exec(p)[0];this.validateEscapes(l,{isRegex:"/"===c.charAt(0),offsetInChunk:n});m.push(this.makeToken("NEOSTRING",l,n));p=p.slice(l.length);n+=l.length;if("#{"!==p.slice(0,2))break;e=this.getLineAndColumnFromChunk(n+1);l=e[0];e=e[1];e=(new N).tokenize(p.slice(1),
|
||||
{line:l,column:e,untilBalanced:!0});l=e.tokens;h=e.index;h+=1;k=l[0];e=l[l.length-1];k[0]=k[1]="(";e[0]=e[1]=")";e.origin=["","end of interpolation",e[2]];"TERMINATOR"===(null!=(g=l[1])?g[0]:void 0)&&l.splice(1,1);m.push(["TOKENS",l]);p=p.slice(h);n+=h}p.slice(0,c.length)!==c&&this.error("missing "+c,{length:c.length});a=m[0];g=m[m.length-1];a[2].first_column-=c.length;"\n"===g[1].substr(-1)?(g[2].last_line+=1,g[2].last_column=c.length-1):g[2].last_column+=c.length;0===g[1].length&&--g[2].last_column;
|
||||
return{tokens:m,index:n+c.length}};N.prototype.mergeInterpolationTokens=function(a,c,e){var h,g,l,n,k,p,m,t,u,x,r;1<a.length&&(t=this.token("STRING_START","(",0,0));l=this.tokens.length;n=k=0;for(p=a.length;k<p;n=++k){u=a[n];h=u[0];r=u[1];switch(h){case "TOKENS":if(2===r.length)continue;m=r[0];x=r;break;case "NEOSTRING":h=e(u[1],n);if(0===h.length)if(0===n)g=this.tokens.length;else continue;2===n&&null!=g&&this.tokens.splice(g,2);u[0]="STRING";u[1]=this.makeDelimitedLiteral(h,c);m=u;x=[u]}this.tokens.length>
|
||||
l&&(n=this.token("+","+"),n[2]={first_line:m[2].first_line,first_column:m[2].first_column,last_line:m[2].first_line,last_column:m[2].first_column});this.tokens.push.apply(this.tokens,[].concat($jscomp.arrayFromIterable(x)))}if(t)return a=a[a.length-1],t.origin=["STRING",null,{first_line:t[2].first_line,first_column:t[2].first_column,last_line:a[2].last_line,last_column:a[2].last_column}],t=this.token("STRING_END",")"),t[2]={first_line:a[2].last_line,first_column:a[2].last_column,last_line:a[2].last_line,
|
||||
last_column:a[2].last_column}};N.prototype.pair=function(a){var c;c=this.ends;c=c[c.length-1];return a!==(c=null!=c?c.tag:void 0)?("OUTDENT"!==c&&this.error("unmatched "+a),c=this.indents,c=c[c.length-1],this.outdentToken(c,!0),this.pair(a)):this.ends.pop()};N.prototype.getLineAndColumnFromChunk=function(a){var c,e;if(0===a)return[this.chunkLine,this.chunkColumn];e=a>=this.chunk.length?this.chunk:this.chunk.slice(0,+(a-1)+1||9E9);a=ma(e,"\n");c=this.chunkColumn;0<a?(c=e.split("\n"),c=c[c.length-1],
|
||||
c=c.length):c+=e.length;return[this.chunkLine+a,c]};N.prototype.makeToken=function(a,c,e,h){e=void 0===e?0:e;h=void 0===h?c.length:h;var g,l;g={};l=this.getLineAndColumnFromChunk(e);g.first_line=l[0];g.first_column=l[1];e=this.getLineAndColumnFromChunk(e+(0<h?h-1:0));g.last_line=e[0];g.last_column=e[1];return[a,c,g]};N.prototype.token=function(a,c,e,h,g){a=this.makeToken(a,c,e,h);g&&(a.origin=g);this.tokens.push(a);return a};N.prototype.tag=function(){var a;a=this.tokens;a=a[a.length-1];return null!=
|
||||
a?a[0]:void 0};N.prototype.value=function(){var a;a=this.tokens;a=a[a.length-1];return null!=a?a[1]:void 0};N.prototype.unfinished=function(){var a;return x.test(this.chunk)||"\\"===(a=this.tag())||"."===a||"?."===a||"?::"===a||"UNARY"===a||"MATH"===a||"UNARY_MATH"===a||"+"===a||"-"===a||"**"===a||"SHIFT"===a||"RELATION"===a||"COMPARE"===a||"\x26"===a||"^"===a||"|"===a||"\x26\x26"===a||"||"===a||"BIN?"===a||"THROW"===a||"EXTENDS"===a};N.prototype.formatString=function(a){return a.replace(K,"$1")};
|
||||
N.prototype.formatHeregex=function(a){return a.replace(E,"$1$2")};N.prototype.validateEscapes=function(a,c){c=void 0===c?{}:c;var e,h,g,l,n;if(h=ra.exec(a))if(h[0],a=h[1],g=h[2],e=h[3],n=h[4],!c.isRegex||!g||"0"===g.charAt(0))return e="\\"+(g||e||n),this.error((g?"octal escape sequences are not allowed":"invalid escape sequence")+" "+e,{offset:(null!=(l=c.offsetInChunk)?l:0)+h.index+a.length,length:e.length})};N.prototype.makeDelimitedLiteral=function(a,c){c=void 0===c?{}:c;""===a&&"/"===c.delimiter&&
|
||||
(a="(?:)");a=a.replace(RegExp("(\\\\\\\\)|(\\\\0(?\x3d[1-7]))|\\\\?("+c.delimiter+")|\\\\?(?:(\\n)|(\\r)|(\\u2028)|(\\u2029))|(\\\\.)","g"),function(a,e,h,g,l,n,k,p,m){switch(!1){case !e:return c.double?e+e:e;case !h:return"\\x00";case !g:return"\\"+g;case !l:return"\\n";case !n:return"\\r";case !k:return"\\u2028";case !p:return"\\u2029";case !m:return c.double?"\\"+m:m}});return""+c.delimiter+a+c.delimiter};N.prototype.error=function(a,c){c=void 0===c?{}:c;var e,h,g,l,n;c="first_line"in c?c:(l=this.getLineAndColumnFromChunk(null!=
|
||||
(g=c.offset)?g:0),h=l[0],e=l[1],l,{first_line:h,first_column:e,last_column:e+(null!=(n=c.length)?n:1)-1});return pa(a,c)};k.Lexer=N;da=function(a,c){c=void 0===c?a:c;switch(!1){case 0>ea.call([].concat($jscomp.arrayFromIterable(u),$jscomp.arrayFromIterable(ta)),a):return"keyword '"+c+"' can't be assigned";case 0>ea.call(S,a):return"'"+c+"' can't be assigned";case 0>ea.call(C,a):return"reserved word '"+c+"' can't be assigned";default:return!1}};k.isUnassignable=da;ja=function(a){var c;return"IDENTIFIER"===
|
||||
a[0]?("from"===a[1]&&(a[1][0]="IDENTIFIER",!0),!0):"FOR"===a[0]?!1:"{"===(c=a[1])||"["===c||","===c||":"===c?!1:!0};u="true false null this new delete typeof in instanceof return throw break continue debugger yield await if else switch for while do try catch finally class extends super import export default".split(" ");ta="undefined Infinity NaN then unless until loop of by when".split(" ");g={and:"\x26\x26",or:"||",is:"\x3d\x3d",isnt:"!\x3d",not:"!",yes:"true",no:"false",on:"true",off:"false"};a=
|
||||
function(){var a;a=[];for(oa in g)a.push(oa);return a}();ta=ta.concat(a);C="case function var void with const let enum native implements interface package private protected public static".split(" ");S=["arguments","eval"];k.JS_FORBIDDEN=u.concat(C).concat(S);xa=65279;B=/^(?!\d)((?:(?!\s)[$\w\x7f-\uffff])+)([^\n\S]*:(?!:))?/;Q=/^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i;R=/^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>*\/%])\2=?|\?(\.|::)|\.{2,3})/;la=/^[^\n\S]+/;m=/^###([^#][\s\S]*?)(?:###[^\n\S]*|###$)|^(?:\s*#(?!##[^#]).*)+/;
|
||||
ha=/^[-=]>/;W=/^(?:\n[^\n\S]*)+/;n=/^`(?!``)((?:[^`\\]|\\[\s\S])*)`/;A=/^```((?:[^`\\]|\\[\s\S]|`(?!``))*)```/;ba=/^(?:'''|"""|'|")/;aa=/^(?:[^\\']|\\[\s\S])*/;V=/^(?:[^\\"#]|\\[\s\S]|\#(?!\{))*/;z=/^(?:[^\\']|\\[\s\S]|'(?!''))*/;D=/^(?:[^\\"#]|\\[\s\S]|"(?!"")|\#(?!\{))*/;K=/((?:\\\\)+)|\\[^\S\n]*\n\s*/g;ca=/\s*\n\s*/g;w=/\n+([^\n\S]*)(?=\S)/g;U=/^\/(?!\/)((?:[^[\/\n\\]|\\[^\n]|\[(?:\\[^\n]|[^\]\n\\])*\])*)(\/)?/;O=/^\w*/;za=/^(?!.*(.).*\1)[imgy]*$/;l=/^(?:[^\\\/#]|\\[\s\S]|\/(?!\/\/)|\#(?!\{))*/;
|
||||
E=/((?:\\\\)+)|\\(\s)|\s+(?:#.*)?/g;P=/^(\/|\/{3}\s*)(\*)/;M=/^\/=?\s/;y=/\*\//;x=/^\s*(?:,|\??\.(?![.\d])|::)/;ra=/((?:^|[^\\])(?:\\\\)*)\\(?:(0[0-7]|[1-7])|(x(?![\da-fA-F]{2}).{0,2})|(u(?![\da-fA-F]{4}).{0,4}))/;t=/^[^\n\S]*\n/;Y=/\n[^\n\S]*$/;X=/\s+$/;e="-\x3d +\x3d /\x3d *\x3d %\x3d ||\x3d \x26\x26\x3d ?\x3d \x3c\x3c\x3d \x3e\x3e\x3d \x3e\x3e\x3e\x3d \x26\x3d ^\x3d |\x3d **\x3d //\x3d %%\x3d".split(" ");ua=["NEW","TYPEOF","DELETE","DO"];Na=["!","~"];F=["\x3c\x3c","\x3e\x3e","\x3e\x3e\x3e"];c=
|
||||
"\x3d\x3d !\x3d \x3c \x3e \x3c\x3d \x3e\x3d".split(" ");r=["*","/","%","//","%%"];G=["IN","OF","INSTANCEOF"];sa="IDENTIFIER PROPERTY ) ] ? @ THIS SUPER".split(" ");p=sa.concat("NUMBER INFINITY NAN STRING STRING_END REGEX REGEX_END BOOL NULL UNDEFINED } ::".split(" "));T=p.concat(["++","--"]);H=["INDENT","OUTDENT","TERMINATOR"];J=[")","}","]"]}).call(this);return k}();q["./parser"]=function(){var k={},xa={exports:k},sa=function(){function k(){this.yy={}}var a=function(a,v,L,d){L=L||{};for(d=a.length;d--;L[a[d]]=
|
||||
v);return L},g=[1,22],q=[1,52],m=[1,86],c=[1,82],e=[1,87],y=[1,88],D=[1,84],w=[1,85],z=[1,60],l=[1,62],E=[1,63],A=[1,64],B=[1,65],J=[1,66],p=[1,53],sa=[1,40],h=[1,54],n=[1,34],u=[1,71],t=[1,72],H=[1,33],x=[1,81],r=[1,50],W=[1,55],T=[1,56],Q=[1,69],R=[1,70],M=[1,68],U=[1,45],O=[1,51],P=[1,67],G=[1,76],C=[1,77],Z=[1,78],F=[1,79],ca=[1,49],S=[1,75],V=[1,36],K=[1,37],aa=[1,38],ba=[1,39],Y=[1,41],X=[1,42],xa=[1,89],ua=[1,6,34,44,134],za=[1,104],la=[1,92],ma=[1,91],I=[1,90],ja=[1,93],da=[1,94],oa=[1,95],
|
||||
ia=[1,96],ka=[1,97],pa=[1,98],ea=[1,99],N=[1,100],qa=[1,101],va=[1,102],na=[1,103],ra=[1,107],wa=[1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,162,163,166,167,168,169,170,171,172,173,174,175,176,177],Qa=[2,170],Xa=[1,113],Ha=[1,118],Ya=[1,114],cb=[1,115],Ra=[1,116],Ia=[1,119],Fa=[1,112],Ea=[1,6,34,44,134,136,138,142,159],Ba=[1,6,33,34,42,43,44,68,73,76,87,88,89,90,91,92,95,99,116,117,118,123,125,134,136,137,138,142,143,159,162,163,166,167,168,169,170,171,172,173,174,175,176,
|
||||
177],Sa=[2,98],Ta=[2,77],db=[1,129],Ja=[1,134],Ma=[1,135],Ca=[1,137],ga=[1,141],fa=[1,139],Ua=[1,6,33,34,42,43,44,57,68,73,76,87,88,89,90,91,92,95,99,116,117,118,123,125,134,136,137,138,142,143,159,162,163,166,167,168,169,170,171,172,173,174,175,176,177],ya=[2,95],gb=[1,6,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,162,163,166,167,168,169,170,171,172,173,174,175,176,177],eb=[2,29],fb=[1,167],Oa=[2,65],hb=[1,175],Za=[1,187],Ga=[1,189],mb=[1,184],La=[1,191],Ka=[1,6,33,34,42,43,44,57,
|
||||
68,73,76,87,88,89,90,91,92,95,99,101,116,117,118,123,125,134,136,137,138,142,143,159,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178],nb=[2,117],ob=[1,6,33,34,42,43,44,60,68,73,76,87,88,89,90,91,92,95,99,116,117,118,123,125,134,136,137,138,142,143,159,162,163,166,167,168,169,170,171,172,173,174,175,176,177],Va=[1,6,33,34,42,43,44,48,60,68,73,76,87,88,89,90,91,92,95,99,116,117,118,123,125,134,136,137,138,142,143,159,162,163,166,167,168,169,170,171,172,173,174,175,176,177],ib=[1,
|
||||
239],pb=[42,43,117],qb=[1,249],b=[1,248],v=[2,75],L=[1,259],d=[6,33,34,68,73],f=[6,33,34,57,68,73,76],Wa=[1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,162,163,167,168,169,170,171,172,173,174,175,176,177],Da=[1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,162,163,167,169,170,171,172,173,174,175,176,177],rb=[42,43,87,88,90,91,92,95,116,117],vb=[1,279],Pa=[1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159],$a=[2,64],wb=[1,291],jb=[1,293],
|
||||
Hb=[1,298],sb=[1,300],Sb=[2,191],Ib=[1,6,33,34,42,43,44,57,68,73,76,87,88,89,90,91,92,95,99,116,117,118,123,125,134,136,137,138,142,143,149,150,151,159,162,163,166,167,168,169,170,171,172,173,174,175,176,177],xb=[1,309],ab=[6,33,34,73,118,123],Tb=[1,6,33,34,42,43,44,57,60,68,73,76,87,88,89,90,91,92,95,99,101,116,117,118,123,125,134,136,137,138,142,143,149,150,151,159,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178],Ub=[1,6,33,34,44,68,73,76,89,99,118,123,125,134,143,159],kb=[1,
|
||||
6,33,34,44,68,73,76,89,99,118,123,125,134,137,143,159],yb=[149,150,151],zb=[73,149,150,151],Ab=[6,33,99],Vb=[1,321],Aa=[6,33,34,73,99],Wb=[6,33,34,60,73,99],Jb=[6,33,34,57,60,73,99],Xb=[1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,162,163,169,170,171,172,173,174,175,176,177],lb=[1,6,33,34,44,48,68,73,76,87,88,89,90,91,92,95,99,116,117,118,123,125,134,136,137,138,142,143,159,162,163,166,167,168,169,170,171,172,173,174,175,176,177],Yb=[14,30,36,40,42,43,46,47,50,51,52,53,54,55,
|
||||
63,64,65,66,70,71,86,89,97,100,102,110,120,121,122,128,132,133,136,138,140,142,152,158,160,161,162,163,164,165],Zb=[2,180],bb=[6,33,34],tb=[2,76],$b=[1,336],ac=[1,337],bc=[1,6,33,34,44,68,73,76,89,99,118,123,125,130,131,134,136,137,138,142,143,154,156,159,162,163,166,167,168,169,170,171,172,173,174,175,176,177],Bb=[34,154,156],cc=[1,6,34,44,68,73,76,89,99,118,123,125,134,137,143,159],Cb=[1,363],Kb=[1,369],Lb=[1,6,34,44,134,159],ub=[2,90],Db=[1,379],Eb=[1,380],dc=[1,6,33,34,44,68,73,76,89,99,118,123,
|
||||
125,134,136,137,138,142,143,154,159,162,163,166,167,168,169,170,171,172,173,174,175,176,177],Mb=[1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,138,142,143,159],ec=[1,392],fc=[1,393],Nb=[6,33,34,99],gc=[6,33,34,73],Ob=[1,6,33,34,44,68,73,76,89,99,118,123,125,130,134,136,137,138,142,143,159,162,163,166,167,168,169,170,171,172,173,174,175,176,177],hc=[33,73],Fb=[1,420],Gb=[1,421],Pb=[1,427],Qb=[1,428],ic={trace:function(){},yy:{},symbols_:{error:2,Root:3,Body:4,Line:5,TERMINATOR:6,Expression:7,Statement:8,
|
||||
FuncDirective:9,YieldReturn:10,AwaitReturn:11,Return:12,Comment:13,STATEMENT:14,Import:15,Export:16,Value:17,Invocation:18,Code:19,Operation:20,Assign:21,If:22,Try:23,While:24,For:25,Switch:26,Class:27,Throw:28,Yield:29,YIELD:30,FROM:31,Block:32,INDENT:33,OUTDENT:34,Identifier:35,IDENTIFIER:36,Property:37,PROPERTY:38,AlphaNumeric:39,NUMBER:40,String:41,STRING:42,STRING_START:43,STRING_END:44,Regex:45,REGEX:46,REGEX_START:47,REGEX_END:48,Literal:49,JS:50,UNDEFINED:51,NULL:52,BOOL:53,INFINITY:54,NAN:55,
|
||||
Assignable:56,"\x3d":57,AssignObj:58,ObjAssignable:59,":":60,SimpleObjAssignable:61,ThisProperty:62,RETURN:63,AWAIT:64,HERECOMMENT:65,PARAM_START:66,ParamList:67,PARAM_END:68,FuncGlyph:69,"-\x3e":70,"\x3d\x3e":71,OptComma:72,",":73,Param:74,ParamVar:75,"...":76,Array:77,Object:78,Splat:79,SimpleAssignable:80,Accessor:81,Parenthetical:82,Range:83,This:84,Super:85,SUPER:86,".":87,INDEX_START:88,INDEX_END:89,"?.":90,"::":91,"?::":92,Index:93,IndexValue:94,INDEX_SOAK:95,Slice:96,"{":97,AssignList:98,
|
||||
"}":99,CLASS:100,EXTENDS:101,IMPORT:102,ImportDefaultSpecifier:103,ImportNamespaceSpecifier:104,ImportSpecifierList:105,ImportSpecifier:106,AS:107,DEFAULT:108,IMPORT_ALL:109,EXPORT:110,ExportSpecifierList:111,EXPORT_ALL:112,ExportSpecifier:113,OptFuncExist:114,Arguments:115,FUNC_EXIST:116,CALL_START:117,CALL_END:118,ArgList:119,THIS:120,"@":121,"[":122,"]":123,RangeDots:124,"..":125,Arg:126,SimpleArgs:127,TRY:128,Catch:129,FINALLY:130,CATCH:131,THROW:132,"(":133,")":134,WhileSource:135,WHILE:136,
|
||||
WHEN:137,UNTIL:138,Loop:139,LOOP:140,ForBody:141,FOR:142,BY:143,ForStart:144,ForSource:145,ForVariables:146,OWN:147,ForValue:148,FORIN:149,FOROF:150,FORFROM:151,SWITCH:152,Whens:153,ELSE:154,When:155,LEADING_WHEN:156,IfBlock:157,IF:158,POST_IF:159,UNARY:160,UNARY_MATH:161,"-":162,"+":163,"--":164,"++":165,"?":166,MATH:167,"**":168,SHIFT:169,COMPARE:170,"\x26":171,"^":172,"|":173,"\x26\x26":174,"||":175,"BIN?":176,RELATION:177,COMPOUND_ASSIGN:178,$accept:0,$end:1},terminals_:{2:"error",6:"TERMINATOR",
|
||||
14:"STATEMENT",30:"YIELD",31:"FROM",33:"INDENT",34:"OUTDENT",36:"IDENTIFIER",38:"PROPERTY",40:"NUMBER",42:"STRING",43:"STRING_START",44:"STRING_END",46:"REGEX",47:"REGEX_START",48:"REGEX_END",50:"JS",51:"UNDEFINED",52:"NULL",53:"BOOL",54:"INFINITY",55:"NAN",57:"\x3d",60:":",63:"RETURN",64:"AWAIT",65:"HERECOMMENT",66:"PARAM_START",68:"PARAM_END",70:"-\x3e",71:"\x3d\x3e",73:",",76:"...",86:"SUPER",87:".",88:"INDEX_START",89:"INDEX_END",90:"?.",91:"::",92:"?::",95:"INDEX_SOAK",97:"{",99:"}",100:"CLASS",
|
||||
101:"EXTENDS",102:"IMPORT",107:"AS",108:"DEFAULT",109:"IMPORT_ALL",110:"EXPORT",112:"EXPORT_ALL",116:"FUNC_EXIST",117:"CALL_START",118:"CALL_END",120:"THIS",121:"@",122:"[",123:"]",125:"..",128:"TRY",130:"FINALLY",131:"CATCH",132:"THROW",133:"(",134:")",136:"WHILE",137:"WHEN",138:"UNTIL",140:"LOOP",142:"FOR",143:"BY",147:"OWN",149:"FORIN",150:"FOROF",151:"FORFROM",152:"SWITCH",154:"ELSE",156:"LEADING_WHEN",158:"IF",159:"POST_IF",160:"UNARY",161:"UNARY_MATH",162:"-",163:"+",164:"--",165:"++",166:"?",
|
||||
167:"MATH",168:"**",169:"SHIFT",170:"COMPARE",171:"\x26",172:"^",173:"|",174:"\x26\x26",175:"||",176:"BIN?",177:"RELATION",178:"COMPOUND_ASSIGN"},productions_:[0,[3,0],[3,1],[4,1],[4,3],[4,2],[5,1],[5,1],[5,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[29,1],[29,2],[29,3],[32,2],[32,3],[35,1],[37,1],[39,1],[39,1],[41,1],[41,3],[45,1],[45,3],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[21,3],[21,4],[21,5],[58,
|
||||
1],[58,3],[58,5],[58,3],[58,5],[58,1],[61,1],[61,1],[61,1],[59,1],[59,1],[12,2],[12,1],[10,3],[10,2],[11,3],[11,2],[13,1],[19,5],[19,2],[69,1],[69,1],[72,0],[72,1],[67,0],[67,1],[67,3],[67,4],[67,6],[74,1],[74,2],[74,3],[74,1],[75,1],[75,1],[75,1],[75,1],[79,2],[80,1],[80,2],[80,2],[80,1],[56,1],[56,1],[56,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[85,3],[85,4],[81,2],[81,2],[81,2],[81,2],[81,1],[81,1],[93,3],[93,2],[94,1],[94,1],[78,4],[98,0],[98,1],[98,3],[98,4],[98,6],[27,1],[27,2],[27,3],[27,
|
||||
4],[27,2],[27,3],[27,4],[27,5],[15,2],[15,4],[15,4],[15,5],[15,7],[15,6],[15,9],[105,1],[105,3],[105,4],[105,4],[105,6],[106,1],[106,3],[106,1],[106,3],[103,1],[104,3],[16,3],[16,5],[16,2],[16,4],[16,5],[16,6],[16,3],[16,4],[16,7],[111,1],[111,3],[111,4],[111,4],[111,6],[113,1],[113,3],[113,3],[113,1],[18,3],[18,3],[18,3],[18,3],[114,0],[114,1],[115,2],[115,4],[84,1],[84,1],[62,2],[77,2],[77,4],[124,1],[124,1],[83,5],[96,3],[96,2],[96,2],[96,1],[119,1],[119,3],[119,4],[119,4],[119,6],[126,1],[126,
|
||||
1],[126,1],[127,1],[127,3],[23,2],[23,3],[23,4],[23,5],[129,3],[129,3],[129,2],[28,2],[82,3],[82,5],[135,2],[135,4],[135,2],[135,4],[24,2],[24,2],[24,2],[24,1],[139,2],[139,2],[25,2],[25,2],[25,2],[141,2],[141,4],[141,2],[144,2],[144,3],[148,1],[148,1],[148,1],[148,1],[146,1],[146,3],[145,2],[145,2],[145,4],[145,4],[145,4],[145,6],[145,6],[145,2],[145,4],[26,5],[26,7],[26,4],[26,6],[153,1],[153,2],[155,3],[155,4],[157,3],[157,5],[22,1],[22,3],[22,3],[22,3],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],
|
||||
[20,2],[20,2],[20,2],[20,2],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,5],[20,4],[20,3]],performAction:function(a,v,L,d,c,f,b){a=f.length-1;switch(c){case 1:return this.$=d.addLocationDataFn(b[a],b[a])(new d.Block);case 2:return this.$=f[a];case 3:this.$=d.addLocationDataFn(b[a],b[a])(d.Block.wrap([f[a]]));break;case 4:this.$=d.addLocationDataFn(b[a-2],b[a])(f[a-2].push(f[a]));break;case 5:this.$=f[a-1];break;case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 37:case 42:case 44:case 58:case 59:case 60:case 61:case 62:case 63:case 75:case 76:case 86:case 87:case 88:case 89:case 94:case 95:case 98:case 102:case 103:case 111:case 191:case 192:case 194:case 224:case 225:case 243:case 249:this.$=
|
||||
f[a];break;case 13:this.$=d.addLocationDataFn(b[a],b[a])(new d.StatementLiteral(f[a]));break;case 29:this.$=d.addLocationDataFn(b[a],b[a])(new d.Op(f[a],new d.Value(new d.Literal(""))));break;case 30:case 253:case 254:case 257:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Op(f[a-1],f[a]));break;case 31:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Op(f[a-2].concat(f[a-1]),f[a]));break;case 32:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Block);break;case 33:case 112:this.$=d.addLocationDataFn(b[a-
|
||||
2],b[a])(f[a-1]);break;case 34:this.$=d.addLocationDataFn(b[a],b[a])(new d.IdentifierLiteral(f[a]));break;case 35:this.$=d.addLocationDataFn(b[a],b[a])(new d.PropertyName(f[a]));break;case 36:this.$=d.addLocationDataFn(b[a],b[a])(new d.NumberLiteral(f[a]));break;case 38:this.$=d.addLocationDataFn(b[a],b[a])(new d.StringLiteral(f[a]));break;case 39:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.StringWithInterpolations(f[a-1]));break;case 40:this.$=d.addLocationDataFn(b[a],b[a])(new d.RegexLiteral(f[a]));
|
||||
break;case 41:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.RegexWithInterpolations(f[a-1].args));break;case 43:this.$=d.addLocationDataFn(b[a],b[a])(new d.PassthroughLiteral(f[a]));break;case 45:this.$=d.addLocationDataFn(b[a],b[a])(new d.UndefinedLiteral);break;case 46:this.$=d.addLocationDataFn(b[a],b[a])(new d.NullLiteral);break;case 47:this.$=d.addLocationDataFn(b[a],b[a])(new d.BooleanLiteral(f[a]));break;case 48:this.$=d.addLocationDataFn(b[a],b[a])(new d.InfinityLiteral(f[a]));break;case 49:this.$=
|
||||
d.addLocationDataFn(b[a],b[a])(new d.NaNLiteral);break;case 50:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Assign(f[a-2],f[a]));break;case 51:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.Assign(f[a-3],f[a]));break;case 52:this.$=d.addLocationDataFn(b[a-4],b[a])(new d.Assign(f[a-4],f[a-1]));break;case 53:case 91:case 96:case 97:case 99:case 100:case 101:case 226:case 227:this.$=d.addLocationDataFn(b[a],b[a])(new d.Value(f[a]));break;case 54:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Assign(d.addLocationDataFn(b[a-
|
||||
2])(new d.Value(f[a-2])),f[a],"object",{operatorToken:d.addLocationDataFn(b[a-1])(new d.Literal(f[a-1]))}));break;case 55:this.$=d.addLocationDataFn(b[a-4],b[a])(new d.Assign(d.addLocationDataFn(b[a-4])(new d.Value(f[a-4])),f[a-1],"object",{operatorToken:d.addLocationDataFn(b[a-3])(new d.Literal(f[a-3]))}));break;case 56:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Assign(d.addLocationDataFn(b[a-2])(new d.Value(f[a-2])),f[a],null,{operatorToken:d.addLocationDataFn(b[a-1])(new d.Literal(f[a-1]))}));
|
||||
break;case 57:this.$=d.addLocationDataFn(b[a-4],b[a])(new d.Assign(d.addLocationDataFn(b[a-4])(new d.Value(f[a-4])),f[a-1],null,{operatorToken:d.addLocationDataFn(b[a-3])(new d.Literal(f[a-3]))}));break;case 64:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Return(f[a]));break;case 65:this.$=d.addLocationDataFn(b[a],b[a])(new d.Return);break;case 66:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.YieldReturn(f[a]));break;case 67:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.YieldReturn);break;case 68:this.$=
|
||||
d.addLocationDataFn(b[a-2],b[a])(new d.AwaitReturn(f[a]));break;case 69:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.AwaitReturn);break;case 70:this.$=d.addLocationDataFn(b[a],b[a])(new d.Comment(f[a]));break;case 71:this.$=d.addLocationDataFn(b[a-4],b[a])(new d.Code(f[a-3],f[a],f[a-1]));break;case 72:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Code([],f[a],f[a-1]));break;case 73:this.$=d.addLocationDataFn(b[a],b[a])("func");break;case 74:this.$=d.addLocationDataFn(b[a],b[a])("boundfunc");break;
|
||||
case 77:case 117:this.$=d.addLocationDataFn(b[a],b[a])([]);break;case 78:case 118:case 137:case 157:case 186:case 228:this.$=d.addLocationDataFn(b[a],b[a])([f[a]]);break;case 79:case 119:case 138:case 158:case 187:this.$=d.addLocationDataFn(b[a-2],b[a])(f[a-2].concat(f[a]));break;case 80:case 120:case 139:case 159:case 188:this.$=d.addLocationDataFn(b[a-3],b[a])(f[a-3].concat(f[a]));break;case 81:case 121:case 141:case 161:case 190:this.$=d.addLocationDataFn(b[a-5],b[a])(f[a-5].concat(f[a-2]));break;
|
||||
case 82:this.$=d.addLocationDataFn(b[a],b[a])(new d.Param(f[a]));break;case 83:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Param(f[a-1],null,!0));break;case 84:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Param(f[a-2],f[a]));break;case 85:case 193:this.$=d.addLocationDataFn(b[a],b[a])(new d.Expansion);break;case 90:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Splat(f[a-1]));break;case 92:this.$=d.addLocationDataFn(b[a-1],b[a])(f[a-1].add(f[a]));break;case 93:this.$=d.addLocationDataFn(b[a-1],
|
||||
b[a])(new d.Value(f[a-1],[].concat(f[a])));break;case 104:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Super(d.addLocationDataFn(b[a])(new d.Access(f[a]))));break;case 105:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.Super(d.addLocationDataFn(b[a-1])(new d.Index(f[a-1]))));break;case 106:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Access(f[a]));break;case 107:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Access(f[a],"soak"));break;case 108:this.$=d.addLocationDataFn(b[a-1],b[a])([d.addLocationDataFn(b[a-
|
||||
1])(new d.Access(new d.PropertyName("prototype"))),d.addLocationDataFn(b[a])(new d.Access(f[a]))]);break;case 109:this.$=d.addLocationDataFn(b[a-1],b[a])([d.addLocationDataFn(b[a-1])(new d.Access(new d.PropertyName("prototype"),"soak")),d.addLocationDataFn(b[a])(new d.Access(f[a]))]);break;case 110:this.$=d.addLocationDataFn(b[a],b[a])(new d.Access(new d.PropertyName("prototype")));break;case 113:this.$=d.addLocationDataFn(b[a-1],b[a])(d.extend(f[a],{soak:!0}));break;case 114:this.$=d.addLocationDataFn(b[a],
|
||||
b[a])(new d.Index(f[a]));break;case 115:this.$=d.addLocationDataFn(b[a],b[a])(new d.Slice(f[a]));break;case 116:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.Obj(f[a-2],f[a-3].generated));break;case 122:this.$=d.addLocationDataFn(b[a],b[a])(new d.Class);break;case 123:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Class(null,null,f[a]));break;case 124:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Class(null,f[a]));break;case 125:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.Class(null,f[a-1],f[a]));
|
||||
break;case 126:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Class(f[a]));break;case 127:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Class(f[a-1],null,f[a]));break;case 128:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.Class(f[a-2],f[a]));break;case 129:this.$=d.addLocationDataFn(b[a-4],b[a])(new d.Class(f[a-3],f[a-1],f[a]));break;case 130:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.ImportDeclaration(null,f[a]));break;case 131:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.ImportDeclaration(new d.ImportClause(f[a-
|
||||
2],null),f[a]));break;case 132:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.ImportDeclaration(new d.ImportClause(null,f[a-2]),f[a]));break;case 133:this.$=d.addLocationDataFn(b[a-4],b[a])(new d.ImportDeclaration(new d.ImportClause(null,new d.ImportSpecifierList([])),f[a]));break;case 134:this.$=d.addLocationDataFn(b[a-6],b[a])(new d.ImportDeclaration(new d.ImportClause(null,new d.ImportSpecifierList(f[a-4])),f[a]));break;case 135:this.$=d.addLocationDataFn(b[a-5],b[a])(new d.ImportDeclaration(new d.ImportClause(f[a-
|
||||
4],f[a-2]),f[a]));break;case 136:this.$=d.addLocationDataFn(b[a-8],b[a])(new d.ImportDeclaration(new d.ImportClause(f[a-7],new d.ImportSpecifierList(f[a-4])),f[a]));break;case 140:case 160:case 173:case 189:this.$=d.addLocationDataFn(b[a-3],b[a])(f[a-2]);break;case 142:this.$=d.addLocationDataFn(b[a],b[a])(new d.ImportSpecifier(f[a]));break;case 143:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.ImportSpecifier(f[a-2],f[a]));break;case 144:this.$=d.addLocationDataFn(b[a],b[a])(new d.ImportSpecifier(new d.Literal(f[a])));
|
||||
break;case 145:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.ImportSpecifier(new d.Literal(f[a-2]),f[a]));break;case 146:this.$=d.addLocationDataFn(b[a],b[a])(new d.ImportDefaultSpecifier(f[a]));break;case 147:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.ImportNamespaceSpecifier(new d.Literal(f[a-2]),f[a]));break;case 148:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.ExportNamedDeclaration(new d.ExportSpecifierList([])));break;case 149:this.$=d.addLocationDataFn(b[a-4],b[a])(new d.ExportNamedDeclaration(new d.ExportSpecifierList(f[a-
|
||||
2])));break;case 150:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.ExportNamedDeclaration(f[a]));break;case 151:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.ExportNamedDeclaration(new d.Assign(f[a-2],f[a],null,{moduleDeclaration:"export"})));break;case 152:this.$=d.addLocationDataFn(b[a-4],b[a])(new d.ExportNamedDeclaration(new d.Assign(f[a-3],f[a],null,{moduleDeclaration:"export"})));break;case 153:this.$=d.addLocationDataFn(b[a-5],b[a])(new d.ExportNamedDeclaration(new d.Assign(f[a-4],f[a-1],null,
|
||||
{moduleDeclaration:"export"})));break;case 154:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.ExportDefaultDeclaration(f[a]));break;case 155:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.ExportAllDeclaration(new d.Literal(f[a-2]),f[a]));break;case 156:this.$=d.addLocationDataFn(b[a-6],b[a])(new d.ExportNamedDeclaration(new d.ExportSpecifierList(f[a-4]),f[a]));break;case 162:this.$=d.addLocationDataFn(b[a],b[a])(new d.ExportSpecifier(f[a]));break;case 163:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.ExportSpecifier(f[a-
|
||||
2],f[a]));break;case 164:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.ExportSpecifier(f[a-2],new d.Literal(f[a])));break;case 165:this.$=d.addLocationDataFn(b[a],b[a])(new d.ExportSpecifier(new d.Literal(f[a])));break;case 166:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.TaggedTemplateCall(f[a-2],f[a],f[a-1]));break;case 167:case 168:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Call(f[a-2],f[a],f[a-1]));break;case 169:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.SuperCall(d.addLocationDataFn(b[a-
|
||||
2])(new d.Super),f[a],f[a-1]));break;case 170:this.$=d.addLocationDataFn(b[a],b[a])(!1);break;case 171:this.$=d.addLocationDataFn(b[a],b[a])(!0);break;case 172:this.$=d.addLocationDataFn(b[a-1],b[a])([]);break;case 174:case 175:this.$=d.addLocationDataFn(b[a],b[a])(new d.Value(new d.ThisLiteral));break;case 176:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Value(d.addLocationDataFn(b[a-1])(new d.ThisLiteral),[d.addLocationDataFn(b[a])(new d.Access(f[a]))],"this"));break;case 177:this.$=d.addLocationDataFn(b[a-
|
||||
1],b[a])(new d.Arr([]));break;case 178:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.Arr(f[a-2]));break;case 179:this.$=d.addLocationDataFn(b[a],b[a])("inclusive");break;case 180:this.$=d.addLocationDataFn(b[a],b[a])("exclusive");break;case 181:this.$=d.addLocationDataFn(b[a-4],b[a])(new d.Range(f[a-3],f[a-1],f[a-2]));break;case 182:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Range(f[a-2],f[a],f[a-1]));break;case 183:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Range(f[a-1],null,f[a]));break;case 184:this.$=
|
||||
d.addLocationDataFn(b[a-1],b[a])(new d.Range(null,f[a],f[a-1]));break;case 185:this.$=d.addLocationDataFn(b[a],b[a])(new d.Range(null,null,f[a]));break;case 195:this.$=d.addLocationDataFn(b[a-2],b[a])([].concat(f[a-2],f[a]));break;case 196:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Try(f[a]));break;case 197:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Try(f[a-1],f[a][0],f[a][1]));break;case 198:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.Try(f[a-2],null,null,f[a]));break;case 199:this.$=d.addLocationDataFn(b[a-
|
||||
4],b[a])(new d.Try(f[a-3],f[a-2][0],f[a-2][1],f[a]));break;case 200:this.$=d.addLocationDataFn(b[a-2],b[a])([f[a-1],f[a]]);break;case 201:this.$=d.addLocationDataFn(b[a-2],b[a])([d.addLocationDataFn(b[a-1])(new d.Value(f[a-1])),f[a]]);break;case 202:this.$=d.addLocationDataFn(b[a-1],b[a])([null,f[a]]);break;case 203:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Throw(f[a]));break;case 204:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Parens(f[a-1]));break;case 205:this.$=d.addLocationDataFn(b[a-4],
|
||||
b[a])(new d.Parens(f[a-2]));break;case 206:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.While(f[a]));break;case 207:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.While(f[a-2],{guard:f[a]}));break;case 208:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.While(f[a],{invert:!0}));break;case 209:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.While(f[a-2],{invert:!0,guard:f[a]}));break;case 210:this.$=d.addLocationDataFn(b[a-1],b[a])(f[a-1].addBody(f[a]));break;case 211:case 212:this.$=d.addLocationDataFn(b[a-
|
||||
1],b[a])(f[a].addBody(d.addLocationDataFn(b[a-1])(d.Block.wrap([f[a-1]]))));break;case 213:this.$=d.addLocationDataFn(b[a],b[a])(f[a]);break;case 214:this.$=d.addLocationDataFn(b[a-1],b[a])((new d.While(d.addLocationDataFn(b[a-1])(new d.BooleanLiteral("true")))).addBody(f[a]));break;case 215:this.$=d.addLocationDataFn(b[a-1],b[a])((new d.While(d.addLocationDataFn(b[a-1])(new d.BooleanLiteral("true")))).addBody(d.addLocationDataFn(b[a])(d.Block.wrap([f[a]]))));break;case 216:case 217:this.$=d.addLocationDataFn(b[a-
|
||||
1],b[a])(new d.For(f[a-1],f[a]));break;case 218:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.For(f[a],f[a-1]));break;case 219:this.$=d.addLocationDataFn(b[a-1],b[a])({source:d.addLocationDataFn(b[a])(new d.Value(f[a]))});break;case 220:this.$=d.addLocationDataFn(b[a-3],b[a])({source:d.addLocationDataFn(b[a-2])(new d.Value(f[a-2])),step:f[a]});break;case 221:d=d.addLocationDataFn(b[a-1],b[a]);f[a].own=f[a-1].own;f[a].ownTag=f[a-1].ownTag;f[a].name=f[a-1][0];f[a].index=f[a-1][1];this.$=d(f[a]);break;
|
||||
case 222:this.$=d.addLocationDataFn(b[a-1],b[a])(f[a]);break;case 223:c=d.addLocationDataFn(b[a-2],b[a]);f[a].own=!0;f[a].ownTag=d.addLocationDataFn(b[a-1])(new d.Literal(f[a-1]));this.$=c(f[a]);break;case 229:this.$=d.addLocationDataFn(b[a-2],b[a])([f[a-2],f[a]]);break;case 230:this.$=d.addLocationDataFn(b[a-1],b[a])({source:f[a]});break;case 231:this.$=d.addLocationDataFn(b[a-1],b[a])({source:f[a],object:!0});break;case 232:this.$=d.addLocationDataFn(b[a-3],b[a])({source:f[a-2],guard:f[a]});break;
|
||||
case 233:this.$=d.addLocationDataFn(b[a-3],b[a])({source:f[a-2],guard:f[a],object:!0});break;case 234:this.$=d.addLocationDataFn(b[a-3],b[a])({source:f[a-2],step:f[a]});break;case 235:this.$=d.addLocationDataFn(b[a-5],b[a])({source:f[a-4],guard:f[a-2],step:f[a]});break;case 236:this.$=d.addLocationDataFn(b[a-5],b[a])({source:f[a-4],step:f[a-2],guard:f[a]});break;case 237:this.$=d.addLocationDataFn(b[a-1],b[a])({source:f[a],from:!0});break;case 238:this.$=d.addLocationDataFn(b[a-3],b[a])({source:f[a-
|
||||
2],guard:f[a],from:!0});break;case 239:this.$=d.addLocationDataFn(b[a-4],b[a])(new d.Switch(f[a-3],f[a-1]));break;case 240:this.$=d.addLocationDataFn(b[a-6],b[a])(new d.Switch(f[a-5],f[a-3],f[a-1]));break;case 241:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.Switch(null,f[a-1]));break;case 242:this.$=d.addLocationDataFn(b[a-5],b[a])(new d.Switch(null,f[a-3],f[a-1]));break;case 244:this.$=d.addLocationDataFn(b[a-1],b[a])(f[a-1].concat(f[a]));break;case 245:this.$=d.addLocationDataFn(b[a-2],b[a])([[f[a-
|
||||
1],f[a]]]);break;case 246:this.$=d.addLocationDataFn(b[a-3],b[a])([[f[a-2],f[a-1]]]);break;case 247:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.If(f[a-1],f[a],{type:f[a-2]}));break;case 248:this.$=d.addLocationDataFn(b[a-4],b[a])(f[a-4].addElse(d.addLocationDataFn(b[a-2],b[a])(new d.If(f[a-1],f[a],{type:f[a-2]}))));break;case 250:this.$=d.addLocationDataFn(b[a-2],b[a])(f[a-2].addElse(f[a]));break;case 251:case 252:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.If(f[a],d.addLocationDataFn(b[a-2])(d.Block.wrap([f[a-
|
||||
2]])),{type:f[a-1],statement:!0}));break;case 255:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Op("-",f[a]));break;case 256:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Op("+",f[a]));break;case 258:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Op("--",f[a]));break;case 259:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Op("++",f[a]));break;case 260:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Op("--",f[a-1],null,!0));break;case 261:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Op("++",f[a-1],null,
|
||||
!0));break;case 262:this.$=d.addLocationDataFn(b[a-1],b[a])(new d.Existence(f[a-1]));break;case 263:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Op("+",f[a-2],f[a]));break;case 264:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Op("-",f[a-2],f[a]));break;case 265:case 266:case 267:case 268:case 269:case 270:case 271:case 272:case 273:case 274:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Op(f[a-1],f[a-2],f[a]));break;case 275:b=d.addLocationDataFn(b[a-2],b[a]);f="!"===f[a-1].charAt(0)?(new d.Op(f[a-
|
||||
1].slice(1),f[a-2],f[a])).invert():new d.Op(f[a-1],f[a-2],f[a]);this.$=b(f);break;case 276:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Assign(f[a-2],f[a],f[a-1]));break;case 277:this.$=d.addLocationDataFn(b[a-4],b[a])(new d.Assign(f[a-4],f[a-1],f[a-3]));break;case 278:this.$=d.addLocationDataFn(b[a-3],b[a])(new d.Assign(f[a-3],f[a],f[a-2]));break;case 279:this.$=d.addLocationDataFn(b[a-2],b[a])(new d.Extends(f[a-2],f[a]))}},table:[{1:[2,1],3:1,4:2,5:3,7:4,8:5,9:6,10:25,11:26,12:20,13:21,14:g,15:23,
|
||||
16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:q,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:sa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{1:[3]},{1:[2,2],6:xa},a(ua,[2,3]),a(ua,[2,6],{144:80,135:105,
|
||||
141:106,136:G,138:C,142:F,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(ua,[2,7],{144:80,135:108,141:109,136:G,138:C,142:F,159:ra}),a(ua,[2,8]),a(wa,[2,16],{114:110,81:111,93:117,42:Qa,43:Qa,117:Qa,87:Xa,88:Ha,90:Ya,91:cb,92:Ra,95:Ia,116:Fa}),a(wa,[2,17],{93:117,114:120,81:121,87:Xa,88:Ha,90:Ya,91:cb,92:Ra,95:Ia,116:Fa,117:Qa}),a(wa,[2,18]),a(wa,[2,19]),a(wa,[2,20]),a(wa,[2,21]),a(wa,[2,22]),a(wa,[2,23]),a(wa,[2,24]),a(wa,[2,25]),a(wa,[2,
|
||||
26]),a(wa,[2,27]),a(wa,[2,28]),a(Ea,[2,11]),a(Ea,[2,12]),a(Ea,[2,13]),a(Ea,[2,14]),a(Ea,[2,15]),a(ua,[2,9]),a(ua,[2,10]),a(Ba,Sa,{57:[1,122]}),a(Ba,[2,99]),a(Ba,[2,100]),a(Ba,[2,101]),a(Ba,[2,102]),a(Ba,[2,103]),{87:[1,124],88:[1,125],114:123,116:Fa,117:Qa},a([6,33,68,73],Ta,{67:126,74:127,75:128,35:130,62:131,77:132,78:133,36:m,76:db,97:x,121:Ja,122:Ma}),{32:136,33:Ca},{7:138,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,
|
||||
36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:142,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,
|
||||
42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:143,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,
|
||||
49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:144,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,
|
||||
54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:145,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,
|
||||
63:[1,146],64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{17:148,18:149,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:150,62:74,77:57,78:58,80:147,82:29,83:30,84:31,85:32,86:H,97:x,120:Q,121:R,122:M,133:P},{17:148,18:149,35:73,36:m,39:59,40:c,41:83,42:e,
|
||||
43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:150,62:74,77:57,78:58,80:151,82:29,83:30,84:31,85:32,86:H,97:x,120:Q,121:R,122:M,133:P},a(Ua,ya,{101:[1,155],164:[1,152],165:[1,153],178:[1,154]}),a(wa,[2,249],{154:[1,156]}),{32:157,33:Ca},{32:158,33:Ca},a(wa,[2,213]),{32:159,33:Ca},{7:160,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,33:[1,161],35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,
|
||||
53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(gb,[2,122],{49:28,82:29,83:30,84:31,85:32,77:57,78:58,39:59,45:61,35:73,62:74,41:83,17:148,18:149,56:150,32:162,80:164,33:Ca,36:m,40:c,42:e,43:y,46:D,47:w,50:z,51:l,52:E,53:A,54:B,55:J,86:H,97:x,101:[1,163],120:Q,121:R,
|
||||
122:M,133:P}),{7:165,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a([1,6,34,
|
||||
44,134,136,138,142,159,166,167,168,169,170,171,172,173,174,175,176,177],eb,{17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,12:20,13:21,15:23,16:24,56:27,49:28,82:29,83:30,84:31,85:32,69:35,80:43,157:44,135:46,139:47,141:48,77:57,78:58,39:59,45:61,35:73,62:74,144:80,41:83,8:140,7:166,14:g,30:ga,31:fb,36:m,40:c,42:e,43:y,46:D,47:w,50:z,51:l,52:E,53:A,54:B,55:J,63:[1,168],64:fa,65:h,66:n,70:u,71:t,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,140:Z,152:ca,
|
||||
158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X}),a(Ea,Oa,{17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,12:20,13:21,15:23,16:24,56:27,49:28,82:29,83:30,84:31,85:32,69:35,80:43,157:44,135:46,139:47,141:48,77:57,78:58,39:59,45:61,35:73,62:74,144:80,41:83,8:140,7:169,14:g,30:ga,36:m,40:c,42:e,43:y,46:D,47:w,50:z,51:l,52:E,53:A,54:B,55:J,63:p,64:fa,65:h,66:n,70:u,71:t,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,140:Z,152:ca,158:S,160:V,161:K,162:aa,163:ba,
|
||||
164:Y,165:X}),a([1,6,33,34,44,73,99,134,136,138,142,159],[2,70]),{35:174,36:m,41:170,42:e,43:y,97:[1,173],103:171,104:172,109:hb},{27:177,35:178,36:m,97:[1,176],100:r,108:[1,179],112:[1,180]},a(Ua,[2,96]),a(Ua,[2,97]),a(Ba,[2,42]),a(Ba,[2,43]),a(Ba,[2,44]),a(Ba,[2,45]),a(Ba,[2,46]),a(Ba,[2,47]),a(Ba,[2,48]),a(Ba,[2,49]),{4:181,5:3,7:4,8:5,9:6,10:25,11:26,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:q,33:[1,182],35:73,36:m,39:59,40:c,41:83,
|
||||
42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:sa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:183,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,33:Za,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,
|
||||
46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,76:Ga,77:57,78:58,79:188,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,119:185,120:Q,121:R,122:M,123:mb,126:186,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(Ba,[2,174]),a(Ba,[2,175],{37:190,38:La}),{33:[2,73]},{33:[2,74]},a(Ka,[2,91]),a(Ka,[2,94]),{7:192,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,
|
||||
21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:193,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,
|
||||
25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:194,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,
|
||||
29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:196,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,32:195,33:Ca,
|
||||
35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{35:201,36:m,62:202,77:203,78:204,83:197,97:x,121:Ja,122:M,146:198,147:[1,199],148:200},{145:205,149:[1,206],150:[1,207],151:[1,208]},a([6,33,73,
|
||||
99],nb,{41:83,98:209,58:210,59:211,61:212,13:213,39:214,35:215,37:216,62:217,36:m,38:La,40:c,42:e,43:y,65:h,121:Ja}),a(ob,[2,36]),a(ob,[2,37]),a(Ba,[2,40]),{17:148,18:218,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:150,62:74,77:57,78:58,80:219,82:29,83:30,84:31,85:32,86:H,97:x,120:Q,121:R,122:M,133:P},a([1,6,31,33,34,42,43,44,57,60,68,73,76,87,88,89,90,91,92,95,99,101,107,116,117,118,123,125,134,136,137,138,142,143,149,150,151,159,162,163,164,165,166,
|
||||
167,168,169,170,171,172,173,174,175,176,177,178],[2,34]),a(Va,[2,38]),{4:220,5:3,7:4,8:5,9:6,10:25,11:26,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:q,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:sa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,
|
||||
144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(ua,[2,5],{7:4,8:5,9:6,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,12:20,13:21,15:23,16:24,10:25,11:26,56:27,49:28,82:29,83:30,84:31,85:32,69:35,80:43,157:44,135:46,139:47,141:48,77:57,78:58,39:59,45:61,35:73,62:74,144:80,41:83,5:221,14:g,30:q,36:m,40:c,42:e,43:y,46:D,47:w,50:z,51:l,52:E,53:A,54:B,55:J,63:p,64:sa,65:h,66:n,70:u,71:t,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,136:G,
|
||||
138:C,140:Z,142:F,152:ca,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X}),a(wa,[2,262]),{7:222,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,
|
||||
152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:223,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,
|
||||
161:K,162:aa,163:ba,164:Y,165:X},{7:224,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,
|
||||
165:X},{7:225,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:226,8:140,12:20,
|
||||
13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:227,8:140,12:20,13:21,14:g,15:23,16:24,
|
||||
17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:228,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,
|
||||
22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:229,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,
|
||||
26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:230,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,
|
||||
30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:231,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,
|
||||
40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:232,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,
|
||||
46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:233,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,
|
||||
52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:234,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,
|
||||
62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:235,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,
|
||||
66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(wa,[2,212]),a(wa,[2,217]),{7:236,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,
|
||||
65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(wa,[2,211]),a(wa,[2,216]),{41:237,42:e,43:y,115:238,117:ib},a(Ka,[2,92]),a(pb,[2,171]),{37:240,38:La},{37:241,38:La},a(Ka,[2,110],{37:242,38:La}),{37:243,38:La},a(Ka,[2,111]),{7:245,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,
|
||||
24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,76:qb,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,94:244,96:246,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,124:247,125:b,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{88:Ha,93:250,95:Ia},{115:251,117:ib},a(Ka,[2,93]),{6:[1,253],7:252,8:140,
|
||||
12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,33:[1,254],35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{115:255,117:ib},{37:256,
|
||||
38:La},{7:257,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a([6,33],v,{72:260,
|
||||
68:[1,258],73:L}),a(d,[2,78]),a(d,[2,82],{57:[1,262],76:[1,261]}),a(d,[2,85]),a(f,[2,86]),a(f,[2,87]),a(f,[2,88]),a(f,[2,89]),{37:190,38:La},{7:263,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,33:Za,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,76:Ga,77:57,78:58,79:188,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,119:185,120:Q,
|
||||
121:R,122:M,123:mb,126:186,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(wa,[2,72]),{4:265,5:3,7:4,8:5,9:6,10:25,11:26,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:q,34:[1,264],35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:sa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,
|
||||
86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(Wa,[2,253],{144:80,135:105,141:106,166:I}),{7:145,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,
|
||||
83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{135:108,136:G,138:C,141:109,142:F,144:80,159:ra},a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,166,167,168,169,170,171,172,173,174,175,176,177],eb,{17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,12:20,13:21,15:23,16:24,56:27,49:28,82:29,83:30,84:31,85:32,
|
||||
69:35,80:43,157:44,135:46,139:47,141:48,77:57,78:58,39:59,45:61,35:73,62:74,144:80,41:83,8:140,7:166,14:g,30:ga,31:fb,36:m,40:c,42:e,43:y,46:D,47:w,50:z,51:l,52:E,53:A,54:B,55:J,63:p,64:fa,65:h,66:n,70:u,71:t,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,140:Z,152:ca,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X}),a(Da,[2,254],{144:80,135:105,141:106,166:I,168:da}),a(Da,[2,255],{144:80,135:105,141:106,166:I,168:da}),a(Da,[2,256],{144:80,135:105,141:106,166:I,168:da}),a(Wa,[2,257],
|
||||
{144:80,135:105,141:106,166:I}),a(ua,[2,69],{17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,12:20,13:21,15:23,16:24,56:27,49:28,82:29,83:30,84:31,85:32,69:35,80:43,157:44,135:46,139:47,141:48,77:57,78:58,39:59,45:61,35:73,62:74,144:80,41:83,8:140,7:266,14:g,30:ga,36:m,40:c,42:e,43:y,46:D,47:w,50:z,51:l,52:E,53:A,54:B,55:J,63:p,64:fa,65:h,66:n,70:u,71:t,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,136:Oa,138:Oa,142:Oa,159:Oa,140:Z,152:ca,158:S,160:V,161:K,
|
||||
162:aa,163:ba,164:Y,165:X}),a(wa,[2,258],{42:ya,43:ya,87:ya,88:ya,90:ya,91:ya,92:ya,95:ya,116:ya,117:ya}),a(pb,Qa,{114:110,81:111,93:117,87:Xa,88:Ha,90:Ya,91:cb,92:Ra,95:Ia,116:Fa}),{81:121,87:Xa,88:Ha,90:Ya,91:cb,92:Ra,93:117,95:Ia,114:120,116:Fa,117:Qa},a(rb,Sa),a(wa,[2,259],{42:ya,43:ya,87:ya,88:ya,90:ya,91:ya,92:ya,95:ya,116:ya,117:ya}),a(wa,[2,260]),a(wa,[2,261]),{6:[1,269],7:267,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,
|
||||
33:[1,268],35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:270,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,
|
||||
39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{32:271,33:Ca,158:[1,272]},a(wa,[2,196],{129:273,130:[1,274],131:[1,275]}),a(wa,[2,210]),a(wa,[2,218]),{33:[1,276],135:105,136:G,138:C,141:106,142:F,144:80,
|
||||
159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na},{153:277,155:278,156:vb},a(wa,[2,123]),{7:280,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,
|
||||
133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(gb,[2,126],{32:281,33:Ca,42:ya,43:ya,87:ya,88:ya,90:ya,91:ya,92:ya,95:ya,116:ya,117:ya,101:[1,282]}),a(Pa,[2,203],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Pa,[2,30],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),{7:283,8:140,
|
||||
12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(ua,[2,67],{17:7,18:8,19:9,20:10,21:11,
|
||||
22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,12:20,13:21,15:23,16:24,56:27,49:28,82:29,83:30,84:31,85:32,69:35,80:43,157:44,135:46,139:47,141:48,77:57,78:58,39:59,45:61,35:73,62:74,144:80,41:83,8:140,7:284,14:g,30:ga,36:m,40:c,42:e,43:y,46:D,47:w,50:z,51:l,52:E,53:A,54:B,55:J,63:p,64:fa,65:h,66:n,70:u,71:t,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,136:Oa,138:Oa,142:Oa,159:Oa,140:Z,152:ca,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X}),a(Ea,$a,{144:80,135:105,141:106,162:la,
|
||||
163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Ea,[2,130]),{31:[1,285],73:[1,286]},{31:[1,287]},{33:wb,35:292,36:m,99:[1,288],105:289,106:290,108:jb},a([31,73],[2,146]),{107:[1,294]},{33:Hb,35:299,36:m,99:[1,295],108:sb,111:296,113:297},a(Ea,[2,150]),{57:[1,301]},{7:302,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,
|
||||
52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{31:[1,303]},{6:xa,134:[1,304]},{4:305,5:3,7:4,8:5,9:6,10:25,11:26,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:q,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,
|
||||
46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:sa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a([6,33,73,123],Sb,{144:80,135:105,141:106,124:306,76:[1,307],125:b,136:G,138:C,142:F,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),
|
||||
a(Ib,[2,177]),a([6,33,123],v,{72:308,73:xb}),a(ab,[2,186]),{7:263,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,33:Za,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,76:Ga,77:57,78:58,79:188,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,119:310,120:Q,121:R,122:M,126:186,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,
|
||||
142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(ab,[2,192]),a(ab,[2,193]),a(Tb,[2,176]),a(Tb,[2,35]),{32:311,33:Ca,135:105,136:G,138:C,141:106,142:F,144:80,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na},a(Ub,[2,206],{144:80,135:105,141:106,136:G,137:[1,312],138:C,142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Ub,[2,208],{144:80,135:105,141:106,136:G,137:[1,
|
||||
313],138:C,142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(wa,[2,214]),a(kb,[2,215],{144:80,135:105,141:106,136:G,138:C,142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,159,162,163,166,167,168,169,170,171,172,173,174,175,176,177],[2,219],{143:[1,314]}),a(yb,[2,222]),{35:201,36:m,62:202,77:203,78:204,97:x,121:Ja,122:Ma,146:315,
|
||||
148:200},a(yb,[2,228],{73:[1,316]}),a(zb,[2,224]),a(zb,[2,225]),a(zb,[2,226]),a(zb,[2,227]),a(wa,[2,221]),{7:317,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,
|
||||
141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:318,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,
|
||||
157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:319,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,
|
||||
162:aa,163:ba,164:Y,165:X},a(Ab,v,{72:320,73:Vb}),a(Aa,[2,118]),a(Aa,[2,53],{60:[1,322]}),a(Wb,[2,62],{57:[1,323]}),a(Aa,[2,58]),a(Wb,[2,63]),a(Jb,[2,59]),a(Jb,[2,60]),a(Jb,[2,61]),{48:[1,324],81:121,87:Xa,88:Ha,90:Ya,91:cb,92:Ra,93:117,95:Ia,114:120,116:Fa,117:Qa},a(rb,ya),{6:xa,44:[1,325]},a(ua,[2,4]),a(Xb,[2,263],{144:80,135:105,141:106,166:I,167:ja,168:da}),a(Xb,[2,264],{144:80,135:105,141:106,166:I,167:ja,168:da}),a(Da,[2,265],{144:80,135:105,141:106,166:I,168:da}),a(Da,[2,266],{144:80,135:105,
|
||||
141:106,166:I,168:da}),a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,169,170,171,172,173,174,175,176,177],[2,267],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da}),a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,170,171,172,173,174,175,176],[2,268],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,177:na}),a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,171,172,173,174,175,176],[2,269],{144:80,135:105,
|
||||
141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,177:na}),a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,172,173,174,175,176],[2,270],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,177:na}),a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,173,174,175,176],[2,271],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,177:na}),a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,
|
||||
142,143,159,174,175,176],[2,272],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,177:na}),a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,175,176],[2,273],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,177:na}),a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,176],[2,274],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,
|
||||
173:ea,174:N,175:qa,177:na}),a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,143,159,170,171,172,173,174,175,176,177],[2,275],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa}),a(kb,[2,252],{144:80,135:105,141:106,136:G,138:C,142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(kb,[2,251],{144:80,135:105,141:106,136:G,138:C,142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,
|
||||
177:na}),a(lb,[2,166]),a(lb,[2,167]),{7:263,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,33:Za,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,76:Ga,77:57,78:58,79:188,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,118:[1,326],119:327,120:Q,121:R,122:M,126:186,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,
|
||||
152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(Ka,[2,106]),a(Ka,[2,107]),a(Ka,[2,108]),a(Ka,[2,109]),{89:[1,328]},{76:qb,89:[2,114],124:329,125:b,135:105,136:G,138:C,141:106,142:F,144:80,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na},{89:[2,115]},{7:330,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,
|
||||
50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,89:[2,185],97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(Yb,[2,179]),a(Yb,Zb),a(Ka,[2,113]),a(lb,[2,168]),a(Pa,[2,50],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),{7:331,8:140,
|
||||
12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:332,8:140,12:20,13:21,14:g,15:23,
|
||||
16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(lb,[2,169]),a(Ba,[2,104]),{89:[1,333],135:105,136:G,138:C,
|
||||
141:106,142:F,144:80,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na},{69:334,70:u,71:t},a(bb,tb,{75:128,35:130,62:131,77:132,78:133,74:335,36:m,76:db,97:x,121:Ja,122:Ma}),{6:$b,33:ac},a(d,[2,83]),{7:338,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,
|
||||
70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(ab,Sb,{144:80,135:105,141:106,76:[1,339],136:G,138:C,142:F,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(bc,[2,32]),{6:xa,34:[1,340]},a(ua,[2,68],{144:80,135:105,141:106,136:$a,138:$a,142:$a,159:$a,162:la,163:ma,
|
||||
166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Pa,[2,276],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),{7:341,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,
|
||||
83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:342,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,
|
||||
97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(Pa,[2,279],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(wa,[2,250]),{7:343,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,
|
||||
50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(wa,[2,197],{130:[1,344]}),{32:345,33:Ca},{32:348,33:Ca,35:346,36:m,78:347,97:x},{153:349,155:278,156:vb},{34:[1,350],154:[1,351],155:352,156:vb},a(Bb,[2,243]),{7:354,8:140,12:20,13:21,14:g,15:23,16:24,17:7,
|
||||
18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,127:353,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(cc,[2,124],{144:80,135:105,141:106,32:355,33:Ca,136:G,138:C,
|
||||
142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(wa,[2,127]),{7:356,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,
|
||||
139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(Pa,[2,31],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(ua,[2,66],{144:80,135:105,141:106,136:$a,138:$a,142:$a,159:$a,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),{41:357,42:e,43:y},{97:[1,359],104:358,109:hb},{41:360,42:e,43:y},{31:[1,361]},a(Ab,v,{72:362,73:Cb}),a(Aa,[2,137]),
|
||||
{33:wb,35:292,36:m,105:364,106:290,108:jb},a(Aa,[2,142],{107:[1,365]}),a(Aa,[2,144],{107:[1,366]}),{35:367,36:m},a(Ea,[2,148]),a(Ab,v,{72:368,73:Kb}),a(Aa,[2,157]),{33:Hb,35:299,36:m,108:sb,111:370,113:297},a(Aa,[2,162],{107:[1,371]}),a(Aa,[2,165]),{6:[1,373],7:372,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,33:[1,374],35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,
|
||||
65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(Lb,[2,154],{144:80,135:105,141:106,136:G,138:C,142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),{41:375,42:e,43:y},a(Ba,[2,204]),{6:xa,34:[1,376]},{7:377,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,
|
||||
20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a([14,30,36,40,42,43,46,47,50,51,52,53,54,55,63,64,65,66,70,71,86,97,100,102,110,
|
||||
120,121,122,128,132,133,136,138,140,142,152,158,160,161,162,163,164,165],Zb,{6:ub,33:ub,73:ub,123:ub}),{6:Db,33:Eb,123:[1,378]},a([6,33,34,118,123],tb,{17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,12:20,13:21,15:23,16:24,56:27,49:28,82:29,83:30,84:31,85:32,69:35,80:43,157:44,135:46,139:47,141:48,77:57,78:58,39:59,45:61,35:73,62:74,144:80,41:83,8:140,79:188,7:263,126:381,14:g,30:ga,36:m,40:c,42:e,43:y,46:D,47:w,50:z,51:l,52:E,53:A,54:B,55:J,63:p,64:fa,65:h,66:n,70:u,71:t,
|
||||
76:Ga,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,136:G,138:C,140:Z,142:F,152:ca,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X}),a(bb,v,{72:382,73:xb}),a(dc,[2,247]),{7:383,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,
|
||||
102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:384,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,
|
||||
122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:385,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,
|
||||
135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(yb,[2,223]),{35:201,36:m,62:202,77:203,78:204,97:x,121:Ja,122:Ma,148:386},a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,138,142,159],[2,230],{144:80,135:105,141:106,137:[1,387],143:[1,388],162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Mb,[2,231],{144:80,135:105,141:106,137:[1,389],162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,
|
||||
171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Mb,[2,237],{144:80,135:105,141:106,137:[1,390],162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),{6:ec,33:fc,99:[1,391]},a(Nb,tb,{41:83,59:211,61:212,13:213,39:214,35:215,37:216,62:217,58:394,36:m,38:La,40:c,42:e,43:y,65:h,121:Ja}),{7:395,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,33:[1,396],35:73,36:m,39:59,40:c,41:83,42:e,43:y,
|
||||
45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:397,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,33:[1,398],35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,
|
||||
47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(Ba,[2,41]),a(Va,[2,39]),a(lb,[2,172]),a([6,33,118],v,{72:399,73:xb}),a(Ka,[2,112]),{7:400,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,
|
||||
29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,89:[2,183],97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{89:[2,184],135:105,136:G,138:C,141:106,142:F,144:80,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,
|
||||
173:ea,174:N,175:qa,176:va,177:na},a(Pa,[2,51],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),{34:[1,401],135:105,136:G,138:C,141:106,142:F,144:80,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na},a(Ba,[2,105]),{32:402,33:Ca},a(d,[2,79]),{35:130,36:m,62:131,74:403,75:128,76:db,77:132,78:133,97:x,121:Ja,122:Ma},a(gc,Ta,{74:127,75:128,35:130,62:131,77:132,78:133,67:404,36:m,
|
||||
76:db,97:x,121:Ja,122:Ma}),a(d,[2,84],{144:80,135:105,141:106,136:G,138:C,142:F,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(ab,ub),a(bc,[2,33]),{34:[1,405],135:105,136:G,138:C,141:106,142:F,144:80,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na},a(Pa,[2,278],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),{32:406,
|
||||
33:Ca,135:105,136:G,138:C,141:106,142:F,144:80,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na},{32:407,33:Ca},a(wa,[2,198]),{32:408,33:Ca},{32:409,33:Ca},a(Ob,[2,202]),{34:[1,410],154:[1,411],155:352,156:vb},a(wa,[2,241]),{32:412,33:Ca},a(Bb,[2,244]),{32:413,33:Ca,73:[1,414]},a(hc,[2,194],{144:80,135:105,141:106,136:G,138:C,142:F,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(wa,[2,
|
||||
125]),a(cc,[2,128],{144:80,135:105,141:106,32:415,33:Ca,136:G,138:C,142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Ea,[2,131]),{31:[1,416]},{33:wb,35:292,36:m,105:417,106:290,108:jb},a(Ea,[2,132]),{41:418,42:e,43:y},{6:Fb,33:Gb,99:[1,419]},a(Nb,tb,{35:292,106:422,36:m,108:jb}),a(bb,v,{72:423,73:Cb}),{35:424,36:m},{35:425,36:m},{31:[2,147]},{6:Pb,33:Qb,99:[1,426]},a(Nb,tb,{35:299,113:429,36:m,108:sb}),a(bb,v,{72:430,73:Kb}),{35:431,36:m,108:[1,
|
||||
432]},a(Lb,[2,151],{144:80,135:105,141:106,136:G,138:C,142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),{7:433,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,
|
||||
122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:434,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,
|
||||
135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(Ea,[2,155]),{134:[1,435]},{123:[1,436],135:105,136:G,138:C,141:106,142:F,144:80,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na},a(Ib,[2,178]),{7:263,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,
|
||||
52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,76:Ga,77:57,78:58,79:188,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,126:437,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:263,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,33:Za,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,
|
||||
51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,76:Ga,77:57,78:58,79:188,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,119:438,120:Q,121:R,122:M,126:186,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(ab,[2,187]),{6:Db,33:Eb,34:[1,439]},a(kb,[2,207],{144:80,135:105,141:106,136:G,138:C,142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,
|
||||
177:na}),a(kb,[2,209],{144:80,135:105,141:106,136:G,138:C,142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(kb,[2,220],{144:80,135:105,141:106,136:G,138:C,142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(yb,[2,229]),{7:440,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,
|
||||
47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:441,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,
|
||||
53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:442,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,
|
||||
63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:443,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,
|
||||
70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(Ib,[2,116]),{13:213,35:215,36:m,37:216,38:La,39:214,40:c,41:83,42:e,43:y,58:444,59:211,61:212,62:217,65:h,121:Ja},a(gc,nb,{41:83,58:210,59:211,61:212,13:213,39:214,35:215,37:216,62:217,98:445,36:m,38:La,40:c,42:e,43:y,65:h,121:Ja}),a(Aa,[2,119]),a(Aa,[2,54],{144:80,135:105,
|
||||
141:106,136:G,138:C,142:F,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),{7:446,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,
|
||||
136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(Aa,[2,56],{144:80,135:105,141:106,136:G,138:C,142:F,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),{7:447,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,
|
||||
66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{6:Db,33:Eb,118:[1,448]},{89:[2,182],135:105,136:G,138:C,141:106,142:F,144:80,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na},a(wa,[2,52]),a(wa,[2,71]),a(d,[2,80]),a(bb,v,{72:449,73:L}),a(wa,[2,277]),a(dc,[2,
|
||||
248]),a(wa,[2,199]),a(Ob,[2,200]),a(Ob,[2,201]),a(wa,[2,239]),{32:450,33:Ca},{34:[1,451]},a(Bb,[2,245],{6:[1,452]}),{7:453,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,
|
||||
139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},a(wa,[2,129]),{41:454,42:e,43:y},a(Ab,v,{72:455,73:Cb}),a(Ea,[2,133]),{31:[1,456]},{35:292,36:m,106:457,108:jb},{33:wb,35:292,36:m,105:458,106:290,108:jb},a(Aa,[2,138]),{6:Fb,33:Gb,34:[1,459]},a(Aa,[2,143]),a(Aa,[2,145]),a(Ea,[2,149],{31:[1,460]}),{35:299,36:m,108:sb,113:461},{33:Hb,35:299,36:m,108:sb,111:462,113:297},a(Aa,[2,158]),{6:Pb,33:Qb,34:[1,463]},a(Aa,[2,163]),a(Aa,[2,164]),a(Lb,[2,152],{144:80,135:105,
|
||||
141:106,136:G,138:C,142:F,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),{34:[1,464],135:105,136:G,138:C,141:106,142:F,144:80,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na},a(Ba,[2,205]),a(Ba,[2,181]),a(ab,[2,188]),a(bb,v,{72:465,73:xb}),a(ab,[2,189]),a([1,6,33,34,44,68,73,76,89,99,118,123,125,134,136,137,138,142,159],[2,232],{144:80,135:105,141:106,143:[1,466],162:la,163:ma,166:I,167:ja,168:da,
|
||||
169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Mb,[2,234],{144:80,135:105,141:106,137:[1,467],162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Pa,[2,233],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Pa,[2,238],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Aa,[2,120]),a(bb,v,
|
||||
{72:468,73:Vb}),{34:[1,469],135:105,136:G,138:C,141:106,142:F,144:80,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na},{34:[1,470],135:105,136:G,138:C,141:106,142:F,144:80,159:za,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na},a(lb,[2,173]),{6:$b,33:ac,34:[1,471]},{34:[1,472]},a(wa,[2,242]),a(Bb,[2,246]),a(hc,[2,195],{144:80,135:105,141:106,136:G,138:C,142:F,159:za,162:la,163:ma,166:I,167:ja,168:da,
|
||||
169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Ea,[2,135]),{6:Fb,33:Gb,99:[1,473]},{41:474,42:e,43:y},a(Aa,[2,139]),a(bb,v,{72:475,73:Cb}),a(Aa,[2,140]),{41:476,42:e,43:y},a(Aa,[2,159]),a(bb,v,{72:477,73:Kb}),a(Aa,[2,160]),a(Ea,[2,153]),{6:Db,33:Eb,34:[1,478]},{7:479,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,
|
||||
63:p,64:fa,65:h,66:n,69:35,70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{7:480,8:140,12:20,13:21,14:g,15:23,16:24,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:ga,35:73,36:m,39:59,40:c,41:83,42:e,43:y,45:61,46:D,47:w,49:28,50:z,51:l,52:E,53:A,54:B,55:J,56:27,62:74,63:p,64:fa,65:h,66:n,69:35,
|
||||
70:u,71:t,77:57,78:58,80:43,82:29,83:30,84:31,85:32,86:H,97:x,100:r,102:W,110:T,120:Q,121:R,122:M,128:U,132:O,133:P,135:46,136:G,138:C,139:47,140:Z,141:48,142:F,144:80,152:ca,157:44,158:S,160:V,161:K,162:aa,163:ba,164:Y,165:X},{6:ec,33:fc,34:[1,481]},a(Aa,[2,55]),a(Aa,[2,57]),a(d,[2,81]),a(wa,[2,240]),{31:[1,482]},a(Ea,[2,134]),{6:Fb,33:Gb,34:[1,483]},a(Ea,[2,156]),{6:Pb,33:Qb,34:[1,484]},a(ab,[2,190]),a(Pa,[2,235],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,
|
||||
173:ea,174:N,175:qa,176:va,177:na}),a(Pa,[2,236],{144:80,135:105,141:106,162:la,163:ma,166:I,167:ja,168:da,169:oa,170:ia,171:ka,172:pa,173:ea,174:N,175:qa,176:va,177:na}),a(Aa,[2,121]),{41:485,42:e,43:y},a(Aa,[2,141]),a(Aa,[2,161]),a(Ea,[2,136])],defaultActions:{71:[2,73],72:[2,74],246:[2,115],367:[2,147]},parseError:function(a,d){if(d.recoverable)this.trace(a);else{var b=function(a,d){this.message=a;this.hash=d};b.prototype=Error;throw new b(a,d);}},parse:function(a){var d=[0],b=[null],f=[],v=this.table,
|
||||
L="",c=0,e=0,h=0,g=f.slice.call(arguments,1),l=Object.create(this.lexer),Wa={},n;for(n in this.yy)Object.prototype.hasOwnProperty.call(this.yy,n)&&(Wa[n]=this.yy[n]);l.setInput(a,Wa);Wa.lexer=l;Wa.parser=this;"undefined"==typeof l.yylloc&&(l.yylloc={});n=l.yylloc;f.push(n);var k=l.options&&l.options.ranges;this.parseError="function"===typeof Wa.parseError?Wa.parseError:Object.getPrototypeOf(this).parseError;for(var Da,p,m,u,t={},x,r;;){m=d[d.length-1];if(this.defaultActions[m])u=this.defaultActions[m];
|
||||
else{if(null===Da||"undefined"==typeof Da)Da=l.lex()||1,"number"!==typeof Da&&(Da=this.symbols_[Da]||Da);u=v[m]&&v[m][Da]}if("undefined"===typeof u||!u.length||!u[0]){var rb;r=[];for(x in v[m])this.terminals_[x]&&2<x&&r.push("'"+this.terminals_[x]+"'");rb=l.showPosition?"Parse error on line "+(c+1)+":\n"+l.showPosition()+"\nExpecting "+r.join(", ")+", got '"+(this.terminals_[Da]||Da)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==Da?"end of input":"'"+(this.terminals_[Da]||Da)+"'");this.parseError(rb,
|
||||
{text:l.match,token:this.terminals_[Da]||Da,line:l.yylineno,loc:n,expected:r})}if(u[0]instanceof Array&&1<u.length)throw Error("Parse Error: multiple actions possible at state: "+m+", token: "+Da);switch(u[0]){case 1:d.push(Da);b.push(l.yytext);f.push(l.yylloc);d.push(u[1]);Da=null;p?(Da=p,p=null):(e=l.yyleng,L=l.yytext,c=l.yylineno,n=l.yylloc,0<h&&h--);break;case 2:r=this.productions_[u[1]][1];t.$=b[b.length-r];t._$={first_line:f[f.length-(r||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-
|
||||
(r||1)].first_column,last_column:f[f.length-1].last_column};k&&(t._$.range=[f[f.length-(r||1)].range[0],f[f.length-1].range[1]]);m=this.performAction.apply(t,[L,e,c,Wa,u[1],b,f].concat(g));if("undefined"!==typeof m)return m;r&&(d=d.slice(0,-2*r),b=b.slice(0,-1*r),f=f.slice(0,-1*r));d.push(this.productions_[u[1]][0]);b.push(t.$);f.push(t._$);u=v[d[d.length-2]][d[d.length-1]];d.push(u);break;case 3:return!0}}}};k.prototype=ic;ic.Parser=k;return new k}();"undefined"!==typeof q&&"undefined"!==typeof k&&
|
||||
(k.parser=sa,k.Parser=sa.Parser,k.parse=function(){return sa.parse.apply(sa,arguments)},k.main=function(ha){ha[1]||(console.log("Usage: "+ha[0]+" FILE"),process.exit(1));var a="",g=q("fs");"undefined"!==typeof g&&null!==g&&(a=g.readFileSync(q("path").normalize(ha[1]),"utf8"));return k.parser.parse(a)},"undefined"!==typeof xa&&q.main===xa&&k.main(process.argv.slice(1)));return xa.exports}();q["./scope"]=function(){var k={};(function(){var q=[].indexOf||function(k){for(var a=0,g=this.length;a<g;a++)if(a in
|
||||
this&&this[a]===k)return a;return-1},sa=function(k,a,g,q){var m,c;this.parent=k;this.expressions=a;this.method=g;this.referencedVars=q;this.variables=[{name:"arguments",type:"arguments"}];this.positions={};this.parent||(this.utilities={});this.root=null!=(m=null!=(c=this.parent)?c.root:void 0)?m:this};sa.prototype.add=function(k,a,g){return this.shared&&!g?this.parent.add(k,a,g):Object.prototype.hasOwnProperty.call(this.positions,k)?this.variables[this.positions[k]].type=a:this.positions[k]=this.variables.push({name:k,
|
||||
type:a})-1};sa.prototype.namedMethod=function(){var k;return null!=(k=this.method)&&k.name||!this.parent?this.method:this.parent.namedMethod()};sa.prototype.find=function(k,a){a=void 0===a?"var":a;if(this.check(k))return!0;this.add(k,a);return!1};sa.prototype.parameter=function(k){if(!this.shared||!this.parent.check(k,!0))return this.add(k,"param")};sa.prototype.check=function(k){var a;return!!(this.type(k)||null!=(a=this.parent)&&a.check(k))};sa.prototype.temporary=function(k,a,g){return(void 0===
|
||||
g?0:g)?(g=k.charCodeAt(0),k=122-g,g=String.fromCharCode(g+a%(k+1)),a=Math.floor(a/(k+1)),""+g+(a||"")):""+k+(a||"")};sa.prototype.type=function(k){var a,g,q,m;q=this.variables;a=0;for(g=q.length;a<g;a++)if(m=q[a],m.name===k)return m.type;return null};sa.prototype.freeVariable=function(k,a){a=void 0===a?{}:a;var g,ha,m;for(g=0;;){m=this.temporary(k,g,a.single);if(!(this.check(m)||0<=q.call(this.root.referencedVars,m)))break;g++}(null!=(ha=a.reserve)?ha:1)&&this.add(m,"var",!0);return m};sa.prototype.assign=
|
||||
function(k,a){this.add(k,{value:a,assigned:!0},!0);return this.hasAssignments=!0};sa.prototype.hasDeclarations=function(){return!!this.declaredVariables().length};sa.prototype.declaredVariables=function(){var k,a,g,q,m;q=this.variables;m=[];a=0;for(g=q.length;a<g;a++)k=q[a],"var"===k.type&&m.push(k.name);return m.sort()};sa.prototype.assignedVariables=function(){var k,a,g,q,m;g=this.variables;q=[];k=0;for(a=g.length;k<a;k++)m=g[k],m.type.assigned&&q.push(m.name+" \x3d "+m.type.value);return q};k.Scope=
|
||||
sa}).call(this);return k}();q["./nodes"]=function(){var k={};(function(){var xa,sa,ha,a,g,ta,m,c,e,y,D,w,z,l,E,A,B,J,p,ua,h,n,u,t,H,x,r,W,T,Q,R,M,U,O,P,G,C,Z,F,ca,S,V,K,aa,ba,Y,X,ra,Na,za,la,ma,I,ja,da,oa,ia,ka,pa,ea,N,qa,va,na,Rb,wa,Qa,Xa,Ha,Ya,cb,Ra,Ia,Fa=[].indexOf||function(a){for(var b=0,L=this.length;b<L;b++)if(b in this&&this[b]===a)return b;return-1},Ea=[].slice;Error.stackTraceLimit=Infinity;S=q("./scope").Scope;Xa=q("./lexer");na=Xa.isUnassignable;ua=Xa.JS_FORBIDDEN;Ha=q("./helpers");ia=
|
||||
Ha.compact;ea=Ha.flatten;pa=Ha.extend;wa=Ha.merge;ka=Ha.del;oa=Ha.addLocationDataFn;Rb=Ha.locationDataToString;cb=Ha.throwSyntaxError;k.extend=pa;k.addLocationDataFn=oa;da=function(){return!0};M=function(){return!1};Na=function(){return this};R=function(){this.negated=!this.negated;return this};var Ba=function(a,v){var b;this.code=""+v;this.locationData=null!=a?a.locationData:void 0;this.type=(null!=a?null!=(b=a.constructor)?b.name:void 0:void 0)||"unknown"};Ba.prototype.toString=function(){return""+
|
||||
this.code+(this.locationData?": "+Rb(this.locationData):"")};k.CodeFragment=Ba;N=function(a){var b,L,d,f;f=[];L=0;for(d=a.length;L<d;L++)b=a[L],f.push(b.code);return f.join("")};k.Base=a=function(){var a=function(){};a.prototype.compile=function(a,b){return N(this.compileToFragments(a,b))};a.prototype.compileToFragments=function(a,b){a=pa({},a);b&&(a.level=b);b=this.unfoldSoak(a)||this;b.tab=a.indent;return a.level!==x&&b.isStatement(a)?b.compileClosure(a):b.compileNode(a)};a.prototype.compileClosure=
|
||||
function(a){var b,d,f,v,e;(f=this.jumps())&&f.error("cannot use a pure statement in an expression");a.sharedScope=!0;f=new c([],g.wrap([this]));b=[];if(this.contains(function(a){return a instanceof X}))f.bound=!0;else if((d=this.contains(qa))||this.contains(va))b=[new za],d?(d="apply",b.push(new A("arguments"))):d="call",f=new I(f,[new xa(new C(d))]);a=(new ta(f,b)).compileNode(a);switch(!1){case !(f.isGenerator||null!=(v=f.base)&&v.isGenerator):a.unshift(this.makeCode("(yield* "));a.push(this.makeCode(")"));
|
||||
break;case !(f.isAsync||null!=(e=f.base)&&e.isAsync):a.unshift(this.makeCode("(await ")),a.push(this.makeCode(")"))}return a};a.prototype.cache=function(a,b,d){var f;if(null!=d?d(this):this.shouldCache())return d=new A(a.scope.freeVariable("ref")),f=new ha(d,this),b?[f.compileToFragments(a,b),[this.makeCode(d.value)]]:[f,d];d=b?this.compileToFragments(a,b):this;return[d,d]};a.prototype.hoist=function(){var a,b,d;this.hoisted=!0;d=new E(this);a=this.compileNode;b=this.compileToFragments;this.compileNode=
|
||||
function(b){return d.update(a,b)};this.compileToFragments=function(a){return d.update(b,a)};return d};a.prototype.cacheToCodeFragments=function(a){return[N(a[0]),N(a[1])]};a.prototype.makeReturn=function(a){var b;b=this.unwrapAll();return a?new ta(new r(a+".push"),[b]):new F(b)};a.prototype.contains=function(a){var b;b=void 0;this.traverseChildren(!1,function(d){if(a(d))return b=d,!1});return b};a.prototype.lastNonComment=function(a){var b;for(b=a.length;b--;)if(!(a[b]instanceof e))return a[b];return null};
|
||||
a.prototype.toString=function(a,b){a=void 0===a?"":a;b=void 0===b?this.constructor.name:b;var d;d="\n"+a+b;this.soak&&(d+="?");this.eachChild(function(b){return d+=b.toString(a+ra)});return d};a.prototype.eachChild=function(a){var b,d,f,v,c,e,h;if(!this.children)return this;e=this.children;d=0;for(v=e.length;d<v;d++)if(b=e[d],this[b])for(h=ea([this[b]]),f=0,c=h.length;f<c;f++)if(b=h[f],!1===a(b))return this;return this};a.prototype.traverseChildren=function(a,b){return this.eachChild(function(d){if(!1!==
|
||||
b(d))return d.traverseChildren(a,b)})};a.prototype.replaceInContext=function(a,b){var d,f,v,L,c,e,h,g;if(!this.children)return!1;g=this.children;L=0;for(e=g.length;L<e;L++)if(d=g[L],f=this[d])if(Array.isArray(f))for(v=c=0,h=f.length;c<h;v=++c){d=f[v];if(a(d))return[].splice.apply(f,[v,v-v+1].concat(a=b(d,this))),a,!0;if(d.replaceInContext(a,b))return!0}else{if(a(f))return this[d]=b(f,this),!0;if(f.replaceInContext(a,b))return!0}};a.prototype.invert=function(){return new O("!",this)};a.prototype.unwrapAll=
|
||||
function(){var a;for(a=this;a!==(a=a.unwrap()););return a};a.prototype.updateLocationDataIfMissing=function(a){if(this.locationData)return this;this.locationData=a;return this.eachChild(function(b){return b.updateLocationDataIfMissing(a)})};a.prototype.error=function(a){return cb(a,this.locationData)};a.prototype.makeCode=function(a){return new Ba(this,a)};a.prototype.wrapInBraces=function(a){return[].concat(this.makeCode("("),a,this.makeCode(")"))};a.prototype.joinFragmentArrays=function(a,b){var d,
|
||||
f,L,v,c;d=[];L=v=0;for(c=a.length;v<c;L=++v)f=a[L],L&&d.push(this.makeCode(b)),d=d.concat(f);return d};a.prototype.children=[];a.prototype.isStatement=M;a.prototype.jumps=M;a.prototype.shouldCache=da;a.prototype.isChainable=M;a.prototype.isAssignable=M;a.prototype.isNumber=M;a.prototype.unwrap=Na;a.prototype.unfoldSoak=M;a.prototype.assigns=M;return a}();var Sa=function(b){var v;v=a.call(this)||this;v.source=b;v.options={};v.targetFragments={fragments:[]};return v};$jscomp.inherits(Sa,a);Sa.expand=
|
||||
function(a){var b,L,d;for(L=d=a.length-1;0<=d;L=d+=-1)b=a[L],b.fragments&&([].splice.apply(a,[L,L-L+1].concat(b=this.expand(b.fragments))),b);return a};Sa.prototype.isStatement=function(a){return this.source.isStatement(a)};Sa.prototype.update=function(a,v){return this.targetFragments.fragments=a.call(this.source,wa(v,this.options))};Sa.prototype.compileToFragments=function(a,v){this.options.indent=a.indent;this.options.level=null!=v?v:a.level;return[this.targetFragments]};Sa.prototype.compileNode=
|
||||
function(a){return this.compileToFragments(a)};Sa.prototype.compileClosure=function(a){return this.compileToFragments(a)};k.HoistTarget=E=Sa;k.Block=g=function(){var b=function(b){var L;L=a.call(this)||this;L.expressions=ia(ea(b||[]));return L};$jscomp.inherits(b,a);b.prototype.push=function(a){this.expressions.push(a);return this};b.prototype.pop=function(){return this.expressions.pop()};b.prototype.unshift=function(a){this.expressions.unshift(a);return this};b.prototype.unwrap=function(){return 1===
|
||||
this.expressions.length?this.expressions[0]:this};b.prototype.isEmpty=function(){return!this.expressions.length};b.prototype.isStatement=function(a){var b,d,f,v;v=this.expressions;d=0;for(f=v.length;d<f;d++)if(b=v[d],b.isStatement(a))return!0;return!1};b.prototype.jumps=function(a){var b,d,f,v;v=this.expressions;d=0;for(f=v.length;d<f;d++)if(b=v[d],b=b.jumps(a))return b};b.prototype.makeReturn=function(a){var b,d;for(d=this.expressions.length;d--;)if(b=this.expressions[d],!(b instanceof e)){this.expressions[d]=
|
||||
b.makeReturn(a);b instanceof F&&!b.expression&&this.expressions.splice(d,1);break}return this};b.prototype.compileToFragments=function(b,L){b=void 0===b?{}:b;return b.scope?a.prototype.compileToFragments.call(this,b,L):this.compileRoot(b)};b.prototype.compileNode=function(a){var L,d,f,v,c,e,h;this.tab=a.indent;h=a.level===x;d=[];e=this.expressions;f=L=0;for(v=e.length;L<v;f=++L)c=e[f],c=c.unwrapAll(),c=c.unfoldSoak(a)||c,c instanceof b?d.push(c.compileNode(a)):c.hoisted?c.compileToFragments(a):h?
|
||||
(c.front=!0,f=c.compileToFragments(a),c.isStatement(a)||(f.unshift(this.makeCode(""+this.tab)),f.push(this.makeCode(";"))),d.push(f)):d.push(c.compileToFragments(a,u));if(h)return this.spaced?[].concat(this.joinFragmentArrays(d,"\n\n"),this.makeCode("\n")):this.joinFragmentArrays(d,"\n");L=d.length?this.joinFragmentArrays(d,", "):[this.makeCode("void 0")];return 1<d.length&&a.level>=u?this.wrapInBraces(L):L};b.prototype.compileRoot=function(a){var b,d,f,v,c;a.indent=a.bare?"":ra;a.level=x;this.spaced=
|
||||
!0;a.scope=new S(null,this,null,null!=(f=a.referencedVars)?f:[]);c=a.locals||[];f=0;for(d=c.length;f<d;f++)v=c[f],a.scope.parameter(v);f=[];if(!a.bare){var h;h=this.expressions;d=[];b=v=0;for(c=h.length;v<c;b=++v){b=h[b];if(!(b.unwrap()instanceof e))break;d.push(b)}v=this.expressions.slice(d.length);this.expressions=d;d.length&&(f=this.compileNode(wa(a,{indent:""})),f.push(this.makeCode("\n")));this.expressions=v}d=this.compileWithDeclarations(a);E.expand(d);return a.bare?d:[].concat(f,this.makeCode("(function() {\n"),
|
||||
d,this.makeCode("\n}).call(this);\n"))};b.prototype.compileWithDeclarations=function(a){var b,d,f,v,c,h;f=[];h=this.expressions;v=c=0;for(b=h.length;c<b&&(d=h[v],d=d.unwrap(),d instanceof e||d instanceof r);v=++c);a=wa(a,{level:x});v&&(d=this.expressions.splice(v,9E9),f=[this.spaced,!1],c=f[0],this.spaced=f[1],c=[this.compileNode(a),c],f=c[0],this.spaced=c[1],this.expressions=d);d=this.compileNode(a);c=a.scope;c.expressions===this&&(b=a.scope.hasDeclarations(),a=c.hasAssignments,b||a?(v&&f.push(this.makeCode("\n")),
|
||||
f.push(this.makeCode(this.tab+"var ")),b&&f.push(this.makeCode(c.declaredVariables().join(", "))),a&&(b&&f.push(this.makeCode(",\n"+(this.tab+ra))),f.push(this.makeCode(c.assignedVariables().join(",\n"+(this.tab+ra))))),f.push(this.makeCode(";\n"+(this.spaced?"\n":"")))):f.length&&d.length&&f.push(this.makeCode("\n")));return f.concat(d)};b.wrap=function(a){return 1===a.length&&a[0]instanceof b?a[0]:new b(a)};b.prototype.children=["expressions"];return b}();k.Literal=r=function(){var b=function(b){var L;
|
||||
L=a.call(this)||this;L.value=b;return L};$jscomp.inherits(b,a);b.prototype.assigns=function(a){return a===this.value};b.prototype.compileNode=function(a){return[this.makeCode(this.value)]};b.prototype.toString=function(){return" "+(this.isStatement()?a.prototype.toString.call(this):this.constructor.name)+": "+this.value};b.prototype.shouldCache=M;return b}();var Ta=function(a){return r.apply(this,arguments)||this};$jscomp.inherits(Ta,r);k.NumberLiteral=Ta;var db=function(a){return Ta.apply(this,arguments)||
|
||||
this};$jscomp.inherits(db,Ta);db.prototype.compileNode=function(){return[this.makeCode("2e308")]};k.InfinityLiteral=db;var Ja=function(){return Ta.call(this,"NaN")||this};$jscomp.inherits(Ja,Ta);Ja.prototype.compileNode=function(a){var b;b=[this.makeCode("0/0")];return a.level>=t?this.wrapInBraces(b):b};k.NaNLiteral=Ja;var Ma=function(a){return r.apply(this,arguments)||this};$jscomp.inherits(Ma,r);k.StringLiteral=Ma;var Ca=function(a){return r.apply(this,arguments)||this};$jscomp.inherits(Ca,r);k.RegexLiteral=
|
||||
Ca;var ga=function(a){return r.apply(this,arguments)||this};$jscomp.inherits(ga,r);k.PassthroughLiteral=ga;k.IdentifierLiteral=A=function(){var a=function(a){return r.apply(this,arguments)||this};$jscomp.inherits(a,r);a.prototype.isAssignable=da;return a}();k.PropertyName=C=function(){var a=function(a){return r.apply(this,arguments)||this};$jscomp.inherits(a,r);a.prototype.isAssignable=da;return a}();k.StatementLiteral=aa=function(){var a=function(a){return r.apply(this,arguments)||this};$jscomp.inherits(a,
|
||||
r);a.prototype.jumps=function(a){if("break"===this.value&&!(null!=a&&a.loop||null!=a&&a.block)||"continue"===this.value&&(null==a||!a.loop))return this};a.prototype.compileNode=function(a){return[this.makeCode(""+this.tab+this.value+";")]};a.prototype.isStatement=da;a.prototype.makeReturn=Na;return a}();var fa=function(){return r.call(this,"this")||this};$jscomp.inherits(fa,r);fa.prototype.compileNode=function(a){var b;a=null!=(b=a.scope.method)&&b.bound?a.scope.method.context:this.value;return[this.makeCode(a)]};
|
||||
k.ThisLiteral=za=fa;var Ua=function(){return r.call(this,"undefined")||this};$jscomp.inherits(Ua,r);Ua.prototype.compileNode=function(a){return[this.makeCode(a.level>=h?"(void 0)":"void 0")]};k.UndefinedLiteral=Ua;var ya=function(){return r.call(this,"null")||this};$jscomp.inherits(ya,r);k.NullLiteral=ya;var gb=function(a){return r.apply(this,arguments)||this};$jscomp.inherits(gb,r);k.BooleanLiteral=gb;k.Return=F=function(){var b=function(b){var L;L=a.call(this)||this;L.expression=b;return L};$jscomp.inherits(b,
|
||||
a);b.prototype.compileToFragments=function(v,L){var d,f;d=null!=(f=this.expression)?f.makeReturn():void 0;return!d||d instanceof b?a.prototype.compileToFragments.call(this,v,L):d.compileToFragments(v,L)};b.prototype.compileNode=function(a){var b;b=[];b.push(this.makeCode(this.tab+("return"+(this.expression?" ":""))));this.expression&&(b=b.concat(this.expression.compileToFragments(a,H)));b.push(this.makeCode(";"));return b};b.prototype.children=["expression"];b.prototype.isStatement=da;b.prototype.makeReturn=
|
||||
Na;b.prototype.jumps=Na;return b}();var eb=function(a){return F.apply(this,arguments)||this};$jscomp.inherits(eb,F);eb.prototype.compileNode=function(a){null==a.scope.parent&&this.error("yield can only occur inside functions");return F.prototype.compileNode.call(this,a)};k.YieldReturn=eb;var fb=function(a){return F.apply(this,arguments)||this};$jscomp.inherits(fb,F);fb.prototype.compileNode=function(a){null==a.scope.parent&&this.error("await can only occur inside functions");return F.prototype.compileNode.call(this,
|
||||
a)};k.AwaitReturn=fb;k.Value=I=function(){var b=function(v,L,d){var f;if(!L&&v instanceof b)return v;f=a.call(this)||this;f.base=v;f.properties=L||[];d&&(f[d]=!0);return f};$jscomp.inherits(b,a);b.prototype.add=function(a){this.properties=this.properties.concat(a);return this};b.prototype.hasProperties=function(){return!!this.properties.length};b.prototype.bareLiteral=function(a){return!this.properties.length&&this.base instanceof a};b.prototype.isArray=function(){return this.bareLiteral(sa)};b.prototype.isRange=
|
||||
function(){return this.bareLiteral(Z)};b.prototype.shouldCache=function(){return this.hasProperties()||this.base.shouldCache()};b.prototype.isAssignable=function(){return this.hasProperties()||this.base.isAssignable()};b.prototype.isNumber=function(){return this.bareLiteral(Ta)};b.prototype.isString=function(){return this.bareLiteral(Ma)};b.prototype.isRegex=function(){return this.bareLiteral(Ca)};b.prototype.isUndefined=function(){return this.bareLiteral(Ua)};b.prototype.isNull=function(){return this.bareLiteral(ya)};
|
||||
b.prototype.isBoolean=function(){return this.bareLiteral(gb)};b.prototype.isAtomic=function(){var a,b,d,f;f=this.properties.concat(this.base);a=0;for(b=f.length;a<b;a++)if(d=f[a],d.soak||d instanceof ta)return!1;return!0};b.prototype.isNotCallable=function(){return this.isNumber()||this.isString()||this.isRegex()||this.isArray()||this.isRange()||this.isSplice()||this.isObject()||this.isUndefined()||this.isNull()||this.isBoolean()};b.prototype.isStatement=function(a){return!this.properties.length&&
|
||||
this.base.isStatement(a)};b.prototype.assigns=function(a){return!this.properties.length&&this.base.assigns(a)};b.prototype.jumps=function(a){return!this.properties.length&&this.base.jumps(a)};b.prototype.isObject=function(a){return this.properties.length?!1:this.base instanceof U&&(!a||this.base.generated)};b.prototype.isSplice=function(){var a;a=this.properties;return a[a.length-1]instanceof V};b.prototype.looksStatic=function(a){var b;return(this["this"]||this.base instanceof za||this.base.value===
|
||||
a)&&1===this.properties.length&&"prototype"!==(null!=(b=this.properties[0].name)?b.value:void 0)};b.prototype.unwrap=function(){return this.properties.length?this:this.base};b.prototype.cacheReference=function(a){var L,d,f,c;L=this.properties;f=L[L.length-1];if(2>this.properties.length&&!this.base.shouldCache()&&(null==f||!f.shouldCache()))return[this,this];L=new b(this.base,this.properties.slice(0,-1));L.shouldCache()&&(d=new A(a.scope.freeVariable("base")),L=new b(new G(new ha(d,L))));if(!f)return[L,
|
||||
d];f.shouldCache()&&(c=new A(a.scope.freeVariable("name")),f=new p(new ha(c,f.index)),c=new p(c));return[L.add(f),new b(d||L.base,[c||f])]};b.prototype.compileNode=function(a){var b,d,f,c,v;this.base.front=this.front;v=this.properties;b=this.base.compileToFragments(a,v.length?h:null);v.length&&ca.test(N(b))&&b.push(this.makeCode("."));d=0;for(f=v.length;d<f;d++)c=v[d],b.push.apply(b,[].concat($jscomp.arrayFromIterable(c.compileToFragments(a))));return b};b.prototype.unfoldSoak=function(a){var L=this;
|
||||
return null!=this.unfoldedSoak?this.unfoldedSoak:this.unfoldedSoak=function(){var d,f,c,v,e;if(f=L.base.unfoldSoak(a))return f.body.properties.push.apply(f.body.properties,[].concat($jscomp.arrayFromIterable(L.properties))),f;e=L.properties;f=d=0;for(c=e.length;d<c;f=++d)if(v=e[f],v.soak)return v.soak=!1,d=new b(L.base,L.properties.slice(0,f)),c=new b(L.base,L.properties.slice(f)),d.shouldCache()&&(f=new A(a.scope.freeVariable("ref")),d=new G(new ha(f,d)),c.base=f),new B(new D(d),c,{soak:!0});return!1}()};
|
||||
b.prototype.children=["base","properties"];return b}();k.Comment=e=function(){var b=function(b){var L;L=a.call(this)||this;L.comment=b;return L};$jscomp.inherits(b,a);b.prototype.compileNode=function(a,b){var d;d=this.comment.replace(/^(\s*)#(?=\s)/gm,"$1 *");d="/*"+Qa(d,this.tab)+(0<=Fa.call(d,"\n")?"\n"+this.tab:"")+" */";(b||a.level)===x&&(d=a.indent+d);return[this.makeCode("\n"),this.makeCode(d)]};b.prototype.isStatement=da;b.prototype.makeReturn=Na;return b}();k.Call=ta=function(){var b=function(b,
|
||||
L,d){var f;L=void 0===L?[]:L;f=a.call(this)||this;f.variable=b;f.args=L;f.soak=d;f.isNew=!1;f.variable instanceof I&&f.variable.isNotCallable()&&f.variable.error("literal is not a function");return f};$jscomp.inherits(b,a);b.prototype.updateLocationDataIfMissing=function(b){var L,d;this.locationData&&this.needsUpdatedStartLocation&&(this.locationData.first_line=b.first_line,this.locationData.first_column=b.first_column,L=(null!=(d=this.variable)?d.base:void 0)||this.variable,L.needsUpdatedStartLocation&&
|
||||
(this.variable.locationData.first_line=b.first_line,this.variable.locationData.first_column=b.first_column,L.updateLocationDataIfMissing(b)),delete this.needsUpdatedStartLocation);return a.prototype.updateLocationDataIfMissing.call(this,b)};b.prototype.newInstance=function(){var a,L;a=(null!=(L=this.variable)?L.base:void 0)||this.variable;a instanceof b&&!a.isNew?a.newInstance():this.isNew=!0;this.needsUpdatedStartLocation=!0;return this};b.prototype.unfoldSoak=function(a){var L,d,f,c,v;if(this.soak){if(this.variable instanceof
|
||||
Y)L=new r(this.variable.compile(a)),d=new I(L),null==this.variable.accessor&&this.variable.error("Unsupported reference to 'super'");else{if(d=Ra(a,this,"variable"))return d;d=(new I(this.variable)).cacheReference(a);L=d[0];d=d[1]}d=new b(d,this.args);d.isNew=this.isNew;L=new r("typeof "+L.compile(a)+' \x3d\x3d\x3d "function"');return new B(L,new I(d),{soak:!0})}L=this;for(f=[];;)if(L.variable instanceof b)f.push(L),L=L.variable;else{if(!(L.variable instanceof I))break;f.push(L);if(!((L=L.variable.base)instanceof
|
||||
b))break}v=f.reverse();f=0;for(c=v.length;f<c;f++)L=v[f],d&&(L.variable instanceof b?L.variable=d:L.variable.base=d),d=Ra(a,L,"variable");return d};b.prototype.compileNode=function(a){var b,d,f,c,v,e;null!=(f=this.variable)&&(f.front=this.front);f=[];e=this.args;d=c=0;for(v=e.length;c<v;d=++c)b=e[d],d&&f.push(this.makeCode(", ")),f.push.apply(f,[].concat($jscomp.arrayFromIterable(b.compileToFragments(a,u))));b=[];this.isNew&&(this.variable instanceof Y&&this.variable.error("Unsupported reference to 'super'"),
|
||||
b.push(this.makeCode("new ")));b.push.apply(b,[].concat($jscomp.arrayFromIterable(this.variable.compileToFragments(a,h))));b.push.apply(b,[].concat([this.makeCode("(")],$jscomp.arrayFromIterable(f),[this.makeCode(")")]));return b};b.prototype.children=["variable","args"];return b}();k.SuperCall=X=function(){var a=function(a){return ta.apply(this,arguments)||this};$jscomp.inherits(a,ta);a.prototype.isStatement=function(a){var b;return(null!=(b=this.expressions)?b.length:void 0)&&a.level===x};a.prototype.compileNode=
|
||||
function(a){var b,d,f;if(null==(d=this.expressions)||!d.length)return ta.prototype.compileNode.call(this,a);f=new r(N(ta.prototype.compileNode.call(this,a)));d=new g(this.expressions.slice());a.level>x&&(b=f.cache(a,null,da),f=b[0],b=b[1],d.push(b));d.unshift(f);return d.compileToFragments(a,a.level===x?a.level:u)};a.prototype.children=ta.prototype.children.concat(["expressions"]);return a}();k.Super=Y=function(){var b=function(b){var c;c=a.call(this)||this;c.accessor=b;return c};$jscomp.inherits(b,
|
||||
a);b.prototype.compileNode=function(a){var b,d;b=a.scope.namedMethod();null!=b&&b.isMethod||this.error("cannot use super outside of an instance method");this.inCtor=!!b.ctor;if(!this.inCtor&&null==this.accessor){b=b.name;if(b.shouldCache()||b instanceof p&&b.index.isAssignable())d=new A(a.scope.parent.freeVariable("name")),b.index=new ha(d,b.index);this.accessor=null!=d?new p(d):b}return(new I(new r("super"),this.accessor?[this.accessor]:[])).compileToFragments(a)};b.prototype.children=["accessor"];
|
||||
return b}();var Oa=function(a){a=void 0===a?[]:a;return ta.call(this,new I(new A("RegExp")),a,!1)||this};$jscomp.inherits(Oa,ta);k.RegexWithInterpolations=Oa;var hb=function(a,c,L){c instanceof Ma&&(c=new ba(g.wrap([new I(c)])));return ta.call(this,a,[c],L)||this};$jscomp.inherits(hb,ta);hb.prototype.compileNode=function(a){return this.variable.compileToFragments(a,h).concat(this.args[0].compileToFragments(a,u))};k.TaggedTemplateCall=hb;k.Extends=function(){var b=function(b,c){var d;d=a.call(this)||
|
||||
this;d.child=b;d.parent=c;return d};$jscomp.inherits(b,a);b.prototype.compileToFragments=function(a){return(new ta(new I(new r(Ia("extend",a))),[this.child,this.parent])).compileToFragments(a)};b.prototype.children=["child","parent"];return b}();k.Access=xa=function(){var b=function(b,c){var d;d=a.call(this)||this;d.name=b;d.soak="soak"===c;return d};$jscomp.inherits(b,a);b.prototype.compileToFragments=function(a){var b,d;a=this.name.compileToFragments(a);b=this.name.unwrap();return b instanceof C?
|
||||
(d=b.value,0<=Fa.call(ua,d))?[].concat([this.makeCode('["')],$jscomp.arrayFromIterable(a),[this.makeCode('"]')]):[].concat([this.makeCode(".")],$jscomp.arrayFromIterable(a)):[].concat([this.makeCode("[")],$jscomp.arrayFromIterable(a),[this.makeCode("]")])};b.prototype.children=["name"];b.prototype.shouldCache=M;return b}();k.Index=p=function(){var b=function(b){var c;c=a.call(this)||this;c.index=b;return c};$jscomp.inherits(b,a);b.prototype.compileToFragments=function(a){return[].concat(this.makeCode("["),
|
||||
this.index.compileToFragments(a,H),this.makeCode("]"))};b.prototype.shouldCache=function(){return this.index.shouldCache()};b.prototype.children=["index"];return b}();k.Range=Z=function(){var b=function(b,c,d){var f;f=a.call(this)||this;f.from=b;f.to=c;f.exclusive="exclusive"===d;f.equals=f.exclusive?"":"\x3d";return f};$jscomp.inherits(b,a);b.prototype.compileVariables=function(a){var b,d;a=wa(a,{top:!0});d=ka(a,"shouldCache");b=this.cacheToCodeFragments(this.from.cache(a,u,d));this.fromC=b[0];this.fromVar=
|
||||
b[1];b=this.cacheToCodeFragments(this.to.cache(a,u,d));this.toC=b[0];this.toVar=b[1];if(b=ka(a,"step"))a=this.cacheToCodeFragments(b.cache(a,u,d)),this.step=a[0],this.stepVar=a[1];this.fromNum=this.from.isNumber()?Number(this.fromVar):null;this.toNum=this.to.isNumber()?Number(this.toVar):null;return this.stepNum=null!=b&&b.isNumber()?Number(this.stepVar):null};b.prototype.compileNode=function(a){var b,d,f,c,v,e,h,g,l,k;this.fromVar||this.compileVariables(a);if(!a.index)return this.compileArray(a);
|
||||
e=null!=this.fromNum&&null!=this.toNum;v=ka(a,"index");h=(a=ka(a,"name"))&&a!==v;k=v+" \x3d "+this.fromC;this.toC!==this.toVar&&(k+=", "+this.toC);this.step!==this.stepVar&&(k+=", "+this.step);c=[v+" \x3c"+this.equals,v+" \x3e"+this.equals];d=c[0];c=c[1];d=null!=this.stepNum?0<this.stepNum?d+" "+this.toVar:c+" "+this.toVar:e?(g=[this.fromNum,this.toNum],f=g[0],l=g[1],g,f<=l?d+" "+l:c+" "+l):(b=this.stepVar?this.stepVar+" \x3e 0":this.fromVar+" \x3c\x3d "+this.toVar,b+" ? "+d+" "+this.toVar+" : "+
|
||||
c+" "+this.toVar);b=this.stepVar?v+" +\x3d "+this.stepVar:e?h?f<=l?"++"+v:"--"+v:f<=l?v+"++":v+"--":h?b+" ? ++"+v+" : --"+v:b+" ? "+v+"++ : "+v+"--";h&&(k=a+" \x3d "+k);h&&(b=a+" \x3d "+b);return[this.makeCode(k+"; "+d+"; "+b)]};b.prototype.compileArray=function(a){var b,d,f,c,v,e,h,g,l;if((d=null!=this.fromNum&&null!=this.toNum)&&20>=Math.abs(this.fromNum-this.toNum))return b=function(){g=[];for(var a=e=this.fromNum,d=this.toNum;e<=d?a<=d:a>=d;e<=d?a++:a--)g.push(a);return g}.apply(this),this.exclusive&&
|
||||
b.pop(),[this.makeCode("["+b.join(", ")+"]")];c=this.tab+ra;f=a.scope.freeVariable("i",{single:!0});h=a.scope.freeVariable("results");v="\n"+c+h+" \x3d [];";d?(a.index=f,d=N(this.compileNode(a))):(l=f+" \x3d "+this.fromC+(this.toC!==this.toVar?", "+this.toC:""),d=this.fromVar+" \x3c\x3d "+this.toVar,d="var "+l+"; "+d+" ? "+f+" \x3c"+this.equals+" "+this.toVar+" : "+f+" \x3e"+this.equals+" "+this.toVar+"; "+d+" ? "+f+"++ : "+f+"--");f="{ "+h+".push("+f+"); }\n"+c+"return "+h+";\n"+a.indent;a=function(a){return null!=
|
||||
a?a.contains(qa):void 0};if(a(this.from)||a(this.to))b=", arguments";return[this.makeCode("(function() {"+v+"\n"+c+"for ("+d+")"+f+"}).apply(this"+(null!=b?b:"")+")")]};b.prototype.children=["from","to"];return b}();k.Slice=V=function(){var b=function(b){var c;c=a.call(this)||this;c.range=b;return c};$jscomp.inherits(b,a);b.prototype.compileNode=function(a){var b,d,f,c,v;b=this.range;c=b.to;f=(b=b.from)&&b.compileToFragments(a,H)||[this.makeCode("0")];c&&(b=c.compileToFragments(a,H),d=N(b),this.range.exclusive||
|
||||
-1!==+d)&&(v=", "+(this.range.exclusive?d:c.isNumber()?""+(+d+1):(b=c.compileToFragments(a,h),"+"+N(b)+" + 1 || 9e9")));return[this.makeCode(".slice("+N(f)+(v||"")+")")]};b.prototype.children=["range"];return b}();k.Obj=U=function(){var b=function(b,c){var d;c=void 0===c?!1:c;d=a.call(this)||this;d.generated=c;d.objects=d.properties=b||[];return d};$jscomp.inherits(b,a);b.prototype.compileNode=function(a){var b,d,f,c,v,h,g,l,k,n;k=this.properties;if(this.generated)for(b=0,f=k.length;b<f;b++)v=k[b],
|
||||
v instanceof I&&v.error("cannot have an implicit value in an implicit object");f=a.indent+=ra;g=this.lastNonComment(this.properties);b=[];b.push(this.makeCode("{"+(0===k.length?"}":"\n")));d=v=0;for(l=k.length;v<l;d=++v)h=k[d],c=d===k.length-1?"":h===g||h instanceof e?"\n":",\n",d=h instanceof e?"":f,h instanceof ha&&("object"!==h.context&&h.operatorToken.error("unexpected "+h.operatorToken.value),h.variable instanceof I&&h.variable.hasProperties()&&h.variable.error("invalid object key")),h instanceof
|
||||
I&&h["this"]&&(h=new ha(h.properties[0].name,h,"object")),h instanceof e||h instanceof ha||(h.shouldCache()?(n=h.base.cache(a),h=n[0],n=n[1],h instanceof A&&(h=new C(h.value)),h=new ha(h,n,"object")):h=new ha(h,h,"object")),d&&b.push(this.makeCode(d)),b.push.apply(b,[].concat($jscomp.arrayFromIterable(h.compileToFragments(a,x)))),c&&b.push(this.makeCode(c));0!==k.length&&b.push(this.makeCode("\n"+this.tab+"}"));return this.front?this.wrapInBraces(b):b};b.prototype.assigns=function(a){var b,d,f,c;
|
||||
c=this.properties;b=0;for(d=c.length;b<d;b++)if(f=c[b],f.assigns(a))return!0;return!1};b.prototype.children=["properties"];return b}();k.Arr=sa=function(){var b=function(b){var c;c=a.call(this)||this;c.objects=b||[];return c};$jscomp.inherits(b,a);b.prototype.compileNode=function(a){var b,d,f,c,v;if(!this.objects.length)return[this.makeCode("[]")];a.indent+=ra;b=[];var e;v=this.objects;e=[];f=0;for(c=v.length;f<c;f++)d=v[f],e.push(d.compileToFragments(a,u));f=c=0;for(v=e.length;c<v;f=++c)d=e[f],f&&
|
||||
b.push(this.makeCode(", ")),b.push.apply(b,[].concat($jscomp.arrayFromIterable(d)));0<=N(b).indexOf("\n")?(b.unshift(this.makeCode("[\n"+a.indent)),b.push(this.makeCode("\n"+this.tab+"]"))):(b.unshift(this.makeCode("[")),b.push(this.makeCode("]")));return b};b.prototype.assigns=function(a){var b,d,f,c;c=this.objects;b=0;for(d=c.length;b<d;b++)if(f=c[b],f.assigns(a))return!0;return!1};b.prototype.children=["objects"];return b}();k.Class=m=function(){var b=function(b,c,d){var f;d=void 0===d?new g:d;
|
||||
f=a.call(this)||this;f.variable=b;f.parent=c;f.body=d;return f};$jscomp.inherits(b,a);b.prototype.compileNode=function(a){var b,d;this.name=this.determineName();b=this.walkBody();this.parent instanceof I&&!this.parent.hasProperties()&&(d=this.parent.base.value);this.hasNameClash=null!=this.name&&this.name===d;b||this.hasNameClash?(this.compileNode=this.compileClassDeclaration,d=(new y(this,b)).compileToFragments(a),this.compileNode=this.constructor.prototype.compileNode):(d=this.compileClassDeclaration(a),
|
||||
null==this.name&&a.level===x&&(d=this.wrapInBraces(d)));return this.variable?(b=new ha(this.variable,new r(""),null,{moduleDeclaration:this.moduleDeclaration}),[].concat($jscomp.arrayFromIterable(b.compileToFragments(a)),$jscomp.arrayFromIterable(d))):d};b.prototype.compileClassDeclaration=function(a){var b;(this.externalCtor||this.boundMethods.length)&&null==this.ctor&&(this.ctor=this.makeDefaultConstructor());null!=(b=this.ctor)&&(b.noReturn=!0);this.boundMethods.length&&this.proxyBoundMethods(a);
|
||||
a.indent+=ra;b=[];b.push(this.makeCode("class "));this.name&&b.push(this.makeCode(this.name+" "));this.parent&&b.push.apply(b,[].concat([this.makeCode("extends ")],$jscomp.arrayFromIterable(this.parent.compileToFragments(a)),[this.makeCode(" ")]));b.push(this.makeCode("{"));this.body.isEmpty()||(this.body.spaced=!0,b.push(this.makeCode("\n")),b.push.apply(b,[].concat($jscomp.arrayFromIterable(this.body.compileToFragments(a,x)))),b.push(this.makeCode("\n"+this.tab)));b.push(this.makeCode("}"));return b};
|
||||
b.prototype.determineName=function(){var a,b;if(!this.variable)return null;b=this.variable.properties;b=(a=b[b.length-1])?a instanceof xa&&a.name:this.variable.base;if(!(b instanceof A||b instanceof C))return null;b=b.value;a||(a=na(b))&&this.variable.error(a);return 0<=Fa.call(ua,b)?"_"+b:b};b.prototype.walkBody=function(){var a,b,d,f,h,l,k,n,m,p,u,t,r;this.ctor=null;this.boundMethods=[];k=[];f=this.body.expressions;l=0;t=f.slice();n=0;for(m=t.length;n<m;n++)if(d=t[n],d instanceof I&&d.isObject(!0)){p=
|
||||
d.base.properties;h=[];r=b=0;for(u=function(){if(b>r)return h.push(new I(new U(p.slice(r,b),!0)))};a=p[b];)(a=this.addInitializerExpression(a))?(u(),h.push(a),k.push(a),r=b+1):k[k.length-1]instanceof e&&(h.pop(),k.pop(),r--),b++;u();[].splice.apply(f,[l,l-l+1].concat(h));h;l+=h.length}else(a=this.addInitializerExpression(d))?(k.push(a),f[l]=a):k[k.length-1]instanceof e&&k.pop(),l+=1;l=0;for(n=k.length;l<n;l++)m=k[l],m instanceof c&&(m.ctor?(this.ctor&&m.error("Cannot define more than one constructor in a class"),
|
||||
this.ctor=m):m.bound&&m.isStatic?m.context=this.name:m.bound&&(this.boundMethods.push(m.name),m.bound=!1));if(k.length!==f.length)return this.body.expressions=function(){var a,b,f;f=[];a=0;for(b=k.length;a<b;a++)d=k[a],f.push(d.hoist());return f}(),new g(f)};b.prototype.addInitializerExpression=function(a){switch(!1){case !(a instanceof e):return a;case !this.validInitializerMethod(a):return this.addInitializerMethod(a);default:return null}};b.prototype.validInitializerMethod=function(a){return a instanceof
|
||||
ha&&a.value instanceof c?"object"!==a.context||a.variable.hasProperties()?a.variable.looksStatic(this.name)&&(this.name||!a.value.bound):!0:!1};b.prototype.addInitializerMethod=function(a){var b;b=a.variable;a=a.value;a.isMethod=!0;a.isStatic=b.looksStatic(this.name);a.isStatic?a.name=b.properties[0]:(b=b.base,a.name=new (b.shouldCache()?p:xa)(b),a.name.updateLocationDataIfMissing(b.locationData),"constructor"===b.value&&(a.ctor=this.parent?"derived":"base"),a.bound&&a.ctor&&a.error("Cannot define a constructor as a bound function"));
|
||||
return a};b.prototype.makeDefaultConstructor=function(){var a,b,d;d=this.addInitializerMethod(new ha(new I(new C("constructor")),new c));this.body.unshift(d);this.parent&&d.body.push(new X(new Y,[new K(new A("arguments"))]));this.externalCtor&&(b=new I(this.externalCtor,[new xa(new C("apply"))]),a=[new za,new A("arguments")],d.body.push(new ta(b,a)),d.body.makeReturn());return d};b.prototype.proxyBoundMethods=function(a){var b,d=this.ctor,f,c,e;c=this.boundMethods;e=[];for(f=c.length-1;0<=f;f+=-1)b=
|
||||
c[f],b=(new I(new za,[b])).compile(a),e.push(new r(b+" \x3d "+Ia("bind",a)+"("+b+", this)"));d.thisAssignments=e;return null};b.prototype.children=["variable","parent","body"];return b}();k.ExecutableClassBody=y=function(){var b=function(b,c){var d;c=void 0===c?new g:c;d=a.call(this)||this;d["class"]=b;d.body=c;return d};$jscomp.inherits(b,a);b.prototype.compileNode=function(a){var b,d,f,e,v,h;(f=this.body.jumps())&&f.error("Class bodies cannot contain pure statements");(d=this.body.contains(qa))&&
|
||||
d.error("Class bodies shouldn't reference arguments");this.name=null!=(e=this["class"].name)?e:this.defaultClassVariableName;d=this.walkBody();this.setContext();f=new A(this.name);b=[];h=new c([],this.body);e=new G(new ta(h,b));this.body.spaced=!0;a.classScope=h.makeScope(a.scope);this["class"].hasNameClash&&(v=new A(a.classScope.freeVariable("superClass")),h.params.push(new P(v)),b.push(this["class"].parent),this["class"].parent=v);this.externalCtor&&(b=new A(a.classScope.freeVariable("ctor",{reserve:!1})),
|
||||
this["class"].externalCtor=b,this.externalCtor.variable.base=b);this.name!==this["class"].name?this.body.expressions.unshift(new ha(new A(this.name),this["class"])):this.body.expressions.unshift(this["class"]);this.body.expressions.unshift.apply(this.body.expressions,[].concat($jscomp.arrayFromIterable(d)));this.body.push(f);return e.compileToFragments(a)};b.prototype.walkBody=function(){var a=this,b,d,f;b=[];for(f=0;(d=this.body.expressions[f])&&(d instanceof e||d instanceof I&&d.isString());)d.hoisted?
|
||||
f++:b.push.apply(b,[].concat($jscomp.arrayFromIterable(this.body.expressions.splice(f,1))));this.traverseChildren(!1,function(b){var d,f,c,e,v,h;if(b instanceof m||b instanceof E)return!1;d=!0;if(b instanceof g){h=b.expressions;f=c=0;for(e=h.length;c<e;f=++c)v=h[f],v instanceof I&&v.isObject(!0)?(d=!1,b.expressions[f]=a.addProperties(v.base.properties)):v instanceof ha&&v.variable.looksStatic(a.name)&&(v.value.isStatic=!0);b.expressions=ea(b.expressions)}return d});return b};b.prototype.setContext=
|
||||
function(){var a=this;return this.body.traverseChildren(!1,function(b){if(b instanceof za)return b.value=a.name;if(b instanceof c&&b.bound)return b.context=a.name})};b.prototype.addProperties=function(a){var b,d,f,v,h,g;g=[];v=0;for(h=a.length;v<h;v++)b=a[v],d=b.variable,d=null!=d?d.base:void 0,f=b.value,delete b.context,b instanceof e||("constructor"===d.value?(f instanceof c&&d.error("constructors must be defined at the top level of a class body"),b=this.externalCtor=new ha(new I,f)):b.variable["this"]?
|
||||
b.value instanceof c&&(b.value.isStatic=!0):(d=new (d.shouldCache()?p:xa)(d),f=new xa(new C("prototype")),d=new I(new za,[f,d]),b.variable=d)),g.push(b);return ia(g)};b.prototype.children=["class","body"];b.prototype.defaultClassVariableName="_Class";return b}();k.ModuleDeclaration=W=function(){var b=function(b,c){var d;d=a.call(this)||this;d.clause=b;d.source=c;d.checkSource();return d};$jscomp.inherits(b,a);b.prototype.checkSource=function(){if(null!=this.source&&this.source instanceof ba)return this.source.error("the name of the module to be imported from must be an uninterpolated string")};
|
||||
b.prototype.checkScope=function(a,b){if(0!==a.indent.length)return this.error(b+" statements must be at top-level scope")};b.prototype.children=["clause","source"];b.prototype.isStatement=da;b.prototype.jumps=Na;b.prototype.makeReturn=Na;return b}();var Za=function(a){return W.apply(this,arguments)||this};$jscomp.inherits(Za,W);Za.prototype.compileNode=function(a){var b,c;this.checkScope(a,"import");a.importedSymbols=[];b=[];b.push(this.makeCode(this.tab+"import "));null!=this.clause&&b.push.apply(b,
|
||||
[].concat($jscomp.arrayFromIterable(this.clause.compileNode(a))));null!=(null!=(c=this.source)?c.value:void 0)&&(null!==this.clause&&b.push(this.makeCode(" from ")),b.push(this.makeCode(this.source.value)));b.push(this.makeCode(";"));return b};k.ImportDeclaration=Za;k.ImportClause=function(){var b=function(b,c){var d;d=a.call(this)||this;d.defaultBinding=b;d.namedImports=c;return d};$jscomp.inherits(b,a);b.prototype.compileNode=function(a){var b;b=[];null!=this.defaultBinding&&(b.push.apply(b,[].concat($jscomp.arrayFromIterable(this.defaultBinding.compileNode(a)))),
|
||||
null!=this.namedImports&&b.push(this.makeCode(", ")));null!=this.namedImports&&b.push.apply(b,[].concat($jscomp.arrayFromIterable(this.namedImports.compileNode(a))));return b};b.prototype.children=["defaultBinding","namedImports"];return b}();var Ga=function(a){return W.apply(this,arguments)||this};$jscomp.inherits(Ga,W);Ga.prototype.compileNode=function(a){var b,c;this.checkScope(a,"export");b=[];b.push(this.makeCode(this.tab+"export "));this instanceof z&&b.push(this.makeCode("default "));this instanceof
|
||||
z||!(this.clause instanceof ha||this.clause instanceof m)||(this.clause instanceof m&&!this.clause.variable&&this.clause.error("anonymous classes cannot be exported"),b.push(this.makeCode("var ")),this.clause.moduleDeclaration="export");b=null!=this.clause.body&&this.clause.body instanceof g?b.concat(this.clause.compileToFragments(a,x)):b.concat(this.clause.compileNode(a));null!=(null!=(c=this.source)?c.value:void 0)&&b.push(this.makeCode(" from "+this.source.value));b.push(this.makeCode(";"));return b};
|
||||
k.ExportDeclaration=Ga;var mb=function(a){return Ga.apply(this,arguments)||this};$jscomp.inherits(mb,Ga);k.ExportNamedDeclaration=mb;var La=function(a){return Ga.apply(this,arguments)||this};$jscomp.inherits(La,Ga);k.ExportDefaultDeclaration=z=La;var Ka=function(a){return Ga.apply(this,arguments)||this};$jscomp.inherits(Ka,Ga);k.ExportAllDeclaration=Ka;k.ModuleSpecifierList=Q=function(){var b=function(b){var c;c=a.call(this)||this;c.specifiers=b;return c};$jscomp.inherits(b,a);b.prototype.compileNode=
|
||||
function(a){var b,d,f,c,e;b=[];a.indent+=ra;var h;e=this.specifiers;h=[];f=0;for(c=e.length;f<c;f++)d=e[f],h.push(d.compileToFragments(a,u));if(0!==this.specifiers.length){b.push(this.makeCode("{\n"+a.indent));f=c=0;for(e=h.length;c<e;f=++c)d=h[f],f&&b.push(this.makeCode(",\n"+a.indent)),b.push.apply(b,[].concat($jscomp.arrayFromIterable(d)));b.push(this.makeCode("\n}"))}else b.push(this.makeCode("{}"));return b};b.prototype.children=["specifiers"];return b}();var nb=function(a){return Q.apply(this,
|
||||
arguments)||this};$jscomp.inherits(nb,Q);k.ImportSpecifierList=nb;var ob=function(a){return Q.apply(this,arguments)||this};$jscomp.inherits(ob,Q);k.ExportSpecifierList=ob;k.ModuleSpecifier=T=function(){var b=function(b,c,d){var f;f=a.call(this)||this;f.original=b;f.alias=c;f.moduleDeclarationType=d;f.identifier=null!=f.alias?f.alias.value:f.original.value;return f};$jscomp.inherits(b,a);b.prototype.compileNode=function(a){a.scope.find(this.identifier,this.moduleDeclarationType);a=[];a.push(this.makeCode(this.original.value));
|
||||
null!=this.alias&&a.push(this.makeCode(" as "+this.alias.value));return a};b.prototype.children=["original","alias"];return b}();var Va=function(a,c){return T.call(this,a,c,"import")||this};$jscomp.inherits(Va,T);Va.prototype.compileNode=function(a){var b;(b=this.identifier,0<=Fa.call(a.importedSymbols,b))||a.scope.check(this.identifier)?this.error("'"+this.identifier+"' has already been declared"):a.importedSymbols.push(this.identifier);return T.prototype.compileNode.call(this,a)};k.ImportSpecifier=
|
||||
Va;var ib=function(a){return Va.apply(this,arguments)||this};$jscomp.inherits(ib,Va);k.ImportDefaultSpecifier=ib;var pb=function(a){return Va.apply(this,arguments)||this};$jscomp.inherits(pb,Va);k.ImportNamespaceSpecifier=pb;var qb=function(a,c){return T.call(this,a,c,"export")||this};$jscomp.inherits(qb,T);k.ExportSpecifier=qb;k.Assign=ha=function(){var b=function(b,c,d,f){var e;f=void 0===f?{}:f;e=a.call(this)||this;e.variable=b;e.value=c;e.context=d;e.param=f.param;e.subpattern=f.subpattern;e.operatorToken=
|
||||
f.operatorToken;e.moduleDeclaration=f.moduleDeclaration;return e};$jscomp.inherits(b,a);b.prototype.isStatement=function(a){return(null!=a?a.level:void 0)===x&&null!=this.context&&(this.moduleDeclaration||0<=Fa.call(this.context,"?"))};b.prototype.checkAssignability=function(a,b){if(Object.prototype.hasOwnProperty.call(a.scope.positions,b.value)&&"import"===a.scope.variables[a.scope.positions[b.value]].type)return b.error("'"+b.value+"' is read-only")};b.prototype.assigns=function(a){return this["object"===
|
||||
this.context?"value":"variable"].assigns(a)};b.prototype.unfoldSoak=function(a){return Ra(a,this,"variable")};b.prototype.compileNode=function(a){var b,d,f,e,h,v,g;if(d=this.variable instanceof I){if(this.variable.isArray()||this.variable.isObject())return this.compilePatternMatch(a);if(this.variable.isSplice())return this.compileSplice(a);if("||\x3d"===(e=this.context)||"\x26\x26\x3d"===e||"?\x3d"===e)return this.compileConditional(a);if("**\x3d"===(h=this.context)||"//\x3d"===h||"%%\x3d"===h)return this.compileSpecialMath(a)}this.value instanceof
|
||||
c&&(this.value.isStatic?this.value.name=this.variable.properties[0]:2<=(null!=(v=this.variable.properties)?v.length:void 0)&&(h=this.variable.properties,3<=h.length?Ea.call(h,0,f=h.length-2):f=0,e=h[f++],f=h[f++],"prototype"===(null!=(g=e.name)?g.value:void 0)&&(this.value.name=f)));this.context||(g=this.variable.unwrapAll(),g.isAssignable()||this.variable.error("'"+this.variable.compile(a)+"' can't be assigned"),"function"===typeof g.hasProperties&&g.hasProperties()||(this.moduleDeclaration?(this.checkAssignability(a,
|
||||
g),a.scope.add(g.value,this.moduleDeclaration)):this.param?a.scope.add(g.value,"var"):(this.checkAssignability(a,g),a.scope.find(g.value))));g=this.value.compileToFragments(a,u);d&&this.variable.base instanceof U&&(this.variable.front=!0);d=this.variable.compileToFragments(a,u);if("object"===this.context){if(this.variable.shouldCache())d.unshift(this.makeCode("[")),d.push(this.makeCode("]"));else if(b=N(d),0<=Fa.call(ua,b))d.unshift(this.makeCode('"')),d.push(this.makeCode('"'));return d.concat(this.makeCode(": "),
|
||||
g)}b=d.concat(this.makeCode(" "+(this.context||"\x3d")+" "),g);return a.level<=u?b:this.wrapInBraces(b)};b.prototype.compilePatternMatch=function(a){var c,d,f,e,h,v,g,l,k,n,m,q,H,y,z,B;y=a.level===x;l=this.value;q=this.variable.base.objects;if(!(H=q.length))return d=l.compileToFragments(a),a.level>=t?this.wrapInBraces(d):d;m=q[0];1===H&&m instanceof w&&m.error("Destructuring assignment has no target");v=this.variable.isObject();if(y&&1===H&&!(m instanceof K))return f=null,m instanceof b&&"object"===
|
||||
m.context?(d=m,e=d.variable,h=e.base,m=d.value,m instanceof b&&(f=m.value,m=m.variable)):(m instanceof b&&(f=m.value,m=m.variable),h=v?m["this"]?m.properties[0].name:new C(m.unwrap().value):new Ta(0)),c=h.unwrap()instanceof C,l=new I(l),l.properties.push(new (c?xa:p)(h)),(n=na(m.unwrap().value))&&m.error(n),f&&(l=new O("?",l,f)),(new b(m,l,null,{param:this.param})).compileToFragments(a,x);z=l.compileToFragments(a,u);B=N(z);d=[];e=!1;l.unwrap()instanceof A&&!this.variable.assigns(B)||(d.push([].concat([this.makeCode((f=
|
||||
a.scope.freeVariable("ref"))+" \x3d ")],$jscomp.arrayFromIterable(z))),z=[this.makeCode(f)],B=f);f=l=0;for(k=q.length;l<k;f=++l){m=q[f];h=f;if(!e&&m instanceof K)n=m.name.unwrap().value,m=m.unwrap(),h=H+" \x3c\x3d "+B+".length ? "+Ia("slice",a)+".call("+B+", "+f,(c=H-f-1)?(g=a.scope.freeVariable("i",{single:!0}),h+=", "+g+" \x3d "+B+".length - "+c+") : ("+g+" \x3d "+f+", [])"):h+=") : []",h=new r(h),e=g+"++";else if(!e&&m instanceof w){if(c=H-f-1)1===c?e=B+".length - 1":(g=a.scope.freeVariable("i",
|
||||
{single:!0}),h=new r(g+" \x3d "+B+".length - "+c),e=g+"++",d.push(h.compileToFragments(a,u)));continue}else(m instanceof K||m instanceof w)&&m.error("multiple splats/expansions are disallowed in an assignment"),f=null,m instanceof b&&"object"===m.context?(h=m.variable,h=h.base,m=m.value,m instanceof b&&(f=m.value,m=m.variable)):(m instanceof b&&(f=m.value,m=m.variable),h=v?m["this"]?m.properties[0].name:new C(m.unwrap().value):new r(e||h)),n=m.unwrap().value,c=h.unwrap()instanceof C,h=new I(new r(B),
|
||||
[new (c?xa:p)(h)]),f&&(h=new O("?",h,f));null!=n&&(n=na(n))&&m.error(n);d.push((new b(m,h,null,{param:this.param,subpattern:!0})).compileToFragments(a,u))}y||this.subpattern||d.push(z);d=this.joinFragmentArrays(d,", ");return a.level<u?d:this.wrapInBraces(d)};b.prototype.compileConditional=function(a){var c,d;d=this.variable.cacheReference(a);c=d[0];d=d[1];c.properties.length||!(c.base instanceof r)||c.base instanceof za||a.scope.check(c.base.value)||this.variable.error('the variable "'+c.base.value+
|
||||
"\" can't be assigned with "+this.context+" because it has not been declared before");if(0<=Fa.call(this.context,"?"))return a.isExistentialEquals=!0,(new B(new D(c),d,{type:"if"})).addElse(new b(d,this.value,"\x3d")).compileToFragments(a);c=(new O(this.context.slice(0,-1),c,new b(d,this.value,"\x3d"))).compileToFragments(a);return a.level<=u?c:this.wrapInBraces(c)};b.prototype.compileSpecialMath=function(a){var c,d;d=this.variable.cacheReference(a);c=d[0];d=d[1];return(new b(c,new O(this.context.slice(0,
|
||||
-1),d,this.value))).compileToFragments(a)};b.prototype.compileSplice=function(a){var b,d,f,c,e,g;c=this.variable.properties.pop().range;f=c.from;b=c.to;d=c.exclusive;g=this.variable.compile(a);f?(e=this.cacheToCodeFragments(f.cache(a,t)),c=e[0],e=e[1]):c=e="0";b?null!=f&&f.isNumber()&&b.isNumber()?(b=b.compile(a)-e,d||(b+=1)):(b=b.compile(a,h)+" - "+e,d||(b+=" + 1")):b="9e9";d=this.value.cache(a,u);f=d[0];d=d[1];b=[].concat(this.makeCode("[].splice.apply("+g+", ["+c+", "+b+"].concat("),f,this.makeCode(")), "),
|
||||
d);return a.level>x?this.wrapInBraces(b):b};b.prototype.children=["variable","value"];return b}();k.Code=c=function(){var b=function(b,c,d){var f;f=a.call(this)||this;f.params=b||[];f.body=c||new g;f.bound="boundfunc"===d;f.isGenerator=!1;f.isAsync=!1;f.isMethod=!1;f.body.traverseChildren(!1,function(a){if(a instanceof O&&a.isYield()||a instanceof eb)f.isGenerator=!0;if(a instanceof O&&a.isAwait()||a instanceof fb)f.isAsync=!0;if(f.isGenerator&&f.isAsync)return a.error("function can't contain both yield and await")});
|
||||
return f};$jscomp.inherits(b,a);b.prototype.isStatement=function(){return this.isMethod};b.prototype.makeScope=function(a){return new S(a,this.body,this)};b.prototype.compileNode=function(a){var b,d,f,c,e,g,v,l,k,n,m,p,u,t,r,x,q,H,y;this.ctor&&(this.isAsync&&this.name.error("Class constructor may not be async"),this.isGenerator&&this.name.error("Class constructor may not be a generator"));this.bound&&(null!=(b=a.scope.method)&&b.bound&&(this.context=a.scope.method.context),this.context||(this.context=
|
||||
"this"));a.scope=ka(a,"classScope")||this.makeScope(a.scope);a.scope.shared=ka(a,"sharedScope");a.indent+=ra;delete a.bare;delete a.isExistentialEquals;b=[];c=[];y=null!=(g=null!=(e=this.thisAssignments)?e.slice():void 0)?g:[];q=[];e=g=!1;x=[];this.eachParamName(function(b,d,c){0<=Fa.call(x,b)&&d.error("multiple parameters named '"+b+"'");x.push(b);if(d["this"])return b=d.properties[0].name.value,0<=Fa.call(ua,b)&&(b="_"+b),b=new A(a.scope.freeVariable(b)),c.renameParam(d,b),y.push(new ha(d,b))});
|
||||
H=this.params;f=l=0;for(n=H.length;l<n;f=++l)if(r=H[f],r.splat||r instanceof w)g?r.error("only one splat or expansion parameter is allowed per function definition"):r instanceof w&&1===this.params.length&&r.error("an expansion parameter cannot be the only parameter in a function definition"),g=!0,r.splat?(b.push(f=r.asReference(a)),m=N(f.compileNode(a)),r.shouldCache()&&c.push(new ha(new I(r.name),f,"\x3d",{param:!0}))):(m=a.scope.freeVariable("args"),b.push(new I(new A(m)))),a.scope.parameter(m);
|
||||
else{if(r.shouldCache()||e)e=r.assignedInBody=!0,null!=r.value?(f=new O("\x3d\x3d",r,new Ua),v=new ha(new I(r.name),r.value,"\x3d",{param:!0}),c.push(new B(f,v))):c.push(new ha(new I(r.name),r.asReference(a),"\x3d",{param:!0}));g?(q.push(r),null==r.value||r.shouldCache()||(f=new O("\x3d\x3d",r,new Ua),v=new ha(new I(r.name),r.value,"\x3d"),c.push(new B(f,v))),null!=(null!=(k=r.name)?k.value:void 0)&&a.scope.add(r.name.value,"var",!0)):(f=r.shouldCache()?r.asReference(a):null==r.value||r.assignedInBody?
|
||||
r:new ha(new I(r.name),r.value,"\x3d"),a.scope.parameter(N((null!=r.value?r:f).compileToFragments(a))),b.push(f))}0!==q.length&&c.unshift(new ha(new I(new sa([].concat([new K(new A(m))],$jscomp.arrayFromIterable(function(){var b,d,c;c=[];b=0;for(d=q.length;b<d;b++)r=q[b],c.push(r.asReference(a));return c}())))),new I(new A(m))));k=this.body.isEmpty();this.expandCtorSuper(y)||this.body.expressions.unshift.apply(this.body.expressions,[].concat($jscomp.arrayFromIterable(y)));this.body.expressions.unshift.apply(this.body.expressions,
|
||||
[].concat($jscomp.arrayFromIterable(c)));k||this.noReturn||this.body.makeReturn();u=[];this.isMethod&&this.isStatic&&u.push("static");this.isAsync&&u.push("async");this.isMethod||this.bound?this.isGenerator&&u.push("*"):u.push("function"+(this.isGenerator?"*":""));c=[this.makeCode("(")];f=k=0;for(m=b.length;k<m;f=++k)r=b[f],f&&c.push(this.makeCode(", ")),g&&f===b.length-1&&c.push(this.makeCode("...")),c.push.apply(c,[].concat($jscomp.arrayFromIterable(r.compileToFragments(a))));c.push(this.makeCode(")"));
|
||||
this.body.isEmpty()||(d=this.body.compileWithDeclarations(a));this.isMethod&&(t=[a.scope,a.scope.parent],b=t[0],a.scope=t[1],t=this.name.compileToFragments(a),"."===t[0].code&&t.shift(),a.scope=b);b=this.joinFragmentArrays(function(){var a,b,d;d=[];a=0;for(b=u.length;a<b;a++)p=u[a],d.push(this.makeCode(p));return d}.call(this)," ");u.length&&t&&b.push(this.makeCode(" "));t&&b.push.apply(b,[].concat($jscomp.arrayFromIterable(t)));b.push.apply(b,[].concat($jscomp.arrayFromIterable(c)));this.bound&&
|
||||
!this.isMethod&&b.push(this.makeCode(" \x3d\x3e"));b.push(this.makeCode(" {"));null!=d&&d.length&&b.push.apply(b,[].concat([this.makeCode("\n")],$jscomp.arrayFromIterable(d),[this.makeCode("\n"+this.tab)]));b.push(this.makeCode("}"));return this.isMethod?[].concat([this.makeCode(this.tab)],$jscomp.arrayFromIterable(b)):this.front||a.level>=h?this.wrapInBraces(b):b};b.prototype.eachParamName=function(a){var b,d,c,e,h;e=this.params;h=[];b=0;for(d=e.length;b<d;b++)c=e[b],h.push(c.eachName(a));return h};
|
||||
b.prototype.traverseChildren=function(b,c){if(b)return a.prototype.traverseChildren.call(this,b,c)};b.prototype.replaceInContext=function(b,c){return this.bound?a.prototype.replaceInContext.call(this,b,c):!1};b.prototype.expandCtorSuper=function(a){var b=this,d,c,e;if(!this.ctor)return!1;this.eachSuperCall(g.wrap(this.params),function(a){return a.error("'super' is not allowed in constructor parameter defaults")});e=this.eachSuperCall(this.body,function(d){"base"===b.ctor&&d.error("'super' is only allowed in derived class constructors");
|
||||
return d.expressions=a});d=a.length&&a.length!==(null!=(c=this.thisAssignments)?c.length:void 0);"derived"===this.ctor&&!e&&d&&(d=a[0].variable,d.error("Can't use @params in derived class constructors without calling super"));return e};b.prototype.eachSuperCall=function(a,c){var d=this,f;f=!1;a.traverseChildren(!0,function(a){a instanceof X?(f=!0,c(a)):a instanceof za&&"derived"===d.ctor&&!f&&a.error("Can't reference 'this' before calling super in derived class constructors");return!(a instanceof
|
||||
X)&&(!(a instanceof b)||a.bound)});return f};b.prototype.children=["params","body"];b.prototype.jumps=M;return b}();k.Param=P=function(){var b=function(b,c,d){var f;f=a.call(this)||this;f.name=b;f.value=c;f.splat=d;(b=na(f.name.unwrapAll().value))&&f.name.error(b);f.name instanceof U&&f.name.generated&&(b=f.name.objects[0].operatorToken,b.error("unexpected "+b.value));return f};$jscomp.inherits(b,a);b.prototype.compileToFragments=function(a){return this.name.compileToFragments(a,u)};b.prototype.asReference=
|
||||
function(a){var b;if(this.reference)return this.reference;b=this.name;b["this"]?(b=b.properties[0].name.value,0<=Fa.call(ua,b)&&(b="_"+b),b=new A(a.scope.freeVariable(b))):b.shouldCache()&&(b=new A(a.scope.freeVariable("arg")));b=new I(b);b.updateLocationDataIfMissing(this.locationData);return this.reference=b};b.prototype.shouldCache=function(){return this.name.shouldCache()};b.prototype.eachName=function(a,b){b=void 0===b?this.name:b;var d=this,c,e,h,g;c=function(b){return a("@"+b.properties[0].name.value,
|
||||
b,d)};if(b instanceof r)return a(b.value,b,this);if(b instanceof I)return c(b);b=null!=(e=b.objects)?e:[];e=0;for(h=b.length;e<h;e++)g=b[e],g instanceof ha&&null==g.context&&(g=g.variable),g instanceof ha?(g.value instanceof ha&&(g=g.value),this.eachName(a,g.value.unwrap())):g instanceof K?(g=g.name.unwrap(),a(g.value,g,this)):g instanceof I?g.isArray()||g.isObject()?this.eachName(a,g.base):g["this"]?c(g):a(g.base.value,g.base,this):g instanceof w||g.error("illegal parameter "+g.compile())};b.prototype.renameParam=
|
||||
function(a,b){return this.replaceInContext(function(b){return b===a},function(a,c){return c instanceof U?(c=a,a["this"]&&(c=a.properties[0].name),new ha(new I(c),b,"object")):b})};b.prototype.children=["name","value"];return b}();k.Splat=K=function(){var b=function(b){var c;c=a.call(this)||this;c.name=b.compile?b:new r(b);return c};$jscomp.inherits(b,a);b.prototype.assigns=function(a){return this.name.assigns(a)};b.prototype.compileToFragments=function(a){return[].concat([this.makeCode("...")],$jscomp.arrayFromIterable(this.name.compileToFragments(a)))};
|
||||
b.prototype.unwrap=function(){return this.name};b.prototype.children=["name"];b.prototype.isAssignable=da;return b}();k.Expansion=w=function(){var b=function(b){return a.apply(this,arguments)||this};$jscomp.inherits(b,a);b.prototype.compileNode=function(a){return this.error("Expansion must be used inside a destructuring assignment or parameter list")};b.prototype.asReference=function(a){return this};b.prototype.eachName=function(a){};b.prototype.shouldCache=M;return b}();k.While=ja=function(){var b=
|
||||
function(b,c){var d;d=a.call(this)||this;d.condition=null!=c&&c.invert?b.invert():b;d.guard=null!=c?c.guard:void 0;return d};$jscomp.inherits(b,a);b.prototype.makeReturn=function(b){if(b)return a.prototype.makeReturn.call(this,b);this.returns=!this.jumps({loop:!0});return this};b.prototype.addBody=function(a){this.body=a;return this};b.prototype.jumps=function(){var a,b,d,c;a=this.body.expressions;if(!a.length)return!1;b=0;for(c=a.length;b<c;b++)if(d=a[b],d=d.jumps({loop:!0}))return d;return!1};b.prototype.compileNode=
|
||||
function(a){var b,d,c;a.indent+=ra;c="";b=this.body;b.isEmpty()?b=this.makeCode(""):(this.returns&&(b.makeReturn(d=a.scope.freeVariable("results")),c=""+this.tab+d+" \x3d [];\n"),this.guard&&(1<b.expressions.length?b.expressions.unshift(new B((new G(this.guard)).invert(),new aa("continue"))):this.guard&&(b=g.wrap([new B(this.guard,b)]))),b=[].concat(this.makeCode("\n"),b.compileToFragments(a,x),this.makeCode("\n"+this.tab)));a=[].concat(this.makeCode(c+this.tab+"while ("),this.condition.compileToFragments(a,
|
||||
H),this.makeCode(") {"),b,this.makeCode("}"));this.returns&&a.push(this.makeCode("\n"+this.tab+"return "+d+";"));return a};b.prototype.children=["condition","guard","body"];b.prototype.isStatement=da;return b}();k.Op=O=function(){var b,e,g=function(d,f,e,h){var l;if("in"===d)return new J(f,e);if("do"===d)return g.prototype.generateDo(f);if("new"===d){if(f instanceof ta&&!f["do"]&&!f.isNew)return f.newInstance();if(f instanceof c&&f.bound||f["do"])f=new G(f)}l=a.call(this)||this;l.operator=b[d]||d;
|
||||
l.first=f;l.second=e;l.flip=!!h;return l};$jscomp.inherits(g,a);g.prototype.isNumber=function(){var a;return this.isUnary()&&("+"===(a=this.operator)||"-"===a)&&this.first instanceof I&&this.first.isNumber()};g.prototype.isAwait=function(){return"await"===this.operator};g.prototype.isYield=function(){var a;return"yield"===(a=this.operator)||"yield*"===a};g.prototype.isUnary=function(){return!this.second};g.prototype.shouldCache=function(){return!this.isNumber()};g.prototype.isChainable=function(){var a;
|
||||
return"\x3c"===(a=this.operator)||"\x3e"===a||"\x3e\x3d"===a||"\x3c\x3d"===a||"\x3d\x3d\x3d"===a||"!\x3d\x3d"===a};g.prototype.invert=function(){var a,b,c;if(this.isChainable()&&this.first.isChainable()){a=!0;for(b=this;b&&b.operator;)a&&(a=b.operator in e),b=b.first;if(!a)return(new G(this)).invert();for(b=this;b&&b.operator;)b.invert=!b.invert,b.operator=e[b.operator],b=b.first;return this}return(b=e[this.operator])?(this.operator=b,this.first.unwrap()instanceof g&&this.first.invert(),this):this.second?
|
||||
(new G(this)).invert():"!"===this.operator&&(a=this.first.unwrap())instanceof g&&("!"===(c=a.operator)||"in"===c||"instanceof"===c)?a:new g("!",this)};g.prototype.unfoldSoak=function(a){var b;return("++"===(b=this.operator)||"--"===b||"delete"===b)&&Ra(a,this,"first")};g.prototype.generateDo=function(a){var b,d,e,h,g;h=[];g=(a instanceof ha&&(b=a.value.unwrap())instanceof c?b:a).params||[];b=0;for(d=g.length;b<d;b++)e=g[b],e.value?(h.push(e.value),delete e.value):h.push(e);a=new ta(a,h);a["do"]=!0;
|
||||
return a};g.prototype.compileNode=function(a){var b,d;b=this.isChainable()&&this.first.isChainable();b||(this.first.front=this.front);"delete"===this.operator&&a.scope.check(this.first.unwrapAll().value)&&this.error("delete operand may not be argument or var");("--"===(d=this.operator)||"++"===d)&&(d=na(this.first.unwrapAll().value))&&this.first.error(d);if(this.isYield()||this.isAwait())return this.compileContinuation(a);if(this.isUnary())return this.compileUnary(a);if(b)return this.compileChain(a);
|
||||
switch(this.operator){case "?":return this.compileExistence(a);case "**":return this.compilePower(a);case "//":return this.compileFloorDivision(a);case "%%":return this.compileModulo(a);default:return b=this.first.compileToFragments(a,t),d=this.second.compileToFragments(a,t),b=[].concat(b,this.makeCode(" "+this.operator+" "),d),a.level<=t?b:this.wrapInBraces(b)}};g.prototype.compileChain=function(a){var b;b=this.first.second.cache(a);this.first.second=b[0];b=b[1];a=this.first.compileToFragments(a,
|
||||
t).concat(this.makeCode(" "+(this.invert?"\x26\x26":"||")+" "),b.compileToFragments(a),this.makeCode(" "+this.operator+" "),this.second.compileToFragments(a,t));return this.wrapInBraces(a)};g.prototype.compileExistence=function(a){var b,d;this.first.shouldCache()?(d=new A(a.scope.freeVariable("ref")),b=new G(new ha(d,this.first))):d=b=this.first;return(new B(new D(b),d,{type:"if"})).addElse(this.second).compileToFragments(a)};g.prototype.compileUnary=function(a){var b,d,c;d=[];b=this.operator;d.push([this.makeCode(b)]);
|
||||
if("!"===b&&this.first instanceof D)return this.first.negated=!this.first.negated,this.first.compileToFragments(a);if(a.level>=h)return(new G(this)).compileToFragments(a);c="+"===b||"-"===b;("new"===b||"typeof"===b||"delete"===b||c&&this.first instanceof g&&this.first.operator===b)&&d.push([this.makeCode(" ")]);if(c&&this.first instanceof g||"new"===b&&this.first.isStatement(a))this.first=new G(this.first);d.push(this.first.compileToFragments(a,t));this.flip&&d.reverse();return this.joinFragmentArrays(d,
|
||||
"")};g.prototype.compileContinuation=function(a){var b,d,c,e;d=[];b=this.operator;null==a.scope.parent&&this.error(this.operator+" can only occur inside functions");null!=(c=a.scope.method)&&c.bound&&a.scope.method.isGenerator&&this.error("yield cannot occur inside bound (fat arrow) functions");0<=Fa.call(Object.keys(this.first),"expression")&&!(this.first instanceof la)?null!=this.first.expression&&d.push(this.first.expression.compileToFragments(a,t)):(a.level>=H&&d.push([this.makeCode("(")]),d.push([this.makeCode(b)]),
|
||||
""!==(null!=(e=this.first.base)?e.value:void 0)&&d.push([this.makeCode(" ")]),d.push(this.first.compileToFragments(a,t)),a.level>=H&&d.push([this.makeCode(")")]));return this.joinFragmentArrays(d,"")};g.prototype.compilePower=function(a){var b;b=new I(new A("Math"),[new xa(new C("pow"))]);return(new ta(b,[this.first,this.second])).compileToFragments(a)};g.prototype.compileFloorDivision=function(a){var b,d;d=new I(new A("Math"),[new xa(new C("floor"))]);b=this.second.shouldCache()?new G(this.second):
|
||||
this.second;b=new g("/",this.first,b);return(new ta(d,[b])).compileToFragments(a)};g.prototype.compileModulo=function(a){var b;b=new I(new r(Ia("modulo",a)));return(new ta(b,[this.first,this.second])).compileToFragments(a)};g.prototype.toString=function(b){return a.prototype.toString.call(this,b,this.constructor.name+" "+this.operator)};b={"\x3d\x3d":"\x3d\x3d\x3d","!\x3d":"!\x3d\x3d",of:"in",yieldfrom:"yield*"};e={"!\x3d\x3d":"\x3d\x3d\x3d","\x3d\x3d\x3d":"!\x3d\x3d"};g.prototype.children=["first",
|
||||
"second"];return g}();k.In=J=function(){var b=function(b,c){var d;d=a.call(this)||this;d.object=b;d.array=c;return d};$jscomp.inherits(b,a);b.prototype.compileNode=function(a){var b,d,c,e,h;if(this.array instanceof I&&this.array.isArray()&&this.array.base.objects.length){h=this.array.base.objects;d=0;for(c=h.length;d<c;d++)if(e=h[d],e instanceof K){b=!0;break}if(!b)return this.compileOrTest(a)}return this.compileLoopTest(a)};b.prototype.compileOrTest=function(a){var b,d,c,e,g,l,k,n,m,v;b=this.object.cache(a,
|
||||
t);m=b[0];k=b[1];d=this.negated?[" !\x3d\x3d "," \x26\x26 "]:[" \x3d\x3d\x3d "," || "];b=d[0];d=d[1];v=[];n=this.array.base.objects;c=g=0;for(l=n.length;g<l;c=++g)e=n[c],c&&v.push(this.makeCode(d)),v=v.concat(c?k:m,this.makeCode(b),e.compileToFragments(a,h));return a.level<t?v:this.wrapInBraces(v)};b.prototype.compileLoopTest=function(a){var b,d,c;b=this.object.cache(a,u);c=b[0];d=b[1];b=[].concat(this.makeCode(Ia("indexOf",a)+".call("),this.array.compileToFragments(a,u),this.makeCode(", "),d,this.makeCode(") "+
|
||||
(this.negated?"\x3c 0":"\x3e\x3d 0")));if(N(c)===N(d))return b;b=c.concat(this.makeCode(", "),b);return a.level<u?b:this.wrapInBraces(b)};b.prototype.toString=function(b){return a.prototype.toString.call(this,b,this.constructor.name+(this.negated?"!":""))};b.prototype.children=["object","array"];b.prototype.invert=R;return b}();k.Try=function(){var b=function(b,c,d,f){var e;e=a.call(this)||this;e.attempt=b;e.errorVariable=c;e.recovery=d;e.ensure=f;return e};$jscomp.inherits(b,a);b.prototype.jumps=
|
||||
function(a){var b;return this.attempt.jumps(a)||(null!=(b=this.recovery)?b.jumps(a):void 0)};b.prototype.makeReturn=function(a){this.attempt&&(this.attempt=this.attempt.makeReturn(a));this.recovery&&(this.recovery=this.recovery.makeReturn(a));return this};b.prototype.compileNode=function(a){var b,d,c,e,h;a.indent+=ra;h=this.attempt.compileToFragments(a,x);b=this.recovery?(d=a.scope.freeVariable("error",{reserve:!1}),e=new A(d),this.errorVariable?(c=na(this.errorVariable.unwrapAll().value),c?this.errorVariable.error(c):
|
||||
void 0,this.recovery.unshift(new ha(this.errorVariable,e))):void 0,[].concat(this.makeCode(" catch ("),e.compileToFragments(a),this.makeCode(") {\n"),this.recovery.compileToFragments(a,x),this.makeCode("\n"+this.tab+"}"))):this.ensure||this.recovery?[]:(d=a.scope.freeVariable("error",{reserve:!1}),[this.makeCode(" catch ("+d+") {}")]);a=this.ensure?[].concat(this.makeCode(" finally {\n"),this.ensure.compileToFragments(a,x),this.makeCode("\n"+this.tab+"}")):[];return[].concat(this.makeCode(this.tab+
|
||||
"try {\n"),h,this.makeCode("\n"+this.tab+"}"),b,a)};b.prototype.children=["attempt","recovery","ensure"];b.prototype.isStatement=da;return b}();k.Throw=la=function(){var b=function(b){var c;c=a.call(this)||this;c.expression=b;return c};$jscomp.inherits(b,a);b.prototype.compileNode=function(a){return[].concat(this.makeCode(this.tab+"throw "),this.expression.compileToFragments(a),this.makeCode(";"))};b.prototype.children=["expression"];b.prototype.isStatement=da;b.prototype.jumps=M;b.prototype.makeReturn=
|
||||
Na;return b}();k.Existence=D=function(){var b=function(b){var c;c=a.call(this)||this;c.expression=b;return c};$jscomp.inherits(b,a);b.prototype.compileNode=function(a){var b,d,c;this.expression.front=this.front;c=this.expression.compile(a,t);this.expression.unwrap()instanceof A&&!a.scope.check(c)?(d=this.negated?["\x3d\x3d\x3d","||"]:["!\x3d\x3d","\x26\x26"],b=d[0],d=d[1],c="typeof "+c+" "+b+' "undefined" '+d+" "+c+" "+b+" null"):c=c+" "+(this.negated?"\x3d\x3d":"!\x3d")+" null";return[this.makeCode(a.level<=
|
||||
n?c:"("+c+")")]};b.prototype.children=["expression"];b.prototype.invert=R;return b}();k.Parens=G=function(){var b=function(b){var c;c=a.call(this)||this;c.body=b;return c};$jscomp.inherits(b,a);b.prototype.unwrap=function(){return this.body};b.prototype.shouldCache=function(){return this.body.shouldCache()};b.prototype.compileNode=function(a){var b,d;b=this.body.unwrap();if(b instanceof I&&b.isAtomic())return b.front=this.front,b.compileToFragments(a);d=b.compileToFragments(a,H);return a.level<t&&
|
||||
(b instanceof O||b instanceof ta||b instanceof l&&b.returns)?d:this.wrapInBraces(d)};b.prototype.children=["body"];return b}();k.StringWithInterpolations=ba=function(){var b=function(b){var c;c=a.call(this)||this;c.body=b;return c};$jscomp.inherits(b,a);b.prototype.unwrap=function(){return this};b.prototype.shouldCache=function(){return this.body.shouldCache()};b.prototype.compileNode=function(a){var b,d,c,e,h;c=this.body.unwrap();d=[];c.traverseChildren(!1,function(a){if(a instanceof Ma)d.push(a);
|
||||
else if(a instanceof G)return d.push(a),!1;return!0});c=[];c.push(this.makeCode("`"));e=0;for(h=d.length;e<h;e++)b=d[e],b instanceof Ma?(b=b.value.slice(1,-1),b=b.replace(/(\\*)(`|\$\{)/g,function(a,b,d){return 0===b.length%2?b+"\\"+d:a}),c.push(this.makeCode(b))):(c.push(this.makeCode("${")),c.push.apply(c,[].concat($jscomp.arrayFromIterable(b.compileToFragments(a,H)))),c.push(this.makeCode("}")));c.push(this.makeCode("`"));return c};b.prototype.children=["body"];return b}();k.For=l=function(){var a=
|
||||
function(a,b){var d;d=ja.call(this)||this;d.source=b.source;d.guard=b.guard;d.step=b.step;d.name=b.name;d.index=b.index;d.body=g.wrap([a]);d.own=!!b.own;d.object=!!b.object;d.from=!!b.from;d.from&&d.index&&d.index.error("cannot use index with for-from");d.own&&!d.object&&b.ownTag.error("cannot use own with for-"+(d.from?"from":"in"));d.object&&(a=[d.index,d.name],d.name=a[0],d.index=a[1]);d.index instanceof I&&!d.index.isAssignable()&&d.index.error("index cannot be a pattern matching expression");
|
||||
d.range=d.source instanceof I&&d.source.base instanceof Z&&!d.source.properties.length&&!d.from;d.pattern=d.name instanceof I;d.range&&d.index&&d.index.error("indexes do not apply to range loops");d.range&&d.pattern&&d.name.error("cannot pattern match over range loops");d.returns=!1;return d};$jscomp.inherits(a,ja);a.prototype.compileNode=function(a){var b,d,c,e,h,l,k,n,m,p,v,t,q,H,y,z,w,E,D,C,M;b=g.wrap([this.body]);m=b.expressions;m=m[m.length-1];(null!=m?m.jumps():void 0)instanceof F&&(this.returns=
|
||||
!1);y=this.range?this.source.base:this.source;c=a.scope;this.pattern||(n=this.name&&this.name.compile(a,u));m=this.index&&this.index.compile(a,u);n&&!this.pattern&&c.find(n);!m||this.index instanceof I||c.find(m);this.returns&&(k=c.freeVariable("results"));this.from?this.pattern&&(v=c.freeVariable("x",{single:!0})):v=this.object&&m||c.freeVariable("i",{single:!0});t=(this.range||this.from)&&n||m||v;q=t!==v?t+" \x3d ":"";this.step&&!this.range&&(m=this.cacheToCodeFragments(this.step.cache(a,u,Ya)),
|
||||
h=m[0],D=m[1],this.step.isNumber()&&(E=Number(D)));this.pattern&&(n=v);l=m=M="";p=this.tab+ra;this.range?e=y.compileToFragments(wa(a,{index:v,name:n,step:this.step,shouldCache:Ya})):(C=this.source.compile(a,u),!n&&!this.own||this.source.unwrap()instanceof A||(l+=""+this.tab+(y=c.freeVariable("ref"))+" \x3d "+C+";\n",C=y),!n||this.pattern||this.from||(H=n+" \x3d "+C+"["+t+"]"),this.object||this.from||(h!==D&&(l+=""+this.tab+h+";\n"),n=0>E,this.step&&null!=E&&n||(d=c.freeVariable("len")),e=""+q+v+" \x3d 0, "+
|
||||
d+" \x3d "+C+".length",h=""+q+v+" \x3d "+C+".length - 1",d=v+" \x3c "+d,c=v+" \x3e\x3d 0",this.step?(null!=E?n&&(d=c,e=h):(d=D+" \x3e 0 ? "+d+" : "+c,e="("+D+" \x3e 0 ? ("+e+") : "+h+")"),v=v+" +\x3d "+D):v=""+(t!==v?"++"+v:v+"++"),e=[this.makeCode(e+"; "+d+"; "+q+v)]));this.returns&&(z=""+this.tab+k+" \x3d [];\n",w="\n"+this.tab+"return "+k+";",b.makeReturn(k));this.guard&&(1<b.expressions.length?b.expressions.unshift(new B((new G(this.guard)).invert(),new aa("continue"))):this.guard&&(b=g.wrap([new B(this.guard,
|
||||
b)])));this.pattern&&b.expressions.unshift(new ha(this.name,this.from?new A(t):new r(C+"["+t+"]")));k=[].concat(this.makeCode(l),this.pluckDirectCall(a,b));H&&(M="\n"+p+H+";");this.object?(e=[this.makeCode(t+" in "+C)],this.own&&(m="\n"+p+"if (!"+Ia("hasProp",a)+".call("+C+", "+t+")) continue;")):this.from&&(e=[this.makeCode(t+" of "+C)]);(a=b.compileToFragments(wa(a,{indent:p}),x))&&0<a.length&&(a=[].concat(this.makeCode("\n"),a,this.makeCode("\n")));return[].concat(k,this.makeCode(""+(z||"")+this.tab+
|
||||
"for ("),e,this.makeCode(") {"+m+M),a,this.makeCode(this.tab+"}"+(w||"")))};a.prototype.pluckDirectCall=function(a,b){var d,f,e,h,g,l,k,n,m,p,v,r,t,u,q;f=[];m=b.expressions;g=l=0;for(k=m.length;l<k;g=++l)if(e=m[g],e=e.unwrapAll(),e instanceof ta&&(q=null!=(p=e.variable)?p.unwrapAll():void 0,q instanceof c||q instanceof I&&(null!=(v=q.base)?v.unwrapAll():void 0)instanceof c&&1===q.properties.length&&("call"===(r=null!=(t=q.properties[0].name)?t.value:void 0)||"apply"===r)))h=(null!=(u=q.base)?u.unwrapAll():
|
||||
void 0)||q,n=new A(a.scope.freeVariable("fn")),d=new I(n),q.base&&(d=[d,q],q.base=d[0],d=d[1]),b.expressions[g]=new ta(d,e.args),f=f.concat(this.makeCode(this.tab),(new ha(n,h)).compileToFragments(a,x),this.makeCode(";\n"));return f};a.prototype.children=["body","source","guard","step"];return a}();k.Switch=function(){var b=function(b,c,d){var f;f=a.call(this)||this;f.subject=b;f.cases=c;f.otherwise=d;return f};$jscomp.inherits(b,a);b.prototype.jumps=function(a){a=void 0===a?{block:!0}:a;var b,d,
|
||||
c,e,h;e=this.cases;d=0;for(c=e.length;d<c;d++)if(b=e[d],b=b[1],b=b.jumps(a))return b;return null!=(h=this.otherwise)?h.jumps(a):void 0};b.prototype.makeReturn=function(a){var b,d,c,e,h;e=this.cases;b=0;for(d=e.length;b<d;b++)c=e[b],c[1].makeReturn(a);a&&(this.otherwise||(this.otherwise=new g([new r("void 0")])));null!=(h=this.otherwise)&&h.makeReturn(a);return this};b.prototype.compileNode=function(a){var b,d,c,e,h,g,l,k,n,m,p,t,u;l=a.indent+ra;k=a.indent=l+ra;g=[].concat(this.makeCode(this.tab+"switch ("),
|
||||
this.subject?this.subject.compileToFragments(a,H):this.makeCode("false"),this.makeCode(") {\n"));t=this.cases;h=n=0;for(m=t.length;n<m;h=++n){b=t[h];e=b[0];b=b[1];u=ea([e]);e=0;for(p=u.length;e<p;e++)c=u[e],this.subject||(c=c.invert()),g=g.concat(this.makeCode(l+"case "),c.compileToFragments(a,H),this.makeCode(":\n"));0<(d=b.compileToFragments(a,x)).length&&(g=g.concat(d,this.makeCode("\n")));if(h===this.cases.length-1&&!this.otherwise)break;h=this.lastNonComment(b.expressions);h instanceof F||h instanceof
|
||||
r&&h.jumps()&&"debugger"!==h.value||g.push(c.makeCode(k+"break;\n"))}this.otherwise&&this.otherwise.expressions.length&&g.push.apply(g,[].concat([this.makeCode(l+"default:\n")],$jscomp.arrayFromIterable(this.otherwise.compileToFragments(a,x)),[this.makeCode("\n")]));g.push(this.makeCode(this.tab+"}"));return g};b.prototype.children=["subject","cases","otherwise"];b.prototype.isStatement=da;return b}();k.If=B=function(){var b=function(b,c,d){var f;d=void 0===d?{}:d;f=a.call(this)||this;f.body=c;f.condition=
|
||||
"unless"===d.type?b.invert():b;f.elseBody=null;f.isChain=!1;f.soak=d.soak;return f};$jscomp.inherits(b,a);b.prototype.bodyNode=function(){var a;return null!=(a=this.body)?a.unwrap():void 0};b.prototype.elseBodyNode=function(){var a;return null!=(a=this.elseBody)?a.unwrap():void 0};b.prototype.addElse=function(a){this.isChain?this.elseBodyNode().addElse(a):(this.isChain=a instanceof b,this.elseBody=this.ensureBlock(a),this.elseBody.updateLocationDataIfMissing(a.locationData));return this};b.prototype.isStatement=
|
||||
function(a){var b;return(null!=a?a.level:void 0)===x||this.bodyNode().isStatement(a)||(null!=(b=this.elseBodyNode())?b.isStatement(a):void 0)};b.prototype.jumps=function(a){var b;return this.body.jumps(a)||(null!=(b=this.elseBody)?b.jumps(a):void 0)};b.prototype.compileNode=function(a){return this.isStatement(a)?this.compileStatement(a):this.compileExpression(a)};b.prototype.makeReturn=function(a){a&&(this.elseBody||(this.elseBody=new g([new r("void 0")])));this.body&&(this.body=new g([this.body.makeReturn(a)]));
|
||||
this.elseBody&&(this.elseBody=new g([this.elseBody.makeReturn(a)]));return this};b.prototype.ensureBlock=function(a){return a instanceof g?a:new g([a])};b.prototype.compileStatement=function(a){var c,d,f,e;c=ka(a,"chainChild");if(ka(a,"isExistentialEquals"))return(new b(this.condition.invert(),this.elseBodyNode(),{type:"if"})).compileToFragments(a);e=a.indent+ra;f=this.condition.compileToFragments(a,H);d=this.ensureBlock(this.body).compileToFragments(wa(a,{indent:e}));d=[].concat(this.makeCode("if ("),
|
||||
f,this.makeCode(") {\n"),d,this.makeCode("\n"+this.tab+"}"));c||d.unshift(this.makeCode(this.tab));if(!this.elseBody)return d;c=d.concat(this.makeCode(" else "));this.isChain?(a.chainChild=!0,c=c.concat(this.elseBody.unwrap().compileToFragments(a,x))):c=c.concat(this.makeCode("{\n"),this.elseBody.compileToFragments(wa(a,{indent:e}),x),this.makeCode("\n"+this.tab+"}"));return c};b.prototype.compileExpression=function(a){var b,d,c;c=this.condition.compileToFragments(a,n);d=this.bodyNode().compileToFragments(a,
|
||||
u);b=this.elseBodyNode()?this.elseBodyNode().compileToFragments(a,u):[this.makeCode("void 0")];b=c.concat(this.makeCode(" ? "),d,this.makeCode(" : "),b);return a.level>=n?this.wrapInBraces(b):b};b.prototype.unfoldSoak=function(){return this.soak&&this};b.prototype.children=["condition","body","elseBody"];return b}();ma={extend:function(a){return"function(child, parent) { for (var key in parent) { if ("+Ia("hasProp",a)+".call(parent, key)) child[key] \x3d parent[key]; } function ctor() { this.constructor \x3d child; } ctor.prototype \x3d parent.prototype; child.prototype \x3d new ctor(); return child; }"},
|
||||
bind:function(){return"function(fn, me){ return function(){ return fn.apply(me, arguments); }; }"},indexOf:function(){return"[].indexOf || function(item) { for (var i \x3d 0, l \x3d this.length; i \x3c l; i++) { if (i in this \x26\x26 this[i] \x3d\x3d\x3d item) return i; } return -1; }"},modulo:function(){return"function(a, b) { return (+a % (b \x3d +b) + b) % b; }"},hasProp:function(){return"{}.hasOwnProperty"},slice:function(){return"[].slice"}};x=1;H=2;u=3;n=4;t=5;h=6;ra=" ";ca=/^[+-]?\d+$/;Ia=
|
||||
function(a,c){var b,d;d=c.scope.root;if(a in d.utilities)return d.utilities[a];b=d.freeVariable(a);d.assign(b,ma[a](c));return d.utilities[a]=b};Qa=function(a,c){a=a.replace(/\n/g,"$\x26"+c);return a.replace(/\s+$/,"")};qa=function(a){return a instanceof A&&"arguments"===a.value};va=function(a){return a instanceof za||a instanceof c&&a.bound};Ya=function(a){return a.shouldCache()||("function"===typeof a.isAssignable?a.isAssignable():void 0)};Ra=function(a,c,e){if(a=c[e].unfoldSoak(a))return c[e]=
|
||||
a.body,a.body=new I(c),a}}).call(this);return k}();q["./sourcemap"]=function(){var k={};(function(){var q=function(k){this.line=k;this.columns=[]};q.prototype.add=function(k,q,a){var g;g=q[0];q=q[1];void 0===a&&(a={});if(!this.columns[k]||!a.noReplace)return this.columns[k]={line:this.line,column:k,sourceLine:g,sourceColumn:q}};q.prototype.sourceLocation=function(k){for(var q;!((q=this.columns[k])||0>=k);)k--;return q&&[q.sourceLine,q.sourceColumn]};k=function(){var k,ha,a,g,ta=function(){this.lines=
|
||||
[]};ta.prototype.add=function(a,c,e){e=void 0===e?{}:e;var g,k;k=c[0];c=c[1];return((g=this.lines)[k]||(g[k]=new q(k))).add(c,a,e)};ta.prototype.sourceLocation=function(a){var c,e;c=a[0];for(a=a[1];!((e=this.lines[c])||0>=c);)c--;return e&&e.sourceLocation(a)};ta.prototype.generate=function(a,c){a=void 0===a?{}:a;c=void 0===c?null:c;var e,g,k,m,q,l,E,A,B,J,p,ha,h;q=l=m=h=0;J=!1;e="";p=this.lines;k=g=0;for(E=p.length;g<E;k=++g)if(k=p[k])for(ha=k.columns,k=0,A=ha.length;k<A;k++)if(B=ha[k]){for(;h<B.line;)m=
|
||||
0,J=!1,e+=";",h++;J&&(e+=",");e+=this.encodeVlq(B.column-m);m=B.column;e+=this.encodeVlq(0);e+=this.encodeVlq(B.sourceLine-l);l=B.sourceLine;e+=this.encodeVlq(B.sourceColumn-q);q=B.sourceColumn;J=!0}e={version:3,file:a.generatedFile||"",sourceRoot:a.sourceRoot||"",sources:a.sourceFiles||[""],names:[],mappings:e};a.inlineMap&&(e.sourcesContent=[c]);return e};ta.prototype.encodeVlq=function(k){var c,e;c="";for(e=(Math.abs(k)<<1)+(0>k?1:0);e||!c;)k=e&g,(e>>=a)&&(k|=ha),c+=this.encodeBase64(k);return c};
|
||||
ta.prototype.encodeBase64=function(a){var c;if(!(c=k[a]))throw Error("Cannot Base64 encode value: "+a);return c};a=5;ha=1<<a;g=ha-1;k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return ta}()}).call(this);return k}();q["./coffeescript"]=function(){var k={};(function(){var ra,sa,ha,a,g,ta,m,c,e,y,D,w,z,l,E,A,B,J,p,ua={}.hasOwnProperty;c=q("fs");p=q("vm");E=q("path");ra=q("./lexer").Lexer;l=q("./parser").parser;y=q("./helpers");sa=q("./sourcemap");g=q("../../package.json");k.VERSION=
|
||||
g.version;k.FILE_EXTENSIONS=[".coffee",".litcoffee",".coffee.md"];k.helpers=y;ha=function(a){switch(!1){case "function"!==typeof Buffer:return Buffer.from(a).toString("base64");case "function"!==typeof btoa:return btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,function(a,c){return String.fromCharCode("0x"+c)}));default:throw Error("Unable to base64 encode inline sourcemap.");}};g=function(a){return function(c,e){e=void 0===e?{}:e;try{return a.call(this,c,e)}catch(t){if("string"!==typeof c)throw t;
|
||||
throw y.updateSyntaxError(t,c,e.filename);}}};J={};B={};k.compile=a=g(function(a,c){var e,h,g,k,n,m,p,q,A,w,E,D,P;g=y.extend;c=g({},c);m=c.sourceMap||c.inlineMap||null==c.filename;g=c.filename||"\x3canonymous\x3e";J[g]=a;m&&(w=new sa);h=z.tokenize(a,c);k=c;A=[];n=0;for(p=h.length;n<p;n++)e=h[n],"IDENTIFIER"===e[0]&&A.push(e[1]);k.referencedVars=A;if(null==c.bare||!0!==c.bare)for(k=0,n=h.length;k<n;k++)if(e=h[k],"IMPORT"===(q=e[0])||"EXPORT"===q){c.bare=!0;break}n=l.parse(h).compileToFragments(c);
|
||||
h=0;c.header&&(h+=1);c.shiftLine&&(h+=1);e=0;q="";p=0;for(A=n.length;p<A;p++)k=n[p],m&&(k.locationData&&!/^[;\s]*$/.test(k.code)&&w.add([k.locationData.first_line,k.locationData.first_column],[h,e],{noReplace:!0}),E=y.count(k.code,"\n"),h+=E,e=E?k.code.length-(k.code.lastIndexOf("\n")+1):e+k.code.length),q+=k.code;c.header&&(e="Generated by CoffeeScript "+this.VERSION,q="// "+e+"\n"+q);m&&(P=w.generate(c,a),B[g]=w);c.inlineMap&&(a=ha(JSON.stringify(P)),g="//# sourceURL\x3d"+(null!=(D=c.filename)?
|
||||
D:"coffeescript"),q=q+"\n"+("//# sourceMappingURL\x3ddata:application/json;base64,"+a)+"\n"+g);return c.sourceMap?{js:q,sourceMap:w,v3SourceMap:JSON.stringify(P,null,2)}:q});k.tokens=g(function(a,c){return z.tokenize(a,c)});k.nodes=g(function(a,c){return"string"===typeof a?l.parse(z.tokenize(a,c)):l.parse(a)});k.run=function(e,g){g=void 0===g?{}:g;var h,k,l;k=q.main;k.filename=process.argv[1]=g.filename?c.realpathSync(g.filename):"\x3canonymous\x3e";k.moduleCache&&(k.moduleCache={});h=null!=g.filename?
|
||||
E.dirname(c.realpathSync(g.filename)):c.realpathSync(".");k.paths=q("module")._nodeModulePaths(h);if(!y.isCoffee(k.filename)||q.extensions)e=a(e,g),e=null!=(l=e.js)?l:e;return k._compile(e,k.filename)};k.eval=function(c,e){e=void 0===e?{}:e;var h,g,k,l,m,n,y,z,A,w;if(c=c.trim()){l=null!=(m=p.Script.createContext)?m:p.createContext;m=null!=(k=p.isContext)?k:function(a){return e.sandbox instanceof l().constructor};if(l){if(null!=e.sandbox){if(m(e.sandbox))w=e.sandbox;else for(n in w=l(),m=e.sandbox,
|
||||
m)ua.call(m,n)&&(k=m[n],w[n]=k);w.global=w.root=w.GLOBAL=w}else w=global;w.__filename=e.filename||"eval";w.__dirname=E.dirname(w.__filename);if(w===global&&!w.module&&!w.require){h=q("module");w.module=g=new h(e.modulename||"eval");w.require=k=function(a){return h._load(a,g,!0)};g.filename=w.__filename;A=Object.getOwnPropertyNames(q);m=0;for(y=A.length;m<y;m++)z=A[m],"paths"!==z&&"arguments"!==z&&"caller"!==z&&(k[z]=q[z]);k.paths=g.paths=h._nodeModulePaths(process.cwd());k.resolve=function(a){return h._resolveFilename(a,
|
||||
g)}}}m={};for(n in e)ua.call(e,n)&&(k=e[n],m[n]=k);m.bare=!0;c=a(c,m);return w===global?p.runInThisContext(c):p.runInContext(c,w)}};k.register=function(){return q("./register")};if(q.extensions)for(A=this.FILE_EXTENSIONS,ta=function(a){var c;return null!=(c=q.extensions)[a]?c[a]:c[a]=function(){throw Error("Use CoffeeScript.register() or require the coffeescript/register module to require "+a+" files.");}},D=0,w=A.length;D<w;D++)g=A[D],ta(g);k._compileFile=function(e,g,k){g=void 0===g?!1:g;k=void 0===
|
||||
k?!1:k;var h,l;l=c.readFileSync(e,"utf8");l=65279===l.charCodeAt(0)?l.substring(1):l;try{h=a(l,{filename:e,sourceMap:g,inlineMap:k,sourceFiles:[e],literate:y.isLiterate(e)})}catch(x){throw y.updateSyntaxError(x,l,e);}return h};z=new ra;l.lexer={lex:function(){var a,c;(c=l.tokens[this.pos++])?(a=c[0],this.yytext=c[1],this.yylloc=c[2],l.errorToken=c.origin||c,this.yylineno=this.yylloc.first_line):a="";return a},setInput:function(a){l.tokens=a;return this.pos=0},upcomingInput:function(){return""}};l.yy=
|
||||
q("./nodes");l.yy.parseError=function(a,c){var e,h,g,k;g=l.errorToken;k=l.tokens;e=g[0];h=g[1];a=g[2];h=function(){switch(!1){case g!==k[k.length-1]:return"end of input";case "INDENT"!==e&&"OUTDENT"!==e:return"indentation";case "IDENTIFIER"!==e&&"NUMBER"!==e&&"INFINITY"!==e&&"STRING"!==e&&"STRING_START"!==e&&"REGEX"!==e&&"REGEX_START"!==e:return e.replace(/_START$/,"").toLowerCase();default:return y.nameWhitespaceCharacter(h)}}();return y.throwSyntaxError("unexpected "+h,a)};m=function(a,c){var e,
|
||||
g,h,k;a.isNative()?e="native":(a.isEval()?(g=a.getScriptNameOrSourceURL())||a.getEvalOrigin():g=a.getFileName(),g||(g="\x3canonymous\x3e"),h=a.getLineNumber(),e=a.getColumnNumber(),e=(c=c(g,h,e))?g+":"+c[0]+":"+c[1]:g+":"+h+":"+e);g=a.getFunctionName();h=a.isConstructor();if(a.isToplevel()||h)return h?"new "+(g||"\x3canonymous\x3e")+" ("+e+")":g?g+" ("+e+")":e;h=a.getMethodName();k=a.getTypeName();return g?(c=a="",k&&g.indexOf(k)&&(c=k+"."),h&&g.indexOf("."+h)!==g.length-h.length-1&&(a=" [as "+h+
|
||||
"]"),""+c+g+a+" ("+e+")"):k+"."+(h||"\x3canonymous\x3e")+" ("+e+")"};e=function(c){return null!=B[c]?B[c]:null!=B["\x3canonymous\x3e"]?B["\x3canonymous\x3e"]:null!=J[c]?(c=a(J[c],{filename:c,sourceMap:!0,literate:y.isLiterate(c)}),c.sourceMap):null};Error.prepareStackTrace=function(a,c){var g,h,l;l=function(a,c,g){var h;a=e(a);null!=a&&(h=a.sourceLocation([c-1,g-1]));return null!=h?[h[0]+1,h[1]+1]:null};h=function(){var a,e,h;h=[];a=0;for(e=c.length;a<e;a++){g=c[a];if(g.getFunction()===k.run)break;
|
||||
h.push(" at "+m(g,l))}return h}();return a.toString()+"\n"+h.join("\n")+"\n"}}).call(this);return k}();q["./browser"]=function(){(function(){var k,ra,sa,ha=[].indexOf||function(a){for(var g=0,k=this.length;g<k;g++)if(g in this&&this[g]===a)return g;return-1};k=q("./coffeescript");k.require=q;ra=k.compile;k.eval=function(a,g){g=void 0===g?{}:g;null==g.bare&&(g.bare=!0);return eval(ra(a,g))};k.run=function(a,g){g=void 0===g?{}:g;g.bare=!0;g.shiftLine=!0;return Function(ra(a,g))()};"undefined"!==
|
||||
typeof window&&null!==window&&("undefined"!==typeof btoa&&null!==btoa&&"undefined"!==typeof JSON&&null!==JSON&&(ra=function(a,g){g=void 0===g?{}:g;g.inlineMap=!0;return k.compile(a,g)}),k.load=function(a,g,q,m){q=void 0===q?{}:q;m=void 0===m?!1:m;var c;q.sourceFiles=[a];c=window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLHTTP"):new window.XMLHttpRequest;c.open("GET",a,!0);"overrideMimeType"in c&&c.overrideMimeType("text/plain");c.onreadystatechange=function(){var e;if(4===c.readyState){if(0===
|
||||
(e=c.status)||200===e)e=[c.responseText,q],m||k.run.apply(k,[].concat($jscomp.arrayFromIterable(e)));else throw Error("Could not load "+a);if(g)return g(e)}};return c.send(null)},sa=function(){var a,g,q,m,c,e,y,D,w,z,l;l=window.document.getElementsByTagName("script");g=["text/coffeescript","text/literate-coffeescript"];a=function(){var a,c,e,k;k=[];a=0;for(c=l.length;a<c;a++)w=l[a],(e=w.type,0<=ha.call(g,e))&&k.push(w);return k}();e=0;q=function(){var c;c=a[e];if(c instanceof Array)return k.run.apply(k,
|
||||
[].concat($jscomp.arrayFromIterable(c))),e++,q()};m=function(c,e){var l,m;l={literate:c.type===g[1]};if(m=c.src||c.getAttribute("data-src"))return l.filename=m,k.load(m,function(c){a[e]=c;return q()},l,!0);l.filename=c.id&&""!==c.id?c.id:"coffeescript"+(0!==e?e:"");l.sourceFiles=["embedded"];return a[e]=[c.innerHTML,l]};c=y=0;for(D=a.length;y<D;c=++y)z=a[c],m(z,c);return q()},window.addEventListener?window.addEventListener("DOMContentLoaded",sa,!1):window.attachEvent("onload",sa))}).call(this);return{}}();
|
||||
return q["./coffeescript"]}();"function"===typeof define&&define.amd?define(function(){return ra}):q.CoffeeScript=ra})(this);
|
||||
3989
docs/v2/index.html
Normal file
3989
docs/v2/index.html
Normal file
File diff suppressed because it is too large
Load Diff
12627
docs/v2/test.html
Normal file
12627
docs/v2/test.html
Normal file
File diff suppressed because it is too large
Load Diff
18
documentation/examples/async.coffee
Normal file
18
documentation/examples/async.coffee
Normal file
@@ -0,0 +1,18 @@
|
||||
# Your browser must support async/await and speech synthesis
|
||||
# to run this example.
|
||||
|
||||
sleep = (ms) ->
|
||||
new Promise (resolve) ->
|
||||
window.setTimeout resolve, ms
|
||||
|
||||
say = (text) ->
|
||||
window.speechSynthesis.cancel()
|
||||
window.speechSynthesis.speak new SpeechSynthesisUtterance text
|
||||
|
||||
countdown = (seconds) ->
|
||||
for i in [seconds..1]
|
||||
say i
|
||||
await sleep 1000 # wait one second
|
||||
say "Blastoff!"
|
||||
|
||||
countdown 3
|
||||
@@ -0,0 +1,2 @@
|
||||
self = this
|
||||
f = -> yield self
|
||||
@@ -0,0 +1,3 @@
|
||||
f = (a = 1) -> a
|
||||
|
||||
f(null) # Returns 1 in CoffeeScript 1.x, null in CoffeeScript 2
|
||||
@@ -0,0 +1,4 @@
|
||||
A = ->
|
||||
B = ->
|
||||
B extends A
|
||||
B.prototype.foo = -> A::foo.apply this, arguments
|
||||
@@ -0,0 +1,3 @@
|
||||
class A
|
||||
class B extends A
|
||||
foo: -> super arguments...
|
||||
@@ -0,0 +1,2 @@
|
||||
class B extends A
|
||||
foo: -> super arguments...
|
||||
@@ -0,0 +1,2 @@
|
||||
class B extends A
|
||||
foo: -> super()
|
||||
1
documentation/examples/comment.coffee
Normal file
1
documentation/examples/comment.coffee
Normal file
@@ -0,0 +1 @@
|
||||
code = 2 * 617 # The code is 1234
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'local-file.coffee'
|
||||
import 'coffee-script'
|
||||
import 'coffeescript'
|
||||
|
||||
import _ from 'underscore'
|
||||
import * as underscore from 'underscore'
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
$('.account').attr class: 'active'
|
||||
$('.account').prop class: 'active'
|
||||
|
||||
log object.class
|
||||
|
||||
9
documentation/examples/static.coffee
Normal file
9
documentation/examples/static.coffee
Normal file
@@ -0,0 +1,9 @@
|
||||
class Teenager
|
||||
@say: (speech) ->
|
||||
words = speech.split ' '
|
||||
fillers = ['uh', 'um', 'like', 'actually', 'so', 'maybe']
|
||||
output = []
|
||||
for word, index in words
|
||||
output.push word
|
||||
output.push fillers[Math.floor(Math.random() * fillers.length)] unless index is words.length - 1
|
||||
output.join ', '
|
||||
1
documentation/images/link.svg
Normal file
1
documentation/images/link.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg aria-hidden="true" version="1.1" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>
|
||||
|
After Width: | Height: | Size: 436 B |
16
documentation/sections/annotated_source.md
Normal file
16
documentation/sections/annotated_source.md
Normal file
@@ -0,0 +1,16 @@
|
||||
## Annotated Source
|
||||
|
||||
You can browse the CoffeeScript <%= fullVersion %> source in readable, annotated form [here](http://coffeescript.org/v<%= majorVersion %>/annotated-source/). You can also jump directly to a particular source file:
|
||||
|
||||
- [Grammar Rules — src/grammar](http://coffeescript.org/v<%= majorVersion %>/annotated-source/grammar.html)
|
||||
- [Lexing Tokens — src/lexer](http://coffeescript.org/v<%= majorVersion %>/annotated-source/lexer.html)
|
||||
- [The Rewriter — src/rewriter](http://coffeescript.org/v<%= majorVersion %>/annotated-source/rewriter.html)
|
||||
- [The Syntax Tree — src/nodes](http://coffeescript.org/v<%= majorVersion %>/annotated-source/nodes.html)
|
||||
- [Lexical Scope — src/scope](http://coffeescript.org/v<%= majorVersion %>/annotated-source/scope.html)
|
||||
- [Helpers & Utility Functions — src/helpers](http://coffeescript.org/v<%= majorVersion %>/annotated-source/helpers.html)
|
||||
- [The CoffeeScript Module — src/coffeescript](http://coffeescript.org/v<%= majorVersion %>/annotated-source/coffeescript.html)
|
||||
- [Cake & Cakefiles — src/cake](http://coffeescript.org/v<%= majorVersion %>/annotated-source/cake.html)
|
||||
- [“coffee” Command-Line Utility — src/command](http://coffeescript.org/v<%= majorVersion %>/annotated-source/command.html)
|
||||
- [Option Parsing — src/optparse](http://coffeescript.org/v<%= majorVersion %>/annotated-source/optparse.html)
|
||||
- [Interactive REPL — src/repl](http://coffeescript.org/v<%= majorVersion %>/annotated-source/repl.html)
|
||||
- [Source Maps — src/sourcemap](http://coffeescript.org/v<%= majorVersion %>/annotated-source/sourcemap.html)
|
||||
105
documentation/sections/breaking_changes.md
Normal file
105
documentation/sections/breaking_changes.md
Normal file
@@ -0,0 +1,105 @@
|
||||
## Breaking Changes From CoffeeScript 1.x to 2
|
||||
|
||||
CoffeeScript 2 aims to output as much idiomatic ES2015+ syntax as possible with as few breaking changes from CoffeeScript 1.x as possible. Some breaking changes, unfortunately, were unavoidable.
|
||||
|
||||
### Function parameter default values
|
||||
|
||||
Per the [ES2015 spec regarding default parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters), default values are only applied when a parameter value is missing or `undefined`. In CoffeeScript 1.x, the default value would be applied in those cases but also if the parameter value was `null`.
|
||||
|
||||
```
|
||||
codeFor('breaking_change_function_parameter_default_values', 'f(null)')
|
||||
```
|
||||
|
||||
### Bound generator functions
|
||||
|
||||
Bound generator functions, a.k.a. generator arrow functions, [aren’t allowed in ECMAScript](http://stackoverflow.com/questions/27661306/can-i-use-es6s-arrow-function-syntax-with-generators-arrow-notation). You can write `function*` or `=>`, but not both. Therefore, CoffeeScript code like this:
|
||||
|
||||
> ```coffee
|
||||
f = => yield this # Throws a compiler error
|
||||
```
|
||||
|
||||
Needs to be rewritten the old-fashioned way:
|
||||
|
||||
```
|
||||
codeFor('breaking_change_bound_generator_function')
|
||||
```
|
||||
|
||||
### Classes are compiled to ES2015 classes
|
||||
|
||||
ES2015 classes and their methods have some restrictions beyond those on regular functions.
|
||||
|
||||
Class constructors can’t be invoked without `new`:
|
||||
|
||||
> ```coffee
|
||||
(class)() # Throws a TypeError at runtime
|
||||
```
|
||||
|
||||
Derived (extended) class `constructor`s cannot use `this` before calling `super`:
|
||||
|
||||
> ```coffee
|
||||
class B extends A
|
||||
constructor: -> this # Throws a compiler error
|
||||
```
|
||||
|
||||
Class methods can’t be used with `new` (uncommon):
|
||||
|
||||
> ```coffee
|
||||
class Namespace
|
||||
@Klass = ->
|
||||
new Namespace.Klass # Throws a TypeError at runtime
|
||||
```
|
||||
|
||||
### Bare `super`
|
||||
|
||||
Due to a syntax clash with `super` with accessors, bare `super` no longer compiles to a super call forwarding all arguments.
|
||||
|
||||
> ```coffee
|
||||
class B extends A
|
||||
foo: -> super # Throws a compiler error
|
||||
```
|
||||
|
||||
Arguments can be forwarded explicitly using splats:
|
||||
|
||||
```
|
||||
codeFor('breaking_change_super_with_arguments')
|
||||
```
|
||||
|
||||
Or if you know that the parent function doesn’t require arguments, just call `super()`:
|
||||
|
||||
```
|
||||
codeFor('breaking_change_super_without_arguments')
|
||||
```
|
||||
|
||||
### `super` in non-class methods
|
||||
|
||||
In CoffeeScript 1.x it is possible to use `super` in more than just class methods, such as in manually prototype-assigned functions:
|
||||
|
||||
> ```coffee
|
||||
A = ->
|
||||
B = ->
|
||||
B extends A
|
||||
B.prototype.foo = -> super arguments... # Throws a compiler error
|
||||
```
|
||||
|
||||
Due to the switch to ES2015 `super`, this is no longer supported. The above case could be refactored to:
|
||||
|
||||
```
|
||||
codeFor('breaking_change_super_in_non-class_methods_refactor_with_apply')
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
codeFor('breaking_change_super_in_non-class_methods_refactor_with_class')
|
||||
```
|
||||
|
||||
### Dynamic class keys exclude executable class scope
|
||||
|
||||
Due to the hoisting required to compile to ES2015 classes, dynamic keys in class methods can’t use values from the executable class body unless the methods are assigned in prototype style.
|
||||
|
||||
> ```coffee
|
||||
class A
|
||||
name = 'method'
|
||||
"#{name}": -> # This method will be named 'undefined'
|
||||
@::[name] = -> # This will work; assigns to `A.prototype.method`
|
||||
```
|
||||
@@ -1,5 +1,22 @@
|
||||
## Change Log
|
||||
|
||||
```
|
||||
releaseHeader('2017-02-21', '2.0.0-alpha1', '1.12.4')
|
||||
```
|
||||
|
||||
* Initial alpha release of CoffeeScript 2. The CoffeeScript compiler now outputs ES2015+ syntax whenever possible. See [breaking changes](#breaking-changes).
|
||||
* Classes are output using ES2015 `class` and `extends` keywords.
|
||||
* Added support for `async`/`await`.
|
||||
* Bound (arrow) functions now output as `=>` functions.
|
||||
* Function parameters with default values now use ES2015 default values syntax.
|
||||
* Splat function parameters now use ES2015 spread syntax.
|
||||
* Computed properties now use ES2015 syntax.
|
||||
* Interpolated strings (template literals) now use ES2015 backtick syntax.
|
||||
* Improved support for recognizing Markdown in Literate CoffeeScript files.
|
||||
* Mixing tabs and spaces in indentation is now disallowed.
|
||||
* Browser compiler is now minified using the Google Closure Compiler (JavaScript version).
|
||||
* Node 7+ required for CoffeeScript 2.
|
||||
|
||||
```
|
||||
releaseHeader('2017-02-18', '1.12.4', '1.12.3')
|
||||
```
|
||||
@@ -155,7 +172,7 @@ releaseHeader('2014-08-26', '1.8.0', '1.7.1')
|
||||
* Fixed a slight formatting error in CoffeeScript’s source map-patched stack traces.
|
||||
* The `%%` operator now coerces its right operand only once.
|
||||
* It is now possible to require CoffeeScript files from Cakefiles without having to register the compiler first.
|
||||
* The CoffeeScript REPL is now exported and can be required using `require 'coffee-script/repl'`.
|
||||
* The CoffeeScript REPL is now exported and can be required using `require 'coffeescript/repl'`.
|
||||
* Fixes for the REPL in Node 0.11.
|
||||
|
||||
```
|
||||
@@ -168,7 +185,7 @@ releaseHeader('2014-01-29', '1.7.1', '1.7.0')
|
||||
releaseHeader('2014-01-28', '1.7.0', '1.6.3')
|
||||
```
|
||||
|
||||
* When requiring CoffeeScript files in Node you must now explicitly register the compiler. This can be done with `require 'coffee-script/register'` or `CoffeeScript.register()`. Also for configuration such as Mocha’s, use **coffee-script/register**.
|
||||
* When requiring CoffeeScript files in Node you must now explicitly register the compiler. This can be done with `require 'coffeescript/register'` or `CoffeeScript.register()`. Also for configuration such as Mocha’s, use **coffeescript/register**.
|
||||
* Improved error messages, source maps and stack traces. Source maps now use the updated `//#` syntax.
|
||||
* Leading `.` now closes all open calls, allowing for simpler chaining syntax.
|
||||
|
||||
@@ -268,7 +285,7 @@ releaseHeader('2011-11-08', '1.1.3', '1.1.2')
|
||||
* Ahh, whitespace. CoffeeScript’s compiled JS now tries to space things out and keep it readable, as you can see in the examples on this page.
|
||||
* You can now call `super` in class level methods in class bodies, and bound class methods now preserve their correct context.
|
||||
* JavaScript has always supported octal numbers `010 is 8`, and hexadecimal numbers `0xf is 15`, but CoffeeScript now also supports binary numbers: `0b10 is 2`.
|
||||
* The CoffeeScript module has been nested under a subdirectory to make it easier to `require` individual components separately, without having to use **npm**. For example, after adding the CoffeeScript folder to your path: `require('coffee-script/lexer')`
|
||||
* The CoffeeScript module has been nested under a subdirectory to make it easier to `require` individual components separately, without having to use **npm**. For example, after adding the CoffeeScript folder to your path: `require('coffeescript/lexer')`
|
||||
* There’s a new “link” feature in Try CoffeeScript on this webpage. Use it to get a shareable permalink for your example script.
|
||||
* The `coffee --watch` feature now only works on Node.js 0.6.0 and higher, but now also works properly on Windows.
|
||||
* Lots of small bug fixes from **[@michaelficarra](https://github.com/michaelficarra)**, **[@geraldalewis](https://github.com/geraldalewis)**, **[@satyr](https://github.com/satyr)**, and **[@trevorburnham](https://github.com/trevorburnham)**.
|
||||
@@ -387,7 +404,7 @@ Trailing commas are now allowed, a-la Python. Static properties may be assigned
|
||||
releaseHeader('2010-03-23', '0.5.6', '0.5.5')
|
||||
```
|
||||
|
||||
Interpolation can now be used within regular expressions and heredocs, as well as strings. Added the `<-` bind operator. Allowing assignment to half-expressions instead of special `||=`-style operators. The arguments object is no longer automatically converted into an array. After requiring `coffee-script`, Node.js can now directly load `.coffee` files, thanks to **registerExtension**. Multiple splats can now be used in function calls, arrays, and pattern matching.
|
||||
Interpolation can now be used within regular expressions and heredocs, as well as strings. Added the `<-` bind operator. Allowing assignment to half-expressions instead of special `||=`-style operators. The arguments object is no longer automatically converted into an array. After requiring `coffeescript`, Node.js can now directly load `.coffee` files, thanks to **registerExtension**. Multiple splats can now be used in function calls, arrays, and pattern matching.
|
||||
|
||||
```
|
||||
releaseHeader('2010-03-08', '0.5.5', '0.5.4')
|
||||
@@ -412,7 +429,7 @@ releaseHeader('2010-02-25', '0.5.2', '0.5.1')
|
||||
```
|
||||
|
||||
Added a compressed version of the compiler for inclusion in web pages as
|
||||
`v<%= majorVersion %>/browser-compiler/coffee-script.js`. It’ll automatically run any script tags with type `text/coffeescript` for you. Added a `--stdio` option to the `coffee` command, for piped-in compiles.
|
||||
`v<%= majorVersion %>/browser-compiler/coffeescript.js`. It’ll automatically run any script tags with type `text/coffeescript` for you. Added a `--stdio` option to the `coffee` command, for piped-in compiles.
|
||||
|
||||
```
|
||||
releaseHeader('2010-02-24', '0.5.1', '0.5.0')
|
||||
@@ -501,7 +518,7 @@ Bugfix for running `coffee --interactive` and `--run` from outside of the Coffee
|
||||
releaseHeader('2009-12-26', '0.1.5', '0.1.4')
|
||||
```
|
||||
|
||||
Array slice literals and array comprehensions can now both take Ruby-style ranges to specify the start and end. JavaScript variable declaration is now pushed up to the top of the scope, making all assignment statements into expressions. You can use `\` to escape newlines. The `coffee-script` command is now called `coffee`.
|
||||
Array slice literals and array comprehensions can now both take Ruby-style ranges to specify the start and end. JavaScript variable declaration is now pushed up to the top of the scope, making all assignment statements into expressions. You can use `\` to escape newlines. The `coffeescript` command is now called `coffee`.
|
||||
|
||||
```
|
||||
releaseHeader('2009-12-25', '0.1.4', '0.1.3')
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
## Web Chat (IRC)
|
||||
|
||||
Quick help and advice can usually be found in the CoffeeScript IRC room. Join `#coffeescript` on `irc.freenode.net`, or click the button below to open a webchat session on this page.
|
||||
|
||||
<button id="open_webchat">click to open #coffeescript</button>
|
||||
Quick help and advice can often be found in the CoffeeScript IRC room `#coffeescript` on `irc.freenode.net`, which you can [join via your web browser](http://webchat.freenode.net/?channels=coffeescript).
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
## Classes, Inheritance, and Super
|
||||
## Classes
|
||||
|
||||
JavaScript’s prototypal inheritance has always been a bit of a brain-bender, with a whole family tree of libraries that provide a cleaner syntax for classical inheritance on top of JavaScript’s prototypes: [Base2](http://code.google.com/p/base2/), [Prototype.js](http://prototypejs.org/), [JS.Class](http://jsclass.jcoglan.com/), etc. The libraries provide syntactic sugar, but the built-in inheritance would be completely usable if it weren’t for a couple of small exceptions: it’s awkward to call **super** (the prototype object’s implementation of the current function), and it’s awkward to correctly set the prototype chain.
|
||||
|
||||
Instead of repetitively attaching functions to a prototype, CoffeeScript provides a basic `class` structure that allows you to name your class, set the superclass, assign prototypal properties, and define the constructor, in a single assignable expression.
|
||||
|
||||
Constructor functions are named, to better support helpful stack traces. In the first class in the example below, `this.constructor.name is "Animal"`.
|
||||
CoffeeScript 1 provided the `class` and `extends` keywords as syntactic sugar for working with prototypal functions. With ES2015, JavaScript has adopted those keywords; so CoffeeScript 2 compiles its `class` and `extends` keywords to ES2015 classes.
|
||||
|
||||
```
|
||||
codeFor('classes', true)
|
||||
```
|
||||
|
||||
If structuring your prototypes classically isn’t your cup of tea, CoffeeScript provides a couple of lower-level conveniences. The `extends` operator helps with proper prototype setup, and can be used to create an inheritance chain between any pair of constructor functions; `::` gives you quick access to an object’s prototype; and `super()` is converted into a call against the immediate ancestor’s method of the same name.
|
||||
Static methods can be defined using `@` before the method name:
|
||||
|
||||
```
|
||||
codeFor('prototypes', '"one_two".dasherize()')
|
||||
codeFor('static', 'Teenager.say("Are we there yet?")')
|
||||
```
|
||||
|
||||
Finally, class definitions are blocks of executable code, which make for interesting metaprogramming possibilities. Because in the context of a class definition, `this` is the class object itself (the constructor function), you can assign static properties by using
|
||||
`@property: value`, and call functions defined in parent classes: `@attr 'title', type: 'text'`
|
||||
Finally, class definitions are blocks of executable code, which make for interesting metaprogramming possibilities. In the context of a class definition, `this` is the class object itself; therefore, you can assign static properties by using `@property: value`.
|
||||
|
||||
5
documentation/sections/coffeescript_2.md
Normal file
5
documentation/sections/coffeescript_2.md
Normal file
@@ -0,0 +1,5 @@
|
||||
## CoffeeScript 2
|
||||
|
||||
CoffeeScript 2 generates JavaScript that uses the latest ES2015+ features. It is your responsibility to ensure that your target JavaScript runtime(s) support all these features, or that you pass the output through another transpiler like [Babel](http://babeljs.io/), [Rollup](https://github.com/rollup/rollup) or [Traceur Compiler](https://github.com/google/traceur-compiler). In general, [CoffeeScript 2’s output is fully supported by Node.js 7+](http://node.green/), although async functions require the `--harmony` or `--harmony-async-await` flags; and ES2015 modules require an additional transpiler. Output JavaScript intended for browsers generally requires additional transpilation.
|
||||
|
||||
If you’re looking for a single tool that takes CoffeeScript input and generates JavaScript output that runs in any JavaScript runtime, assuming you opt out of certain newer features, stick to the [CoffeeScript 1.x branch](v1/). CoffeeScript 2 [breaks compatibility](#breaking-changes) with certain CoffeeScript 1.x features in order to conform with the ES2015+ specifications, and generate more idiomatic output (a CoffeeScript `=>` becomes an ES `=>`; a CoffeeScript `class` becomes an ES `class`; and so on).
|
||||
13
documentation/sections/comments.md
Normal file
13
documentation/sections/comments.md
Normal file
@@ -0,0 +1,13 @@
|
||||
## Comments
|
||||
|
||||
In CoffeeScript, comments are denoted by the `#` character. Everything from a `#` to the end of the line is ignored by the compiler, and will be excluded from the JavaScript output.
|
||||
|
||||
```
|
||||
codeFor('comment')
|
||||
```
|
||||
|
||||
Sometimes you’d like to pass a block comment through to the generated JavaScript. For example, when you need to embed a licensing header at the top of a file. Block comments, which mirror the syntax for block strings, are preserved in the generated output.
|
||||
|
||||
```
|
||||
codeFor('block_comment')
|
||||
```
|
||||
@@ -1,4 +1,4 @@
|
||||
## Bound Functions, Generator Functions
|
||||
## Function Modifiers
|
||||
|
||||
In JavaScript, the `this` keyword is dynamically scoped to mean the object that the current function is attached to. If you pass a function as a callback or attach it to a different object, the original value of `this` will be lost. If you’re not familiar with this behavior, [this Digital Web article](http://64.13.255.16/articles/scope_in_javascript/) gives a good overview of the quirks.
|
||||
|
||||
@@ -12,7 +12,7 @@ If we had used `->` in the callback above, `@customer` would have referred to th
|
||||
|
||||
When used in a class definition, methods declared with the fat arrow will be automatically bound to each instance of the class when the instance is constructed.
|
||||
|
||||
CoffeeScript functions also support [ES2015 generator functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*) through the `yield` keyword. There’s no `function*(){}` nonsense — a generator in CoffeeScript is simply a function that yields.
|
||||
CoffeeScript also supports [generator functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*) and [async functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) through the `yield` and `await` keywords respectively. There's no `function*(){}` or `async function(){}` nonsense — a generator in CoffeeScript is simply a function that yields, and an async function in CoffeeScript is simply a function that awaits.
|
||||
|
||||
```
|
||||
codeFor('generators', 'ps.next().value')
|
||||
@@ -25,3 +25,9 @@ You can iterate over a generator function using `for…from`.
|
||||
```
|
||||
codeFor('generator_iteration', 'getFibonacciNumbers(10)')
|
||||
```
|
||||
|
||||
Similar to how `yield return` forces a generator, `await return` may be used to force a function to be async.
|
||||
|
||||
```
|
||||
codeFor('async', true)
|
||||
```
|
||||
|
||||
@@ -6,7 +6,7 @@ Functions are defined by an optional list of parameters in parentheses, an arrow
|
||||
codeFor('functions', 'cube(5)')
|
||||
```
|
||||
|
||||
Functions may also have default values for arguments, which will be used if the incoming argument is missing (`null` or `undefined`).
|
||||
Functions may also have default values for arguments, which will be used if the incoming argument is missing (`undefined`).
|
||||
|
||||
```
|
||||
codeFor('default_args', 'fill("cup")')
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
## Installation
|
||||
|
||||
The command-line version of `coffee` is available as a [Node.js](http://nodejs.org/) utility. The [core compiler](v<%= majorVersion %>/browser-compiler/coffee-script.js) however, does not depend on Node, and can be run in any JavaScript environment, or in the browser (see [Try CoffeeScript](#try)).
|
||||
The command-line version of `coffee` is available as a [Node.js](http://nodejs.org/) utility. The [core compiler](v<%= majorVersion %>/browser-compiler/coffeescript.js) however, does not depend on Node, and can be run in any JavaScript environment, or in the browser (see [Try CoffeeScript](#try)).
|
||||
|
||||
To install, first make sure you have a working copy of the latest stable version of [Node.js](http://nodejs.org/). You can then install CoffeeScript globally with [npm](http://npmjs.org):
|
||||
|
||||
> ```
|
||||
npm install --global coffee-script
|
||||
npm install --global coffeescript
|
||||
```
|
||||
|
||||
When you need CoffeeScript as a dependency of a project, within that project’s folder you can install it locally:
|
||||
|
||||
> ```
|
||||
npm install --save coffee-script
|
||||
npm install --save coffeescript
|
||||
```
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
**CoffeeScript is a little language that compiles into JavaScript.** Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.
|
||||
|
||||
The golden rule of CoffeeScript is: _“It’s just JavaScript”_. The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable, pretty-printed, and tends to run as fast or faster than the equivalent handwritten JavaScript.
|
||||
|
||||
The CoffeeScript compiler goes to great lengths to generate output JavaScript that runs in every JavaScript runtime, but there are exceptions. Use [generator functions](#generator-functions), [`for…from`](#generator-iteration), or [tagged template literals](#tagged-template-literals) only if you know that your [target runtimes can support them](http://kangax.github.io/compat-table/es6/). If you use [modules](#modules), you will need to [use an additional tool to resolve them](#modules-note).
|
||||
The golden rule of CoffeeScript is: _“It’s just JavaScript.”_ The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable, pretty-printed, and tends to run as fast or faster than the equivalent handwritten JavaScript.
|
||||
|
||||
**Latest Version:** [<%= fullVersion %>](http://github.com/jashkenas/coffeescript/tarball/<%= fullVersion %>)
|
||||
|
||||
> ```
|
||||
npm install -g coffee-script
|
||||
npm install -g coffeescript
|
||||
```
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
_This reference is structured so that it can be read from top to bottom, if you like. Later sections use ideas and syntax previously introduced. Familiarity with JavaScript is assumed. In all of the following examples, the source CoffeeScript is provided on the left, and the direct compilation into JavaScript is on the right._
|
||||
|
||||
_Many of the examples can be run (where it makes sense) by pressing the **run** button on the right, and can be loaded into the “Try CoffeeScript” console by pressing the **load** button on the left._
|
||||
_Many of the examples can be run (where it makes sense) by pressing the_ <small>▶</small> _button on the right. The CoffeeScript on the left is editable, and the JavaScript will update as you edit._
|
||||
|
||||
First, the basics: CoffeeScript uses significant whitespace to delimit blocks of code. You don’t need to use semicolons `;` to terminate expressions, ending the line will do just as well (although semicolons can still be used to fit multiple expressions onto a single line). Instead of using curly braces `{ }` to surround blocks of code in [functions](#literals), [if-statements](#conditionals), [switch](#switch), and [try/catch](#try), use indentation.
|
||||
|
||||
|
||||
@@ -3,5 +3,3 @@
|
||||
Besides being used as an ordinary programming language, CoffeeScript may also be written in “literate” mode. If you name your file with a `.litcoffee` extension, you can write it as a Markdown document — a document that also happens to be executable CoffeeScript code. The compiler will treat any indented blocks (Markdown’s way of indicating source code) as code, and ignore the rest as comments.
|
||||
|
||||
Just for kicks, a little bit of the compiler is currently implemented in this fashion: See it [as a document](https://gist.github.com/jashkenas/3fc3c1a8b1009c00d9df), [raw](https://raw.github.com/jashkenas/coffeescript/master/src/scope.litcoffee), and [properly highlighted in a text editor](http://cl.ly/LxEu).
|
||||
|
||||
I’m fairly excited about this direction for the language, and am looking forward to writing (and more importantly, reading) more programs in this style. More information about Literate CoffeeScript, including an [example program](https://github.com/jashkenas/journo), are [available in this blog post](http://ashkenas.com/literate-coffeescript).
|
||||
|
||||
@@ -86,7 +86,7 @@ All together now:
|
||||
|
||||
<tr>
|
||||
|
||||
<td>`false`, `no`, `off`</td>
|
||||
<td>`false`, `no`, `off` </td>
|
||||
|
||||
<td>`false`</td>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Overview
|
||||
|
||||
_CoffeeScript on the left, compiled JavaScript output on the right._
|
||||
_CoffeeScript on the <span class="hidden-md-up">top</span><span class="hidden-sm-down">left</span>, compiled JavaScript output on the <span class="hidden-md-up">bottom</span><span class="hidden-sm-down">right</span>. The CoffeeScript is editable!_
|
||||
|
||||
```
|
||||
codeFor('overview', 'cubes', false)
|
||||
|
||||
7
documentation/sections/prototypal_inheritance.md
Normal file
7
documentation/sections/prototypal_inheritance.md
Normal file
@@ -0,0 +1,7 @@
|
||||
## Prototypal Inheritance
|
||||
|
||||
In addition to supporting ES2015 classes, CoffeeScript provides a few shortcuts for working with prototypes. The `extends` operator can be used to create an inheritance chain between any pair of constructor functions, and `::` gives you quick access to an object’s prototype:
|
||||
|
||||
```
|
||||
codeFor('prototypes', '"one_two".dasherize()')
|
||||
```
|
||||
@@ -1,14 +1,6 @@
|
||||
## Resources
|
||||
|
||||
* [Source Code](http://github.com/jashkenas/coffeescript/)<br>
|
||||
Use `bin/coffee` to test your changes,<br>
|
||||
`bin/cake test` to run the test suite,<br>
|
||||
`bin/cake build` to rebuild the full CoffeeScript compiler, and<br>
|
||||
`bin/cake build:except-parser` to recompile much faster if you’re not editing `grammar.coffee`.
|
||||
|
||||
`git checkout lib && bin/cake build:full` is a good command to run when you’re working on the core language. It’ll refresh the `lib` folder (in case you broke something), build your altered compiler, use that to rebuild itself (a good sanity test) and then run all of the tests. If they pass, there’s a good chance you’ve made a successful change.
|
||||
* [Browser Tests](v<%= majorVersion %>/test.html)<br>
|
||||
Run CoffeeScript’s test suite in your current browser.
|
||||
* [CoffeeScript on GitHub](http://github.com/jashkenas/coffeescript/)
|
||||
* [CoffeeScript Issues](http://github.com/jashkenas/coffeescript/issues)<br>
|
||||
Bug reports, feature proposals, and ideas for changes to the language belong here.
|
||||
* [CoffeeScript Google Group](https://groups.google.com/forum/#!forum/coffeescript)<br>
|
||||
@@ -17,7 +9,7 @@
|
||||
If you’ve ever learned a neat CoffeeScript tip or trick, or ran into a gotcha — share it on the wiki. The wiki also serves as a directory of handy [text editor extensions](http://github.com/jashkenas/coffeescript/wiki/Text-editor-plugins), [web framework plugins](http://github.com/jashkenas/coffeescript/wiki/Web-framework-plugins), and general [CoffeeScript build tools](http://github.com/jashkenas/coffeescript/wiki/Build-tools).
|
||||
* [The FAQ](http://github.com/jashkenas/coffeescript/wiki/FAQ)<br>
|
||||
Perhaps your CoffeeScript-related question has been asked before. Check the FAQ first.
|
||||
* [JS2Coffee](http://js2coffee.org)<br>
|
||||
* [JS2Coffee](http://js2.coffee/)<br>
|
||||
Is a very well done reverse JavaScript-to-CoffeeScript compiler. It’s not going to be perfect (infer what your JavaScript classes are, when you need bound functions, and so on…) — but it’s a great starting point for converting simple scripts.
|
||||
* [High-Rez Logo](https://github.com/jashkenas/coffeescript/tree/master/documentation/images)<br>
|
||||
The CoffeeScript logo is available in SVG for use in presentations.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## "text/coffeescript" Script Tags
|
||||
## `"text/coffeescript"` Script Tags
|
||||
|
||||
While it’s not recommended for serious use, CoffeeScripts may be included directly within the browser using `<script type="text/coffeescript">` tags. The source includes a compressed and minified version of the compiler ([Download current version here, 51k when gzipped](v<%= majorVersion %>/browser-compiler/coffee-script.js)) as `v<%= majorVersion %>/browser-compiler/coffee-script.js`. Include this file on a page with inline CoffeeScript tags, and it will compile and evaluate them in order.
|
||||
While it’s not recommended for serious use, CoffeeScripts may be included directly within the browser using `<script type="text/coffeescript">` tags. The source includes a compressed and minified version of the compiler ([Download current version here, 51k when gzipped](v<%= majorVersion %>/browser-compiler/coffeescript.js)) as `v<%= majorVersion %>/browser-compiler/coffeescript.js`. Include this file on a page with inline CoffeeScript tags, and it will compile and evaluate them in order.
|
||||
|
||||
In fact, the little bit of glue script that runs “Try CoffeeScript” above, as well as the jQuery for the menu, is implemented in just this way. View source and look at the bottom of the page to see the example. Including the script also gives you access to `CoffeeScript.compile()` so you can pop open Firebug and try compiling some strings.
|
||||
In fact, the little bit of glue script that runs [Try CoffeeScript](#try), as well as the code examples and other interactive parts of this site, is implemented in just this way. View source and look at the bottom of the page to see the example. Including the script also gives you access to `CoffeeScript.compile()` so you can pop open your JavaScript console and try compiling some strings.
|
||||
|
||||
The usual caveats about CoffeeScript apply — your inline scripts will run within a closure wrapper, so if you want to expose global variables or functions, attach them to the `window` object.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## Source Maps
|
||||
|
||||
CoffeeScript 1.6.1 and above include support for generating source maps, a way to tell your JavaScript engine what part of your CoffeeScript program matches up with the code being evaluated. Browsers that support it can automatically use source maps to show your original source code in the debugger. To generate source maps alongside your JavaScript files, pass the `--map` or `-m` flag to the compiler.
|
||||
CoffeeScript includes support for generating source maps, a way to tell your JavaScript engine what part of your CoffeeScript program matches up with the code being evaluated. Browsers that support it can automatically use source maps to show your original source code in the debugger. To generate source maps alongside your JavaScript files, pass the `--map` or `-m` flag to the compiler.
|
||||
|
||||
For a full introduction to source maps, how they work, and how to hook them up in your browser, read the [HTML5 Tutorial](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## String Interpolation, Block Strings, and Block Comments
|
||||
## Strings
|
||||
|
||||
Ruby-style string interpolation is included in CoffeeScript. Double-quoted strings allow for interpolated values, using `#{ … }`, and single-quoted strings are literal. You may even use interpolation in object keys.
|
||||
Like JavaScript and many other languages, CoffeeScript supports strings as delimited by the `"` or `'` characters. CoffeeScript also supports string interpolation within `"`-quoted strings, using `#{ … }`. Single-quoted strings are literal. You may even use interpolation in object keys.
|
||||
|
||||
```
|
||||
codeFor('interpolation', 'sentence')
|
||||
@@ -12,16 +12,10 @@ Multiline strings are allowed in CoffeeScript. Lines are joined by a single spac
|
||||
codeFor('strings', 'mobyDick')
|
||||
```
|
||||
|
||||
Block strings can be used to hold formatted or indentation-sensitive text (or, if you just don’t feel like escaping quotes and apostrophes). The indentation level that begins the block is maintained throughout, so you can keep it all aligned with the body of your code.
|
||||
Block strings, delimited by `"""` or `'''`, can be used to hold formatted or indentation-sensitive text (or, if you just don’t feel like escaping quotes and apostrophes). The indentation level that begins the block is maintained throughout, so you can keep it all aligned with the body of your code.
|
||||
|
||||
```
|
||||
codeFor('heredocs', 'html')
|
||||
```
|
||||
|
||||
Double-quoted block strings, like other double-quoted strings, allow interpolation.
|
||||
|
||||
Sometimes you’d like to pass a block comment through to the generated JavaScript. For example, when you need to embed a licensing header at the top of a file. Block comments, which mirror the syntax for block strings, are preserved in the generated code.
|
||||
|
||||
```
|
||||
codeFor('block_comment')
|
||||
```
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
CoffeeScript supports [ES2015 tagged template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals), which enable customized string interpolation. If you immediately prefix a string with a function name (no space between the two), CoffeeScript will output this “function plus string” combination as an ES2015 tagged template literal, which will [behave accordingly](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals): the function is called, with the parameters being the input text and expression parts that make up the interpolated string. The function can then assemble these parts into an output string, providing custom string interpolation.
|
||||
|
||||
Be aware that the CoffeeScript compiler is outputting ES2015 syntax for this feature, so your target JavaScript runtime(s) must support this syntax for your code to work; or you could use tools like [Babel](http://babeljs.io/) or [Traceur Compiler](https://github.com/google/traceur-compiler) to convert this ES2015 syntax into compatible JavaScript.
|
||||
|
||||
```
|
||||
codeFor('tagged_template_literals', 'greet("greg", "awesome")')
|
||||
```
|
||||
|
||||
7
documentation/sections/test.md
Normal file
7
documentation/sections/test.md
Normal file
@@ -0,0 +1,7 @@
|
||||
## Browser-based Tests
|
||||
|
||||
CoffeeScript includes an extensive test suite, which verifies that the compiler generates JavaScript that behaves as it should. The tests canonically run via the Node runtime, and must all pass there before we consider publishing a new release of CoffeeScript; but you can also run the tests in a web browser. This can be a good way to determine which features of CoffeeScript your current browser may not support. In general, the latest version of [Google Chrome Canary](https://www.google.com/chrome/browser/canary.html) should pass all the tests.
|
||||
|
||||
Note that since no JavaScript runtime yet supports ES2015 modules, the tests for module support verify only that the CoffeeScript compiler’s output is the correct syntax; the tests don’t verify that the modules resolve properly.
|
||||
|
||||
[Run the tests in your browser.](http://coffeescript.dev/v<%= majorVersion %>/test.html)
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<title>CoffeeScript Test Suite</title>
|
||||
<script src="browser-compiler/coffee-script.js"></script>
|
||||
<script src="browser-compiler/coffeescript.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/underscorejs/1.8.3/underscore-min.js"></script>
|
||||
<style>
|
||||
body, pre {
|
||||
@@ -39,9 +39,10 @@
|
||||
<script type="text/coffeescript">
|
||||
@testingBrowser = yes
|
||||
@global = window
|
||||
stdout = document.getElementById 'stdout'
|
||||
start = new Date
|
||||
success = total = done = failed = 0
|
||||
stdout = document.getElementById 'stdout'
|
||||
start = new Date
|
||||
@currentFile = ''
|
||||
@passedTests = failedTests = total = done = 0
|
||||
|
||||
say = (msg, className) ->
|
||||
div = document.createElement 'div'
|
||||
@@ -54,12 +55,20 @@ say = (msg, className) ->
|
||||
++total
|
||||
try
|
||||
fn.call(fn)
|
||||
++success
|
||||
catch exception
|
||||
say "#{description}:", 'bad'
|
||||
say fn.toString(), 'subtle' if fn.toString?
|
||||
say exception, 'bad'
|
||||
console.error exception
|
||||
++passedTests
|
||||
catch error
|
||||
failures.push
|
||||
error: error
|
||||
description: description
|
||||
source: fn.toString() if fn.toString?
|
||||
|
||||
@failures =
|
||||
push: (failure) -> # Match function called by regular tests
|
||||
++failedTests
|
||||
say "#{failure.description}:", 'bad'
|
||||
say failure.source, 'subtle' if failure.source?
|
||||
say failure.error, 'bad'
|
||||
console.error failure.error
|
||||
|
||||
@ok = (good, msg = 'Error') ->
|
||||
throw Error msg unless good
|
||||
@@ -99,14 +108,15 @@ say = (msg, className) ->
|
||||
for test in document.getElementsByClassName 'test'
|
||||
say '\u2714 ' + test.id
|
||||
options = {}
|
||||
options.filename = currentFile = test.id
|
||||
options.literate = yes if test.type is 'text/x-literate-coffeescript'
|
||||
CoffeeScript.run test.innerHTML, options
|
||||
|
||||
# Finish up
|
||||
yay = success is total and not failed
|
||||
yay = passedTests is total and not failedTests
|
||||
sec = (new Date - start) / 1000
|
||||
msg = "passed #{success} tests in #{ sec.toFixed 2 } seconds"
|
||||
msg = "failed #{ total - success } tests and #{msg}" unless yay
|
||||
msg = "passed #{passedTests} tests in #{sec.toFixed 2} seconds"
|
||||
msg = "failed #{total - passedTests} tests and #{msg}" unless yay
|
||||
say msg, (if yay then 'good' else 'bad')
|
||||
</script>
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<a href="v<%= majorVersion %>/annotated-source/nodes.html">The Syntax Tree — src/nodes</a>
|
||||
<a href="v<%= majorVersion %>/annotated-source/scope.html">Lexical Scope — src/scope</a>
|
||||
<a href="v<%= majorVersion %>/annotated-source/helpers.html">Helpers & Utility Functions — src/helpers</a>
|
||||
<a href="v<%= majorVersion %>/annotated-source/coffee-script.html">The CoffeeScript Module — src/coffee-script</a>
|
||||
<a href="v<%= majorVersion %>/annotated-source/coffeescript.html">The CoffeeScript Module — src/coffeescript</a>
|
||||
<a href="v<%= majorVersion %>/annotated-source/cake.html">Cake & Cakefiles — src/cake</a>
|
||||
<a href="v<%= majorVersion %>/annotated-source/command.html">“coffee” Command-Line Utility — src/command</a>
|
||||
<a href="v<%= majorVersion %>/annotated-source/optparse.html">Option Parsing — src/optparse</a>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fs = require 'fs'
|
||||
CoffeeScript = require '../../lib/coffee-script'
|
||||
CoffeeScript = require '../../lib/coffeescript'
|
||||
|
||||
|
||||
module.exports = ->
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
</script>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="v<%= majorVersion %>/browser-compiler/coffee-script.js"></script>
|
||||
<script src="v<%= majorVersion %>/browser-compiler/coffeescript.js"></script>
|
||||
|
||||
140
documentation/v2/body.html
Normal file
140
documentation/v2/body.html
Normal file
@@ -0,0 +1,140 @@
|
||||
<%= include('navbar.html') %>
|
||||
|
||||
<%= include('try.html') %>
|
||||
|
||||
<div class="container-fluid" id="top">
|
||||
<div class="row row-offcanvas row-offcanvas-left">
|
||||
<nav class="sidebar sidebar-offcanvas col-xs-12 col-lg-3 bg-ribbed-light">
|
||||
<%= include('sidebar.html') %>
|
||||
</nav>
|
||||
<main class="main col-xs-12 col-lg-9 offset-lg-3">
|
||||
|
||||
<header class="title-logo hidden-md-down">
|
||||
<%= include('documentation/images/logo.svg') %>
|
||||
</header>
|
||||
|
||||
<section id="overview">
|
||||
<%= htmlFor('introduction') %>
|
||||
<%= htmlFor('overview') %>
|
||||
</section>
|
||||
<section id="coffeescript-2">
|
||||
<%= htmlFor('coffeescript_2') %>
|
||||
</section>
|
||||
<section id="installation">
|
||||
<%= htmlFor('installation') %>
|
||||
</section>
|
||||
<section id="usage">
|
||||
<%= htmlFor('usage') %>
|
||||
</section>
|
||||
<section id="language">
|
||||
<%= htmlFor('language') %>
|
||||
<section id="functions">
|
||||
<%= htmlFor('functions') %>
|
||||
</section>
|
||||
<section id="strings">
|
||||
<%= htmlFor('strings') %>
|
||||
</section>
|
||||
<section id="objects-and-arrays">
|
||||
<%= htmlFor('objects_and_arrays') %>
|
||||
</section>
|
||||
<section id="comments">
|
||||
<%= htmlFor('comments') %>
|
||||
</section>
|
||||
<section id="lexical-scope">
|
||||
<%= htmlFor('lexical_scope') %>
|
||||
</section>
|
||||
<section id="conditionals">
|
||||
<%= htmlFor('conditionals') %>
|
||||
</section>
|
||||
<section id="splats">
|
||||
<%= htmlFor('splats') %>
|
||||
</section>
|
||||
<section id="loops">
|
||||
<%= htmlFor('loops') %>
|
||||
</section>
|
||||
<section id="slices">
|
||||
<%= htmlFor('slices') %>
|
||||
</section>
|
||||
<section id="expressions">
|
||||
<%= htmlFor('expressions') %>
|
||||
</section>
|
||||
<section id="operators">
|
||||
<%= htmlFor('operators') %>
|
||||
</section>
|
||||
<section id="existential-operator">
|
||||
<%= htmlFor('existential_operator') %>
|
||||
</section>
|
||||
<section id="classes">
|
||||
<%= htmlFor('classes') %>
|
||||
</section>
|
||||
<section id="prototypal-inheritance">
|
||||
<%= htmlFor('prototypal_inheritance') %>
|
||||
</section>
|
||||
<section id="destructuring">
|
||||
<%= htmlFor('destructuring') %>
|
||||
</section>
|
||||
<section id="fat-arrow">
|
||||
<%= htmlFor('fat_arrow') %>
|
||||
</section>
|
||||
<section id="switch">
|
||||
<%= htmlFor('switch') %>
|
||||
</section>
|
||||
<section id="try">
|
||||
<%= htmlFor('try') %>
|
||||
</section>
|
||||
<section id="comparisons">
|
||||
<%= htmlFor('comparisons') %>
|
||||
</section>
|
||||
<section id="regexes">
|
||||
<%= htmlFor('heregexes') %>
|
||||
</section>
|
||||
<section id="tagged-template-literals">
|
||||
<%= htmlFor('tagged_template_literals') %>
|
||||
</section>
|
||||
<section id="modules">
|
||||
<%= htmlFor('modules') %>
|
||||
</section>
|
||||
<section id="embedded">
|
||||
<%= htmlFor('embedded') %>
|
||||
</section>
|
||||
</section>
|
||||
<section id="breaking-changes">
|
||||
<%= htmlFor('breaking_changes') %>
|
||||
</section>
|
||||
<section id="literate">
|
||||
<%= htmlFor('literate') %>
|
||||
</section>
|
||||
<section id="source-maps">
|
||||
<%= htmlFor('source_maps') %>
|
||||
</section>
|
||||
<section id="cake">
|
||||
<%= htmlFor('cake') %>
|
||||
</section>
|
||||
<section id="scripts">
|
||||
<%= htmlFor('scripts') %>
|
||||
</section>
|
||||
<section id="resources">
|
||||
<%= htmlFor('resources') %>
|
||||
<section id="books">
|
||||
<%= htmlFor('books') %>
|
||||
</section>
|
||||
<section id="screencasts">
|
||||
<%= htmlFor('screencasts') %>
|
||||
</section>
|
||||
<section id="examples">
|
||||
<%= htmlFor('examples') %>
|
||||
</section>
|
||||
<section id="chat">
|
||||
<%= htmlFor('chat') %>
|
||||
</section>
|
||||
<section id="annotated-source">
|
||||
<%= htmlFor('annotated_source') %>
|
||||
</section>
|
||||
</section>
|
||||
<section id="changelog">
|
||||
<%= htmlFor('changelog') %>
|
||||
</section>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
11
documentation/v2/code.coffee
Normal file
11
documentation/v2/code.coffee
Normal file
@@ -0,0 +1,11 @@
|
||||
fs = require 'fs'
|
||||
_ = require 'underscore'
|
||||
CoffeeScript = require '../../lib/coffeescript'
|
||||
|
||||
|
||||
module.exports = ->
|
||||
(file, run = no) ->
|
||||
cs = fs.readFileSync "documentation/examples/#{file}.coffee", 'utf-8'
|
||||
js = CoffeeScript.compile cs, bare: yes # This is just the initial JavaScript output; it is replaced by dynamic compilation on changes of the CoffeeScript pane
|
||||
render = _.template fs.readFileSync('documentation/v2/code.html', 'utf-8')
|
||||
output = render {file, cs, js, run}
|
||||
17
documentation/v2/code.html
Normal file
17
documentation/v2/code.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<aside class="code-example container-fluid bg-ribbed-dark" data-example="<%= file %>">
|
||||
<div class="row">
|
||||
<div class="col-md-6 coffeescript-input-column">
|
||||
<textarea class="coffeescript-input" id="<%= file %>-coffee"><%= cs %></textarea>
|
||||
</div>
|
||||
<div class="col-md-6 javascript-output-column">
|
||||
<textarea class="javascript-output" id="<%= file %>-js"><%= js %></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<% if (run) { %>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-xs-right">
|
||||
<button type="button" class="btn btn-primary" data-action="run-code-example" data-example="<%= file %>" data-run="<%= escape(run) %>"><% if (run === true) { %>▶<% } else { %><small>▶</small> <%= run.replace(/"/g, '"') %><% } %></button>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
</aside>
|
||||
101
documentation/v2/docs.coffee
Normal file
101
documentation/v2/docs.coffee
Normal file
@@ -0,0 +1,101 @@
|
||||
$(document).ready ->
|
||||
# Mobile navigation
|
||||
toggleSidebar = ->
|
||||
$('.menu-button, .row-offcanvas').toggleClass 'active'
|
||||
|
||||
$('[data-toggle="offcanvas"]').click toggleSidebar
|
||||
|
||||
$('[data-action="sidebar-nav"]').click (event) ->
|
||||
if $('.menu-button').is(':visible')
|
||||
event.preventDefault()
|
||||
toggleSidebar()
|
||||
setTimeout ->
|
||||
window.location = event.target.href
|
||||
, 260 # Wait for the sidebar to slide away before navigating
|
||||
|
||||
|
||||
# Try CoffeeScript
|
||||
toggleTry = ->
|
||||
$('#try, #try-link').toggleClass 'active'
|
||||
closeTry = ->
|
||||
$('#try, #try-link').removeClass 'active'
|
||||
|
||||
$('[data-toggle="try"]').click toggleTry
|
||||
$('[data-close="try"]').click closeTry
|
||||
|
||||
|
||||
# Initialize Scrollspy for sidebar navigation; http://v4-alpha.getbootstrap.com/components/scrollspy/
|
||||
# See also http://www.codingeverything.com/2014/02/BootstrapDocsSideBar.html and http://jsfiddle.net/KyleMit/v6zhz/
|
||||
$('body').scrollspy
|
||||
target: '#contents'
|
||||
offset: Math.round $('main').css('padding-top').replace('px', '')
|
||||
|
||||
initializeScrollspyFromHash = (hash) ->
|
||||
$(".nav-link.active[href!='#{hash}']").removeClass 'active'
|
||||
|
||||
$(window).on 'activate.bs.scrollspy', (event, target) -> # Why `window`? https://github.com/twbs/bootstrap/issues/20086
|
||||
# We only want one active link in the nav
|
||||
$(".nav-link.active[href!='#{target.relatedTarget}']").removeClass 'active'
|
||||
$target = $(".nav-link[href='#{target.relatedTarget}']")
|
||||
# Update the browser address bar on scroll or navigation
|
||||
window.history.pushState {}, $target.text(), $target.prop('href')
|
||||
|
||||
|
||||
# Initialize CodeMirror for code examples; https://codemirror.net/doc/manual.html
|
||||
editors = []
|
||||
lastCompilationElapsedTime = 200
|
||||
$('textarea').each (index) ->
|
||||
$(@).data 'index', index
|
||||
mode = if $(@).hasClass('javascript-output') then 'javascript' else 'coffeescript'
|
||||
|
||||
editors[index] = editor = CodeMirror.fromTextArea @,
|
||||
mode: mode
|
||||
theme: 'twilight'
|
||||
indentUnit: 2
|
||||
tabSize: 2
|
||||
lineWrapping: on
|
||||
lineNumbers: off
|
||||
inputStyle: 'contenteditable'
|
||||
readOnly: mode isnt 'coffeescript' # Can’t use 'nocursor' if we want the JavaScript to be copyable
|
||||
viewportMargin: Infinity
|
||||
|
||||
# Whenever the user edits the CoffeeScript side of a code example, update the JavaScript output
|
||||
if mode is 'coffeescript'
|
||||
pending = null
|
||||
editor.on 'change', (instance, change) ->
|
||||
clearTimeout pending
|
||||
pending = setTimeout ->
|
||||
lastCompilationStartTime = Date.now()
|
||||
try
|
||||
output = CoffeeScript.compile editor.getValue(), bare: yes
|
||||
lastCompilationElapsedTime = Math.max(200, Date.now() - lastCompilationStartTime)
|
||||
catch exception
|
||||
output = "#{exception}"
|
||||
editors[index + 1].setValue output
|
||||
, lastCompilationElapsedTime
|
||||
|
||||
|
||||
# Handle the code example buttons
|
||||
$('[data-action="run-code-example"]').click ->
|
||||
run = $(@).data 'run'
|
||||
index = $("##{$(@).data('example')}-js").data 'index'
|
||||
js = editors[index].getValue()
|
||||
js = "#{js}\nalert(#{unescape run});" unless run is yes
|
||||
eval js
|
||||
|
||||
$('[data-action="link"]').click ->
|
||||
index = $("##{$(@).data('example')}-coffee").data 'index'
|
||||
coffee = editors[index].getValue()
|
||||
link = "try:#{encodeURIComponent coffee}"
|
||||
window.history.pushState {}, 'CoffeeScript', "#{location.href.split('#')[0]}##{link}"
|
||||
|
||||
|
||||
# Configure the initial state
|
||||
if window.location.hash?
|
||||
if window.location.hash is '#try'
|
||||
toggleTry()
|
||||
else if window.location.hash.indexOf('#try') is 0
|
||||
editors[0].setValue decodeURIComponent window.location.hash[5..]
|
||||
toggleTry()
|
||||
else
|
||||
initializeScrollspyFromHash window.location.hash
|
||||
412
documentation/v2/docs.css
Normal file
412
documentation/v2/docs.css
Normal file
@@ -0,0 +1,412 @@
|
||||
/* Adapted from https://v4-alpha.getbootstrap.com/examples/dashboard/dashboard.css and http://v4-alpha.getbootstrap.com/examples/offcanvas/offcanvas.css */
|
||||
|
||||
html,
|
||||
body {
|
||||
/* Prevent scroll on narrow devices */
|
||||
overflow-x: hidden;
|
||||
}
|
||||
body {
|
||||
/* Required for Scrollspy */
|
||||
position: relative;
|
||||
/* Push below header bar */
|
||||
margin-top: 3.5rem;
|
||||
}
|
||||
|
||||
svg {
|
||||
width: auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #1b5e20;
|
||||
transition: 0.1s ease-in-out;
|
||||
}
|
||||
a:focus, a:hover, a:active {
|
||||
color: #388e3c;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.bg-inverse {
|
||||
background-color: #3e2723 !important;
|
||||
}
|
||||
|
||||
.bg-ribbed-light {
|
||||
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 3"><path opacity=".03" fill="#000" d="M0 0h1v1H0z"/><path opacity=".005" fill="#000" d="M0 1h1v2H0z"/></svg>');
|
||||
background-size: 1px 3px;
|
||||
}
|
||||
.bg-ribbed-dark {
|
||||
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 3"><path opacity=".2" fill="#000" d="M0 0h1v1H0z"/><path opacity=".15" fill="#000" d="M0 1h1v2H0z"/></svg>');
|
||||
background-size: 1px 3px;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Header
|
||||
*/
|
||||
.navbar-fixed-top {
|
||||
height: 3.5rem;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
height: 2em;
|
||||
margin-right: 2em;
|
||||
}
|
||||
|
||||
.navbar-dark path {
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
.navbar-nav {
|
||||
font-family: Lato;
|
||||
font-weight: 400;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.navbar-nav .nav-link {
|
||||
padding-left: 0.6em;
|
||||
padding-right: 0.6em;
|
||||
border-radius: 0.4em;
|
||||
}
|
||||
.navbar-nav .nav-link:hover,
|
||||
.navbar-nav .nav-link:active,
|
||||
.navbar-nav .nav-link.active {
|
||||
background-color: #4e342e;
|
||||
}
|
||||
|
||||
/* Adapted from https://codepen.io/GeoffreyBooth/pen/QGzwYK */
|
||||
.navbar-menu-button,
|
||||
.navbar-menu-button:focus {
|
||||
float: right;
|
||||
width: 2.3em;
|
||||
padding: 0;
|
||||
margin-top: 0.25em;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
}
|
||||
.menu-button {
|
||||
width: 2em;
|
||||
height: 1.5em;
|
||||
position: relative;
|
||||
transform: rotate(0deg);
|
||||
transition: .25s ease-in-out;
|
||||
cursor: pointer;
|
||||
}
|
||||
.menu-button span {
|
||||
display: block;
|
||||
position: absolute;
|
||||
height: 4px;
|
||||
width: 100%;
|
||||
background: #efebe9;
|
||||
border-radius: 4px;
|
||||
opacity: 1;
|
||||
left: 0;
|
||||
transform: rotate(0deg);
|
||||
transition: .25s ease-in-out;
|
||||
}
|
||||
.menu-button span:nth-child(1) {
|
||||
top: 0;
|
||||
}
|
||||
.menu-button span:nth-child(2),
|
||||
.menu-button span:nth-child(3) {
|
||||
top: 0.7em;
|
||||
}
|
||||
.menu-button span:nth-child(4) {
|
||||
top: 1.4em;
|
||||
}
|
||||
.menu-button.active span:nth-child(1) {
|
||||
top: 0.7em;
|
||||
width: 0%;
|
||||
left: 50%;
|
||||
}
|
||||
.menu-button.active span:nth-child(2) {
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
.menu-button.active span:nth-child(3) {
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
.menu-button.active span:nth-child(4) {
|
||||
top: 0.7em;
|
||||
width: 0%;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Sidebar
|
||||
*/
|
||||
|
||||
.sidebar {
|
||||
background-color: #efebe9;
|
||||
border-right: 1px solid #efebe9;
|
||||
top: 3.5rem;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: block;
|
||||
padding: 0;
|
||||
}
|
||||
.sidebar .contents {
|
||||
height: 100%;
|
||||
/* Scrollable contents if viewport is shorter than content */
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
font-family: 'Alegreya Sans';
|
||||
font-weight: 400;
|
||||
font-size: 1.2em;
|
||||
line-height: 2;
|
||||
}
|
||||
@media screen and (max-width: 991px) {
|
||||
.sidebar .contents {
|
||||
position: fixed;
|
||||
height: calc(100% - 3.5rem);
|
||||
padding: 1em 1.6em;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 992px) {
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
}
|
||||
.sidebar .contents {
|
||||
padding: 1.3em;
|
||||
}
|
||||
.sidebar .contents::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar .nav-link.active,
|
||||
.sidebar .nav-link.active a:hover,
|
||||
.sidebar .nav-link.active a:focus {
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.nav .nav {
|
||||
margin-left: 1em;
|
||||
font-size: 0.9em;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Off Canvas
|
||||
*/
|
||||
@media screen and (max-width: 991px) {
|
||||
.row-offcanvas {
|
||||
position: relative;
|
||||
transition: all .25s ease-in-out;
|
||||
}
|
||||
.row-offcanvas-left {
|
||||
left: 0;
|
||||
}
|
||||
.sidebar-offcanvas {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 767px) {
|
||||
.row-offcanvas-left .sidebar-offcanvas {
|
||||
left: -100%;
|
||||
}
|
||||
.row-offcanvas-left.active {
|
||||
left: calc(100% + 30px)
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 768px) and (max-width: 991px) {
|
||||
.row-offcanvas-left .sidebar-offcanvas {
|
||||
left: calc(-66.667% - 15px);
|
||||
width: 66.667%;
|
||||
}
|
||||
.row-offcanvas-left.active {
|
||||
left: calc(66.667% + 30px);
|
||||
}
|
||||
.row-offcanvas-left .sidebar-offcanvas .contents {
|
||||
width: 66.667%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Main content
|
||||
*/
|
||||
|
||||
.main {
|
||||
padding: 1.3em;
|
||||
}
|
||||
@media (min-width: 992px) {
|
||||
.main {
|
||||
padding-right: 2em;
|
||||
padding-left: 2em;
|
||||
}
|
||||
}
|
||||
|
||||
.title-logo {
|
||||
width: 30rem;
|
||||
margin: 3rem auto;
|
||||
}
|
||||
.title-logo path {
|
||||
fill: #2f2625;
|
||||
}
|
||||
|
||||
.main p, .main li, .main td, .main th {
|
||||
font-family: Lato;
|
||||
font-size: 1.3rem;
|
||||
font-weight: 300;
|
||||
}
|
||||
.main td {
|
||||
vertical-align: top;
|
||||
padding: 0.3em 0;
|
||||
}
|
||||
.main strong, .main th {
|
||||
font-weight: 700;
|
||||
}
|
||||
.main a {
|
||||
border-bottom: 2px solid transparent;
|
||||
font-weight: 400;
|
||||
}
|
||||
.main a:focus, .main a:hover, .main a:active {
|
||||
border-bottom: 2px solid rgba(56, 142, 60, 0.2);
|
||||
}
|
||||
.main blockquote {
|
||||
font-size: 1.3rem;
|
||||
}
|
||||
.main blockquote pre {
|
||||
background-color: #f8f3f0;
|
||||
color: #2f2625;
|
||||
border-radius: .3em;
|
||||
padding: 0.4em 0.6em;
|
||||
}
|
||||
|
||||
p, blockquote, table, .code-example {
|
||||
margin-bottom: 1.3rem;
|
||||
}
|
||||
|
||||
h2, h3 {
|
||||
margin-top: 1.3em;
|
||||
margin-bottom: 0.6em;
|
||||
font-family: 'Alegreya Sans';
|
||||
}
|
||||
h2 {
|
||||
font-weight: 800;
|
||||
}
|
||||
h3, h2 time {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.main section {
|
||||
/* Offset the anchor so that clicking on the sidebar links don’t hide the heading under the header bar */
|
||||
padding-top: 2.3rem;
|
||||
margin-top: -2.3rem;
|
||||
}
|
||||
|
||||
code, button {
|
||||
font-family: 'Roboto Mono';
|
||||
font-weight: 400;
|
||||
}
|
||||
code {
|
||||
background-color: #f8f3f0;
|
||||
color: #2f2625;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Code examples
|
||||
*/
|
||||
|
||||
textarea {
|
||||
position: absolute;
|
||||
left: -99999px; /* Hide off canvas, while still remaining visible */
|
||||
}
|
||||
|
||||
.code-example {
|
||||
background-color: #2f2625;
|
||||
padding: 1em;
|
||||
border-radius: 0.3em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.javascript-output-column {
|
||||
border-left: 1px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: #69f0ae;
|
||||
color: #0b140f;
|
||||
border-color: #53d88f;
|
||||
transition: 0.2s ease-in-out;
|
||||
min-width: 3.125rem;
|
||||
}
|
||||
.btn-primary:active, .btn-primary:focus, .btn-primary:hover, .btn-primary:active:hover, .btn-primary:active:focus {
|
||||
background-color: #61fea8;
|
||||
color: #060a08;
|
||||
border-color: #4de486;
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.CodeMirror {
|
||||
/* https://codemirror.net/demo/resize.html */
|
||||
height: auto;
|
||||
background: transparent;
|
||||
font-family: 'Roboto Mono';
|
||||
font-weight: 400;
|
||||
line-height: 1.25;
|
||||
}
|
||||
.javascript-output-column .CodeMirror-cursor {
|
||||
/* https://github.com/codemirror/CodeMirror/issues/2568 */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try CoffeeScript
|
||||
*/
|
||||
.try-coffeescript {
|
||||
position: fixed;
|
||||
height: calc(100% - 3.5rem);
|
||||
top: 3.5rem;
|
||||
left: 0;
|
||||
right: 0;
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s ease-in-out;
|
||||
}
|
||||
.try-coffeescript.active {
|
||||
opacity: 1;
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
.try-coffeescript .CodeMirror {
|
||||
height: calc(100vh - 7rem);
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.try-coffeescript .code-column {
|
||||
overflow: hidden;
|
||||
background-color: #2f2625;
|
||||
color: #2f2625;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
.try-coffeescript .code-column {
|
||||
height: calc(50vh - 0.5 * 3.5rem);
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 768px) {
|
||||
.try-coffeescript .code-column {
|
||||
padding-bottom: 100%;
|
||||
margin-bottom: -100%;
|
||||
}
|
||||
}
|
||||
|
||||
.try-coffeescript button svg {
|
||||
height: 1em;
|
||||
transform: scale(1.3) translateY(0.1em);
|
||||
fill: #0b140f;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
.try-coffeescript .try-buttons {
|
||||
position: absolute;
|
||||
bottom: 1em;
|
||||
z-index: 1002;
|
||||
}
|
||||
}
|
||||
17
documentation/v2/navbar.html
Normal file
17
documentation/v2/navbar.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<nav class="navbar navbar-dark navbar-fixed-top bg-inverse bg-ribbed-dark">
|
||||
<a class="navbar-brand" href="#" data-close="try"><%= include('documentation/images/logo.svg') %></a>
|
||||
<nav class="nav navbar-nav float-xs-left hidden-md-down">
|
||||
<a href="#try" id="try-link" class="nav-item nav-link" data-toggle="try">Try CoffeeScript</a>
|
||||
<a href="#language" class="nav-item nav-link" data-close="try">Language Reference</a>
|
||||
<a href="#resources" class="nav-item nav-link" data-close="try">Resources</a>
|
||||
<a href="http://github.com/jashkenas/coffeescript/" class="nav-item nav-link" data-close="try">GitHub</a>
|
||||
</nav>
|
||||
<button type="button" class="navbar-menu-button hidden-lg-up" data-toggle="offcanvas" aria-label="Toggle sidebar">
|
||||
<div class="menu-button">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</div>
|
||||
</button>
|
||||
</nav>
|
||||
11
documentation/v2/scripts.html
Normal file
11
documentation/v2/scripts.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js" integrity="sha384-3ceskX3iaEnIogmQchP8opvBy3Mi7Ce34nWjpBIwVTHfGYWQS9jwHDVRnpKKHJg7" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
window.Tether = {}; // Remove if we want to use Bootstrap tooltips
|
||||
</script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js" integrity="sha384-BLiI7JTZm+JWlgKa0M0kGRpJbF2J8q+qreVrKBC47e3K6BW78kGLrCkeRX6I9RoK" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/g/codemirror@4.5.0(codemirror.min.js+mode/coffeescript/coffeescript.js+addon/lint/coffeescript-lint.js+mode/javascript/javascript.js)" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="browser-compiler/coffeescript.js"></script>
|
||||
<script type="text/coffeescript">
|
||||
<%= include('docs.coffee') %>
|
||||
</script>
|
||||
128
documentation/v2/sidebar.html
Normal file
128
documentation/v2/sidebar.html
Normal file
@@ -0,0 +1,128 @@
|
||||
<nav class="contents" id="contents">
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
<a href="#top" class="nav-link" data-action="sidebar-nav">Overview</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#coffeescript-2" class="nav-link" data-action="sidebar-nav">CoffeeScript 2</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#installation" class="nav-link" data-action="sidebar-nav">Installation</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#usage" class="nav-link" data-action="sidebar-nav">Usage</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#language" class="nav-link" data-action="sidebar-nav">Language Reference</a>
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
<a href="#functions" class="nav-link" data-action="sidebar-nav">Functions</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#strings" class="nav-link" data-action="sidebar-nav">Strings</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#objects-and-arrays" class="nav-link" data-action="sidebar-nav">Objects and Arrays</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#comments" class="nav-link" data-action="sidebar-nav">Comments</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#lexical-scope" class="nav-link" data-action="sidebar-nav">Lexical Scoping and Variable Safety</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#conditionals" class="nav-link" data-action="sidebar-nav">If, Else, Unless, and Conditional Assignment</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#splats" class="nav-link" data-action="sidebar-nav">Splats…</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#loops" class="nav-link" data-action="sidebar-nav">Loops and Comprehensions</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#slices" class="nav-link" data-action="sidebar-nav">Array Slicing and Splicing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#expressions" class="nav-link" data-action="sidebar-nav">Everything is an Expression</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#operators" class="nav-link" data-action="sidebar-nav">Operators and Aliases</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#existential-operator" class="nav-link" data-action="sidebar-nav">Existential Operator</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#classes" class="nav-link" data-action="sidebar-nav">Classes</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#prototypal-inheritance" class="nav-link" data-action="sidebar-nav">Prototypal Inheritance</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#destructuring" class="nav-link" data-action="sidebar-nav">Destructuring Assignment</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#fat-arrow" class="nav-link" data-action="sidebar-nav">Function Modifiers</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#switch" class="nav-link" data-action="sidebar-nav">Switch and Try/Catch</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#comparisons" class="nav-link" data-action="sidebar-nav">Chained Comparisons</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#regexes" class="nav-link" data-action="sidebar-nav">Block Regular Expressions</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#tagged-template-literals" class="nav-link" data-action="sidebar-nav">Tagged Template Literals</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#modules" class="nav-link" data-action="sidebar-nav">Modules</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#embedded" class="nav-link" data-action="sidebar-nav">Embedded JavaScript</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#breaking-changes" class="nav-link" data-action="sidebar-nav">Breaking Changes From 1.x</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#literate" class="nav-link" data-action="sidebar-nav">Literate CoffeeScript</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#source-maps" class="nav-link" data-action="sidebar-nav">Source Maps</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#cake" class="nav-link" data-action="sidebar-nav">Cake, and Cakefiles</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#scripts" class="nav-link" data-action="sidebar-nav"><code>"text/coffeescript"</code> Script Tags</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="test.html" class="nav-link" data-action="sidebar-nav">Browser-Based Tests</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#resources" class="nav-link" data-action="sidebar-nav">Resources</a>
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
<a href="#books" class="nav-link" data-action="sidebar-nav">Books</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#screencasts" class="nav-link" data-action="sidebar-nav">Screencasts</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#examples" class="nav-link" data-action="sidebar-nav">Examples</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#chat" class="nav-link" data-action="sidebar-nav">Chat</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#annotated-source" class="nav-link" data-action="sidebar-nav">Annotated Source</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#changelog" class="nav-link" data-action="sidebar-nav">Change Log</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
8
documentation/v2/styles.html
Normal file
8
documentation/v2/styles.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" integrity="sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi" crossorigin="anonymous">
|
||||
<!-- The CoffeeScript logo font is Google’s Galada -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Alegreya+Sans:400,800|Lato:300,300i,400,700|Roboto+Mono:400" rel="stylesheet" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/codemirror/4.5.0/codemirror.css" crossorigin="anonymous">
|
||||
<style>
|
||||
<%= include('docs.css') %>
|
||||
<%= include('twilight.css') %>
|
||||
</style>
|
||||
16
documentation/v2/try.html
Normal file
16
documentation/v2/try.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<aside id="try" class="try-coffeescript container-fluid" data-example="try">
|
||||
<div class="row">
|
||||
<div class="col-md-6 code-column bg-ribbed-dark coffeescript-input-column">
|
||||
<textarea class="coffeescript-input" id="try-coffeescript-coffee">alert 'Hello CoffeeScript!'</textarea>
|
||||
</div>
|
||||
<div class="col-md-6 code-column bg-ribbed-dark javascript-output-column">
|
||||
<textarea class="javascript-output" id="try-coffeescript-js">alert('Hello CoffeeScript!');</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-xs-right try-buttons">
|
||||
<button type="button" class="btn btn-primary" data-action="run-code-example" data-example="try-coffeescript" data-run="true">▶</button> 
|
||||
<button type="button" class="btn btn-primary" data-action="link" data-example="try-coffeescript"><%= include('documentation/images/link.svg') %></button>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
40
documentation/v2/twilight.css
Normal file
40
documentation/v2/twilight.css
Normal file
@@ -0,0 +1,40 @@
|
||||
/* Adapted from https://github.com/FarhadG/code-mirror-themes/blob/master/themes/twilight.css */
|
||||
|
||||
.cm-s-twilight {
|
||||
letter-spacing: 0.3px;
|
||||
color: #f8f8f8;
|
||||
}
|
||||
.cm-s-twilight .CodeMirror-lines {
|
||||
padding: 0.5em 0;
|
||||
}
|
||||
.cm-s-twilight div.CodeMirror-cursor {
|
||||
border-left: 3px solid #f8f8f8;
|
||||
}
|
||||
.cm-s-twilight .CodeMirror-activeline-background {
|
||||
background: #ffffff08;
|
||||
}
|
||||
.cm-s-twilight .CodeMirror-selected {
|
||||
background: #ddf0ff33;
|
||||
}
|
||||
.cm-s-twilight .cm-comment {
|
||||
font-style: italic;
|
||||
color: #5f5a60;
|
||||
}
|
||||
.cm-s-twilight .cm-keyword {
|
||||
color: #cda869;
|
||||
}
|
||||
.cm-s-twilight .cm-string {
|
||||
color: #8f9d6a;
|
||||
}
|
||||
.cm-s-twilight .cm-property {
|
||||
color: #dad085;
|
||||
}
|
||||
.cm-s-twilight .cm-atom {
|
||||
color: #dad085;
|
||||
}
|
||||
.cm-s-twilight .cm-number {
|
||||
color: #dad085;
|
||||
}
|
||||
.cm-s-twilight .cm-operator {
|
||||
color: #cda869;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,522 +0,0 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
(function() {
|
||||
var BALANCED_PAIRS, CALL_CLOSERS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, generate, k, left, len, ref, rite,
|
||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
|
||||
slice = [].slice;
|
||||
|
||||
generate = function(tag, value, origin) {
|
||||
var tok;
|
||||
tok = [tag, value];
|
||||
tok.generated = true;
|
||||
if (origin) {
|
||||
tok.origin = origin;
|
||||
}
|
||||
return tok;
|
||||
};
|
||||
|
||||
exports.Rewriter = (function() {
|
||||
function Rewriter() {}
|
||||
|
||||
Rewriter.prototype.rewrite = function(tokens1) {
|
||||
this.tokens = tokens1;
|
||||
this.removeLeadingNewlines();
|
||||
this.closeOpenCalls();
|
||||
this.closeOpenIndexes();
|
||||
this.normalizeLines();
|
||||
this.tagPostfixConditionals();
|
||||
this.addImplicitBracesAndParens();
|
||||
this.addLocationDataToGeneratedTokens();
|
||||
this.fixOutdentLocationData();
|
||||
return this.tokens;
|
||||
};
|
||||
|
||||
Rewriter.prototype.scanTokens = function(block) {
|
||||
var i, token, tokens;
|
||||
tokens = this.tokens;
|
||||
i = 0;
|
||||
while (token = tokens[i]) {
|
||||
i += block.call(this, token, i, tokens);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
Rewriter.prototype.detectEnd = function(i, condition, action) {
|
||||
var levels, ref, ref1, token, tokens;
|
||||
tokens = this.tokens;
|
||||
levels = 0;
|
||||
while (token = tokens[i]) {
|
||||
if (levels === 0 && condition.call(this, token, i)) {
|
||||
return action.call(this, token, i);
|
||||
}
|
||||
if (!token || levels < 0) {
|
||||
return action.call(this, token, i - 1);
|
||||
}
|
||||
if (ref = token[0], indexOf.call(EXPRESSION_START, ref) >= 0) {
|
||||
levels += 1;
|
||||
} else if (ref1 = token[0], indexOf.call(EXPRESSION_END, ref1) >= 0) {
|
||||
levels -= 1;
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
return i - 1;
|
||||
};
|
||||
|
||||
Rewriter.prototype.removeLeadingNewlines = function() {
|
||||
var i, k, len, ref, tag;
|
||||
ref = this.tokens;
|
||||
for (i = k = 0, len = ref.length; k < len; i = ++k) {
|
||||
tag = ref[i][0];
|
||||
if (tag !== 'TERMINATOR') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i) {
|
||||
return this.tokens.splice(0, i);
|
||||
}
|
||||
};
|
||||
|
||||
Rewriter.prototype.closeOpenCalls = function() {
|
||||
var action, condition;
|
||||
condition = function(token, i) {
|
||||
var ref;
|
||||
return ((ref = token[0]) === ')' || ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')';
|
||||
};
|
||||
action = function(token, i) {
|
||||
return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END';
|
||||
};
|
||||
return this.scanTokens(function(token, i) {
|
||||
if (token[0] === 'CALL_START') {
|
||||
this.detectEnd(i + 1, condition, action);
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.closeOpenIndexes = function() {
|
||||
var action, condition;
|
||||
condition = function(token, i) {
|
||||
var ref;
|
||||
return (ref = token[0]) === ']' || ref === 'INDEX_END';
|
||||
};
|
||||
action = function(token, i) {
|
||||
return token[0] = 'INDEX_END';
|
||||
};
|
||||
return this.scanTokens(function(token, i) {
|
||||
if (token[0] === 'INDEX_START') {
|
||||
this.detectEnd(i + 1, condition, action);
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.indexOfTag = function() {
|
||||
var fuzz, i, j, k, pattern, ref, ref1;
|
||||
i = arguments[0], pattern = 2 <= arguments.length ? slice.call(arguments, 1) : [];
|
||||
fuzz = 0;
|
||||
for (j = k = 0, ref = pattern.length; 0 <= ref ? k < ref : k > ref; j = 0 <= ref ? ++k : --k) {
|
||||
while (this.tag(i + j + fuzz) === 'HERECOMMENT') {
|
||||
fuzz += 2;
|
||||
}
|
||||
if (pattern[j] == null) {
|
||||
continue;
|
||||
}
|
||||
if (typeof pattern[j] === 'string') {
|
||||
pattern[j] = [pattern[j]];
|
||||
}
|
||||
if (ref1 = this.tag(i + j + fuzz), indexOf.call(pattern[j], ref1) < 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return i + j + fuzz - 1;
|
||||
};
|
||||
|
||||
Rewriter.prototype.looksObjectish = function(j) {
|
||||
var end, index;
|
||||
if (this.indexOfTag(j, '@', null, ':') > -1 || this.indexOfTag(j, null, ':') > -1) {
|
||||
return true;
|
||||
}
|
||||
index = this.indexOfTag(j, EXPRESSION_START);
|
||||
if (index > -1) {
|
||||
end = null;
|
||||
this.detectEnd(index + 1, (function(token) {
|
||||
var ref;
|
||||
return ref = token[0], indexOf.call(EXPRESSION_END, ref) >= 0;
|
||||
}), (function(token, i) {
|
||||
return end = i;
|
||||
}));
|
||||
if (this.tag(end + 1) === ':') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
Rewriter.prototype.findTagsBackwards = function(i, tags) {
|
||||
var backStack, ref, ref1, ref2, ref3, ref4, ref5;
|
||||
backStack = [];
|
||||
while (i >= 0 && (backStack.length || (ref2 = this.tag(i), indexOf.call(tags, ref2) < 0) && ((ref3 = this.tag(i), indexOf.call(EXPRESSION_START, ref3) < 0) || this.tokens[i].generated) && (ref4 = this.tag(i), indexOf.call(LINEBREAKS, ref4) < 0))) {
|
||||
if (ref = this.tag(i), indexOf.call(EXPRESSION_END, ref) >= 0) {
|
||||
backStack.push(this.tag(i));
|
||||
}
|
||||
if ((ref1 = this.tag(i), indexOf.call(EXPRESSION_START, ref1) >= 0) && backStack.length) {
|
||||
backStack.pop();
|
||||
}
|
||||
i -= 1;
|
||||
}
|
||||
return ref5 = this.tag(i), indexOf.call(tags, ref5) >= 0;
|
||||
};
|
||||
|
||||
Rewriter.prototype.addImplicitBracesAndParens = function() {
|
||||
var stack, start;
|
||||
stack = [];
|
||||
start = null;
|
||||
return this.scanTokens(function(token, i, tokens) {
|
||||
var endImplicitCall, endImplicitObject, forward, inImplicit, inImplicitCall, inImplicitControl, inImplicitObject, newLine, nextTag, offset, prevTag, prevToken, ref, ref1, ref2, ref3, ref4, ref5, s, sameLine, stackIdx, stackTag, stackTop, startIdx, startImplicitCall, startImplicitObject, startsLine, tag;
|
||||
tag = token[0];
|
||||
prevTag = (prevToken = i > 0 ? tokens[i - 1] : [])[0];
|
||||
nextTag = (i < tokens.length - 1 ? tokens[i + 1] : [])[0];
|
||||
stackTop = function() {
|
||||
return stack[stack.length - 1];
|
||||
};
|
||||
startIdx = i;
|
||||
forward = function(n) {
|
||||
return i - startIdx + n;
|
||||
};
|
||||
inImplicit = function() {
|
||||
var ref, ref1;
|
||||
return (ref = stackTop()) != null ? (ref1 = ref[2]) != null ? ref1.ours : void 0 : void 0;
|
||||
};
|
||||
inImplicitCall = function() {
|
||||
var ref;
|
||||
return inImplicit() && ((ref = stackTop()) != null ? ref[0] : void 0) === '(';
|
||||
};
|
||||
inImplicitObject = function() {
|
||||
var ref;
|
||||
return inImplicit() && ((ref = stackTop()) != null ? ref[0] : void 0) === '{';
|
||||
};
|
||||
inImplicitControl = function() {
|
||||
var ref;
|
||||
return inImplicit && ((ref = stackTop()) != null ? ref[0] : void 0) === 'CONTROL';
|
||||
};
|
||||
startImplicitCall = function(j) {
|
||||
var idx;
|
||||
idx = j != null ? j : i;
|
||||
stack.push([
|
||||
'(', idx, {
|
||||
ours: true
|
||||
}
|
||||
]);
|
||||
tokens.splice(idx, 0, generate('CALL_START', '('));
|
||||
if (j == null) {
|
||||
return i += 1;
|
||||
}
|
||||
};
|
||||
endImplicitCall = function() {
|
||||
stack.pop();
|
||||
tokens.splice(i, 0, generate('CALL_END', ')', ['', 'end of input', token[2]]));
|
||||
return i += 1;
|
||||
};
|
||||
startImplicitObject = function(j, startsLine) {
|
||||
var idx, val;
|
||||
if (startsLine == null) {
|
||||
startsLine = true;
|
||||
}
|
||||
idx = j != null ? j : i;
|
||||
stack.push([
|
||||
'{', idx, {
|
||||
sameLine: true,
|
||||
startsLine: startsLine,
|
||||
ours: true
|
||||
}
|
||||
]);
|
||||
val = new String('{');
|
||||
val.generated = true;
|
||||
tokens.splice(idx, 0, generate('{', val, token));
|
||||
if (j == null) {
|
||||
return i += 1;
|
||||
}
|
||||
};
|
||||
endImplicitObject = function(j) {
|
||||
j = j != null ? j : i;
|
||||
stack.pop();
|
||||
tokens.splice(j, 0, generate('}', '}', token));
|
||||
return i += 1;
|
||||
};
|
||||
if (inImplicitCall() && (tag === 'IF' || tag === 'TRY' || tag === 'FINALLY' || tag === 'CATCH' || tag === 'CLASS' || tag === 'SWITCH')) {
|
||||
stack.push([
|
||||
'CONTROL', i, {
|
||||
ours: true
|
||||
}
|
||||
]);
|
||||
return forward(1);
|
||||
}
|
||||
if (tag === 'INDENT' && inImplicit()) {
|
||||
if (prevTag !== '=>' && prevTag !== '->' && prevTag !== '[' && prevTag !== '(' && prevTag !== ',' && prevTag !== '{' && prevTag !== 'TRY' && prevTag !== 'ELSE' && prevTag !== '=') {
|
||||
while (inImplicitCall()) {
|
||||
endImplicitCall();
|
||||
}
|
||||
}
|
||||
if (inImplicitControl()) {
|
||||
stack.pop();
|
||||
}
|
||||
stack.push([tag, i]);
|
||||
return forward(1);
|
||||
}
|
||||
if (indexOf.call(EXPRESSION_START, tag) >= 0) {
|
||||
stack.push([tag, i]);
|
||||
return forward(1);
|
||||
}
|
||||
if (indexOf.call(EXPRESSION_END, tag) >= 0) {
|
||||
while (inImplicit()) {
|
||||
if (inImplicitCall()) {
|
||||
endImplicitCall();
|
||||
} else if (inImplicitObject()) {
|
||||
endImplicitObject();
|
||||
} else {
|
||||
stack.pop();
|
||||
}
|
||||
}
|
||||
start = stack.pop();
|
||||
}
|
||||
if ((indexOf.call(IMPLICIT_FUNC, tag) >= 0 && token.spaced || tag === '?' && i > 0 && !tokens[i - 1].spaced) && (indexOf.call(IMPLICIT_CALL, nextTag) >= 0 || indexOf.call(IMPLICIT_UNSPACED_CALL, nextTag) >= 0 && !((ref = tokens[i + 1]) != null ? ref.spaced : void 0) && !((ref1 = tokens[i + 1]) != null ? ref1.newLine : void 0))) {
|
||||
if (tag === '?') {
|
||||
tag = token[0] = 'FUNC_EXIST';
|
||||
}
|
||||
startImplicitCall(i + 1);
|
||||
return forward(2);
|
||||
}
|
||||
if (indexOf.call(IMPLICIT_FUNC, tag) >= 0 && this.indexOfTag(i + 1, 'INDENT') > -1 && this.looksObjectish(i + 2) && !this.findTagsBackwards(i, ['CLASS', 'EXTENDS', 'IF', 'CATCH', 'SWITCH', 'LEADING_WHEN', 'FOR', 'WHILE', 'UNTIL'])) {
|
||||
startImplicitCall(i + 1);
|
||||
stack.push(['INDENT', i + 2]);
|
||||
return forward(3);
|
||||
}
|
||||
if (tag === ':') {
|
||||
s = (function() {
|
||||
var ref2;
|
||||
switch (false) {
|
||||
case ref2 = this.tag(i - 1), indexOf.call(EXPRESSION_END, ref2) < 0:
|
||||
return start[1];
|
||||
case this.tag(i - 2) !== '@':
|
||||
return i - 2;
|
||||
default:
|
||||
return i - 1;
|
||||
}
|
||||
}).call(this);
|
||||
while (this.tag(s - 2) === 'HERECOMMENT') {
|
||||
s -= 2;
|
||||
}
|
||||
this.insideForDeclaration = nextTag === 'FOR';
|
||||
startsLine = s === 0 || (ref2 = this.tag(s - 1), indexOf.call(LINEBREAKS, ref2) >= 0) || tokens[s - 1].newLine;
|
||||
if (stackTop()) {
|
||||
ref3 = stackTop(), stackTag = ref3[0], stackIdx = ref3[1];
|
||||
if ((stackTag === '{' || stackTag === 'INDENT' && this.tag(stackIdx - 1) === '{') && (startsLine || this.tag(s - 1) === ',' || this.tag(s - 1) === '{')) {
|
||||
return forward(1);
|
||||
}
|
||||
}
|
||||
startImplicitObject(s, !!startsLine);
|
||||
return forward(2);
|
||||
}
|
||||
if (inImplicitObject() && indexOf.call(LINEBREAKS, tag) >= 0) {
|
||||
stackTop()[2].sameLine = false;
|
||||
}
|
||||
newLine = prevTag === 'OUTDENT' || prevToken.newLine;
|
||||
if (indexOf.call(IMPLICIT_END, tag) >= 0 || indexOf.call(CALL_CLOSERS, tag) >= 0 && newLine) {
|
||||
while (inImplicit()) {
|
||||
ref4 = stackTop(), stackTag = ref4[0], stackIdx = ref4[1], (ref5 = ref4[2], sameLine = ref5.sameLine, startsLine = ref5.startsLine);
|
||||
if (inImplicitCall() && prevTag !== ',') {
|
||||
endImplicitCall();
|
||||
} else if (inImplicitObject() && !this.insideForDeclaration && sameLine && tag !== 'TERMINATOR' && prevTag !== ':') {
|
||||
endImplicitObject();
|
||||
} else if (inImplicitObject() && tag === 'TERMINATOR' && prevTag !== ',' && !(startsLine && this.looksObjectish(i + 1))) {
|
||||
if (nextTag === 'HERECOMMENT') {
|
||||
return forward(1);
|
||||
}
|
||||
endImplicitObject();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tag === ',' && !this.looksObjectish(i + 1) && inImplicitObject() && !this.insideForDeclaration && (nextTag !== 'TERMINATOR' || !this.looksObjectish(i + 2))) {
|
||||
offset = nextTag === 'OUTDENT' ? 1 : 0;
|
||||
while (inImplicitObject()) {
|
||||
endImplicitObject(i + offset);
|
||||
}
|
||||
}
|
||||
return forward(1);
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.addLocationDataToGeneratedTokens = function() {
|
||||
return this.scanTokens(function(token, i, tokens) {
|
||||
var column, line, nextLocation, prevLocation, ref, ref1;
|
||||
if (token[2]) {
|
||||
return 1;
|
||||
}
|
||||
if (!(token.generated || token.explicit)) {
|
||||
return 1;
|
||||
}
|
||||
if (token[0] === '{' && (nextLocation = (ref = tokens[i + 1]) != null ? ref[2] : void 0)) {
|
||||
line = nextLocation.first_line, column = nextLocation.first_column;
|
||||
} else if (prevLocation = (ref1 = tokens[i - 1]) != null ? ref1[2] : void 0) {
|
||||
line = prevLocation.last_line, column = prevLocation.last_column;
|
||||
} else {
|
||||
line = column = 0;
|
||||
}
|
||||
token[2] = {
|
||||
first_line: line,
|
||||
first_column: column,
|
||||
last_line: line,
|
||||
last_column: column
|
||||
};
|
||||
return 1;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.fixOutdentLocationData = function() {
|
||||
return this.scanTokens(function(token, i, tokens) {
|
||||
var prevLocationData;
|
||||
if (!(token[0] === 'OUTDENT' || (token.generated && token[0] === 'CALL_END') || (token.generated && token[0] === '}'))) {
|
||||
return 1;
|
||||
}
|
||||
prevLocationData = tokens[i - 1][2];
|
||||
token[2] = {
|
||||
first_line: prevLocationData.last_line,
|
||||
first_column: prevLocationData.last_column,
|
||||
last_line: prevLocationData.last_line,
|
||||
last_column: prevLocationData.last_column
|
||||
};
|
||||
return 1;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.normalizeLines = function() {
|
||||
var action, condition, indent, outdent, starter;
|
||||
starter = indent = outdent = null;
|
||||
condition = function(token, i) {
|
||||
var ref, ref1, ref2, ref3;
|
||||
return token[1] !== ';' && (ref = token[0], indexOf.call(SINGLE_CLOSERS, ref) >= 0) && !(token[0] === 'TERMINATOR' && (ref1 = this.tag(i + 1), indexOf.call(EXPRESSION_CLOSE, ref1) >= 0)) && !(token[0] === 'ELSE' && starter !== 'THEN') && !(((ref2 = token[0]) === 'CATCH' || ref2 === 'FINALLY') && (starter === '->' || starter === '=>')) || (ref3 = token[0], indexOf.call(CALL_CLOSERS, ref3) >= 0) && this.tokens[i - 1].newLine;
|
||||
};
|
||||
action = function(token, i) {
|
||||
return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent);
|
||||
};
|
||||
return this.scanTokens(function(token, i, tokens) {
|
||||
var j, k, ref, ref1, ref2, tag;
|
||||
tag = token[0];
|
||||
if (tag === 'TERMINATOR') {
|
||||
if (this.tag(i + 1) === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') {
|
||||
tokens.splice.apply(tokens, [i, 1].concat(slice.call(this.indentation())));
|
||||
return 1;
|
||||
}
|
||||
if (ref = this.tag(i + 1), indexOf.call(EXPRESSION_CLOSE, ref) >= 0) {
|
||||
tokens.splice(i, 1);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (tag === 'CATCH') {
|
||||
for (j = k = 1; k <= 2; j = ++k) {
|
||||
if (!((ref1 = this.tag(i + j)) === 'OUTDENT' || ref1 === 'TERMINATOR' || ref1 === 'FINALLY')) {
|
||||
continue;
|
||||
}
|
||||
tokens.splice.apply(tokens, [i + j, 0].concat(slice.call(this.indentation())));
|
||||
return 2 + j;
|
||||
}
|
||||
}
|
||||
if (indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) {
|
||||
starter = tag;
|
||||
ref2 = this.indentation(tokens[i]), indent = ref2[0], outdent = ref2[1];
|
||||
if (starter === 'THEN') {
|
||||
indent.fromThen = true;
|
||||
}
|
||||
tokens.splice(i + 1, 0, indent);
|
||||
this.detectEnd(i + 2, condition, action);
|
||||
if (tag === 'THEN') {
|
||||
tokens.splice(i, 1);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.tagPostfixConditionals = function() {
|
||||
var action, condition, original;
|
||||
original = null;
|
||||
condition = function(token, i) {
|
||||
var prevTag, tag;
|
||||
tag = token[0];
|
||||
prevTag = this.tokens[i - 1][0];
|
||||
return tag === 'TERMINATOR' || (tag === 'INDENT' && indexOf.call(SINGLE_LINERS, prevTag) < 0);
|
||||
};
|
||||
action = function(token, i) {
|
||||
if (token[0] !== 'INDENT' || (token.generated && !token.fromThen)) {
|
||||
return original[0] = 'POST_' + original[0];
|
||||
}
|
||||
};
|
||||
return this.scanTokens(function(token, i) {
|
||||
if (token[0] !== 'IF') {
|
||||
return 1;
|
||||
}
|
||||
original = token;
|
||||
this.detectEnd(i + 1, condition, action);
|
||||
return 1;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.indentation = function(origin) {
|
||||
var indent, outdent;
|
||||
indent = ['INDENT', 2];
|
||||
outdent = ['OUTDENT', 2];
|
||||
if (origin) {
|
||||
indent.generated = outdent.generated = true;
|
||||
indent.origin = outdent.origin = origin;
|
||||
} else {
|
||||
indent.explicit = outdent.explicit = true;
|
||||
}
|
||||
return [indent, outdent];
|
||||
};
|
||||
|
||||
Rewriter.prototype.generate = generate;
|
||||
|
||||
Rewriter.prototype.tag = function(i) {
|
||||
var ref;
|
||||
return (ref = this.tokens[i]) != null ? ref[0] : void 0;
|
||||
};
|
||||
|
||||
return Rewriter;
|
||||
|
||||
})();
|
||||
|
||||
BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END'], ['STRING_START', 'STRING_END'], ['REGEX_START', 'REGEX_END']];
|
||||
|
||||
exports.INVERSES = INVERSES = {};
|
||||
|
||||
EXPRESSION_START = [];
|
||||
|
||||
EXPRESSION_END = [];
|
||||
|
||||
for (k = 0, len = BALANCED_PAIRS.length; k < len; k++) {
|
||||
ref = BALANCED_PAIRS[k], left = ref[0], rite = ref[1];
|
||||
EXPRESSION_START.push(INVERSES[rite] = left);
|
||||
EXPRESSION_END.push(INVERSES[left] = rite);
|
||||
}
|
||||
|
||||
EXPRESSION_CLOSE = ['CATCH', 'THEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END);
|
||||
|
||||
IMPLICIT_FUNC = ['IDENTIFIER', 'PROPERTY', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS'];
|
||||
|
||||
IMPLICIT_CALL = ['IDENTIFIER', 'PROPERTY', 'NUMBER', 'INFINITY', 'NAN', 'STRING', 'STRING_START', 'REGEX', 'REGEX_START', 'JS', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'UNDEFINED', 'NULL', 'BOOL', 'UNARY', 'YIELD', 'UNARY_MATH', 'SUPER', 'THROW', '@', '->', '=>', '[', '(', '{', '--', '++'];
|
||||
|
||||
IMPLICIT_UNSPACED_CALL = ['+', '-'];
|
||||
|
||||
IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR'];
|
||||
|
||||
SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN'];
|
||||
|
||||
SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN'];
|
||||
|
||||
LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT'];
|
||||
|
||||
CALL_CLOSERS = ['.', '?.', '::', '?::'];
|
||||
|
||||
}).call(this);
|
||||
@@ -1,161 +0,0 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
(function() {
|
||||
var LineMap, SourceMap;
|
||||
|
||||
LineMap = (function() {
|
||||
function LineMap(line1) {
|
||||
this.line = line1;
|
||||
this.columns = [];
|
||||
}
|
||||
|
||||
LineMap.prototype.add = function(column, arg, options) {
|
||||
var sourceColumn, sourceLine;
|
||||
sourceLine = arg[0], sourceColumn = arg[1];
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
if (this.columns[column] && options.noReplace) {
|
||||
return;
|
||||
}
|
||||
return this.columns[column] = {
|
||||
line: this.line,
|
||||
column: column,
|
||||
sourceLine: sourceLine,
|
||||
sourceColumn: sourceColumn
|
||||
};
|
||||
};
|
||||
|
||||
LineMap.prototype.sourceLocation = function(column) {
|
||||
var mapping;
|
||||
while (!((mapping = this.columns[column]) || (column <= 0))) {
|
||||
column--;
|
||||
}
|
||||
return mapping && [mapping.sourceLine, mapping.sourceColumn];
|
||||
};
|
||||
|
||||
return LineMap;
|
||||
|
||||
})();
|
||||
|
||||
SourceMap = (function() {
|
||||
var BASE64_CHARS, VLQ_CONTINUATION_BIT, VLQ_SHIFT, VLQ_VALUE_MASK;
|
||||
|
||||
function SourceMap() {
|
||||
this.lines = [];
|
||||
}
|
||||
|
||||
SourceMap.prototype.add = function(sourceLocation, generatedLocation, options) {
|
||||
var base, column, line, lineMap;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
line = generatedLocation[0], column = generatedLocation[1];
|
||||
lineMap = ((base = this.lines)[line] || (base[line] = new LineMap(line)));
|
||||
return lineMap.add(column, sourceLocation, options);
|
||||
};
|
||||
|
||||
SourceMap.prototype.sourceLocation = function(arg) {
|
||||
var column, line, lineMap;
|
||||
line = arg[0], column = arg[1];
|
||||
while (!((lineMap = this.lines[line]) || (line <= 0))) {
|
||||
line--;
|
||||
}
|
||||
return lineMap && lineMap.sourceLocation(column);
|
||||
};
|
||||
|
||||
SourceMap.prototype.generate = function(options, code) {
|
||||
var buffer, i, j, lastColumn, lastSourceColumn, lastSourceLine, len, len1, lineMap, lineNumber, mapping, needComma, ref, ref1, v3, writingline;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
if (code == null) {
|
||||
code = null;
|
||||
}
|
||||
writingline = 0;
|
||||
lastColumn = 0;
|
||||
lastSourceLine = 0;
|
||||
lastSourceColumn = 0;
|
||||
needComma = false;
|
||||
buffer = "";
|
||||
ref = this.lines;
|
||||
for (lineNumber = i = 0, len = ref.length; i < len; lineNumber = ++i) {
|
||||
lineMap = ref[lineNumber];
|
||||
if (lineMap) {
|
||||
ref1 = lineMap.columns;
|
||||
for (j = 0, len1 = ref1.length; j < len1; j++) {
|
||||
mapping = ref1[j];
|
||||
if (!(mapping)) {
|
||||
continue;
|
||||
}
|
||||
while (writingline < mapping.line) {
|
||||
lastColumn = 0;
|
||||
needComma = false;
|
||||
buffer += ";";
|
||||
writingline++;
|
||||
}
|
||||
if (needComma) {
|
||||
buffer += ",";
|
||||
needComma = false;
|
||||
}
|
||||
buffer += this.encodeVlq(mapping.column - lastColumn);
|
||||
lastColumn = mapping.column;
|
||||
buffer += this.encodeVlq(0);
|
||||
buffer += this.encodeVlq(mapping.sourceLine - lastSourceLine);
|
||||
lastSourceLine = mapping.sourceLine;
|
||||
buffer += this.encodeVlq(mapping.sourceColumn - lastSourceColumn);
|
||||
lastSourceColumn = mapping.sourceColumn;
|
||||
needComma = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
v3 = {
|
||||
version: 3,
|
||||
file: options.generatedFile || '',
|
||||
sourceRoot: options.sourceRoot || '',
|
||||
sources: options.sourceFiles || [''],
|
||||
names: [],
|
||||
mappings: buffer
|
||||
};
|
||||
if (options.inlineMap) {
|
||||
v3.sourcesContent = [code];
|
||||
}
|
||||
return v3;
|
||||
};
|
||||
|
||||
VLQ_SHIFT = 5;
|
||||
|
||||
VLQ_CONTINUATION_BIT = 1 << VLQ_SHIFT;
|
||||
|
||||
VLQ_VALUE_MASK = VLQ_CONTINUATION_BIT - 1;
|
||||
|
||||
SourceMap.prototype.encodeVlq = function(value) {
|
||||
var answer, nextChunk, signBit, valueToEncode;
|
||||
answer = '';
|
||||
signBit = value < 0 ? 1 : 0;
|
||||
valueToEncode = (Math.abs(value) << 1) + signBit;
|
||||
while (valueToEncode || !answer) {
|
||||
nextChunk = valueToEncode & VLQ_VALUE_MASK;
|
||||
valueToEncode = valueToEncode >> VLQ_SHIFT;
|
||||
if (valueToEncode) {
|
||||
nextChunk |= VLQ_CONTINUATION_BIT;
|
||||
}
|
||||
answer += this.encodeBase64(nextChunk);
|
||||
}
|
||||
return answer;
|
||||
};
|
||||
|
||||
BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||||
|
||||
SourceMap.prototype.encodeBase64 = function(value) {
|
||||
return BASE64_CHARS[value] || (function() {
|
||||
throw new Error("Cannot Base64 encode value: " + value);
|
||||
})();
|
||||
};
|
||||
|
||||
return SourceMap;
|
||||
|
||||
})();
|
||||
|
||||
module.exports = SourceMap;
|
||||
|
||||
}).call(this);
|
||||
@@ -1,28 +1,22 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
// Generated by CoffeeScript 2.0.0-alpha1
|
||||
(function() {
|
||||
var CoffeeScript, compile, runScripts,
|
||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
CoffeeScript = require('./coffee-script');
|
||||
CoffeeScript = require('./coffeescript');
|
||||
|
||||
CoffeeScript.require = require;
|
||||
|
||||
compile = CoffeeScript.compile;
|
||||
|
||||
CoffeeScript["eval"] = function(code, options) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
CoffeeScript["eval"] = function(code, options = {}) {
|
||||
if (options.bare == null) {
|
||||
options.bare = true;
|
||||
}
|
||||
return eval(compile(code, options));
|
||||
};
|
||||
|
||||
CoffeeScript.run = function(code, options) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
CoffeeScript.run = function(code, options = {}) {
|
||||
options.bare = true;
|
||||
options.shiftLine = true;
|
||||
return Function(compile(code, options))();
|
||||
@@ -33,23 +27,14 @@
|
||||
}
|
||||
|
||||
if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null)) {
|
||||
compile = function(code, options) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
compile = function(code, options = {}) {
|
||||
options.inlineMap = true;
|
||||
return CoffeeScript.compile(code, options);
|
||||
};
|
||||
}
|
||||
|
||||
CoffeeScript.load = function(url, callback, options, hold) {
|
||||
CoffeeScript.load = function(url, callback, options = {}, hold = false) {
|
||||
var xhr;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
if (hold == null) {
|
||||
hold = false;
|
||||
}
|
||||
options.sourceFiles = [url];
|
||||
xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new window.XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
@@ -62,10 +47,10 @@
|
||||
if ((ref = xhr.status) === 0 || ref === 200) {
|
||||
param = [xhr.responseText, options];
|
||||
if (!hold) {
|
||||
CoffeeScript.run.apply(CoffeeScript, param);
|
||||
CoffeeScript.run(...param);
|
||||
}
|
||||
} else {
|
||||
throw new Error("Could not load " + url);
|
||||
throw new Error(`Could not load ${url}`);
|
||||
}
|
||||
if (callback) {
|
||||
return callback(param);
|
||||
@@ -95,7 +80,7 @@
|
||||
var param;
|
||||
param = coffees[index];
|
||||
if (param instanceof Array) {
|
||||
CoffeeScript.run.apply(CoffeeScript, param);
|
||||
CoffeeScript.run(...param);
|
||||
index++;
|
||||
return execute();
|
||||
}
|
||||
@@ -107,11 +92,13 @@
|
||||
};
|
||||
source = script.src || script.getAttribute('data-src');
|
||||
if (source) {
|
||||
options.filename = source;
|
||||
return CoffeeScript.load(source, function(param) {
|
||||
coffees[i] = param;
|
||||
return execute();
|
||||
}, options, true);
|
||||
} else {
|
||||
options.filename = script.id && script.id !== '' ? script.id : `coffeescript${(i !== 0 ? i : '')}`;
|
||||
options.sourceFiles = ['embedded'];
|
||||
return coffees[i] = [script.innerHTML, options];
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
// Generated by CoffeeScript 2.0.0-alpha1
|
||||
(function() {
|
||||
var CoffeeScript, cakefileDirectory, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
optparse = require('./optparse');
|
||||
|
||||
CoffeeScript = require('./coffee-script');
|
||||
CoffeeScript = require('./coffeescript');
|
||||
|
||||
CoffeeScript.register();
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
options = oparse.parse(args);
|
||||
} catch (error) {
|
||||
e = error;
|
||||
return fatalError("" + e);
|
||||
return fatalError(`${e}`);
|
||||
}
|
||||
ref = options["arguments"];
|
||||
results = [];
|
||||
@@ -76,13 +76,13 @@
|
||||
var cakefilePath, desc, name, relative, spaces, task;
|
||||
relative = path.relative || path.resolve;
|
||||
cakefilePath = path.join(relative(__originalDirname, process.cwd()), 'Cakefile');
|
||||
console.log(cakefilePath + " defines the following tasks:\n");
|
||||
console.log(`${cakefilePath} defines the following tasks:\n`);
|
||||
for (name in tasks) {
|
||||
task = tasks[name];
|
||||
spaces = 20 - name.length;
|
||||
spaces = spaces > 0 ? Array(spaces + 1).join(' ') : '';
|
||||
desc = task.description ? "# " + task.description : '';
|
||||
console.log("cake " + name + spaces + " " + desc);
|
||||
desc = task.description ? `# ${task.description}` : '';
|
||||
console.log(`cake ${name}${spaces} ${desc}`);
|
||||
}
|
||||
if (switches.length) {
|
||||
return console.log(oparse.help());
|
||||
@@ -96,7 +96,7 @@
|
||||
};
|
||||
|
||||
missingTask = function(task) {
|
||||
return fatalError("No such task: " + task);
|
||||
return fatalError(`No such task: ${task}`);
|
||||
};
|
||||
|
||||
cakefileDirectory = function(dir) {
|
||||
@@ -108,7 +108,7 @@
|
||||
if (parent !== dir) {
|
||||
return cakefileDirectory(parent);
|
||||
}
|
||||
throw new Error("Cakefile not found in " + (process.cwd()));
|
||||
throw new Error(`Cakefile not found in ${process.cwd()}`);
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
// Generated by CoffeeScript 2.0.0-alpha1
|
||||
(function() {
|
||||
var Lexer, SourceMap, base64encode, compile, ext, fn1, formatSourcePosition, fs, getSourceMap, helpers, i, len, lexer, packageJson, parser, path, ref, sourceMaps, sources, vm, withPrettyErrors,
|
||||
hasProp = {}.hasOwnProperty;
|
||||
@@ -28,7 +28,7 @@
|
||||
base64encode = function(src) {
|
||||
switch (false) {
|
||||
case typeof Buffer !== 'function':
|
||||
return new Buffer(src).toString('base64');
|
||||
return Buffer.from(src).toString('base64');
|
||||
case typeof btoa !== 'function':
|
||||
return btoa(encodeURIComponent(src).replace(/%([0-9A-F]{2})/g, function(match, p1) {
|
||||
return String.fromCharCode('0x' + p1);
|
||||
@@ -39,11 +39,8 @@
|
||||
};
|
||||
|
||||
withPrettyErrors = function(fn) {
|
||||
return function(code, options) {
|
||||
return function(code, options = {}) {
|
||||
var err;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
try {
|
||||
return fn.call(this, code, options);
|
||||
} catch (error) {
|
||||
@@ -120,8 +117,8 @@
|
||||
js += fragment.code;
|
||||
}
|
||||
if (options.header) {
|
||||
header = "Generated by CoffeeScript " + this.VERSION;
|
||||
js = "// " + header + "\n" + js;
|
||||
header = `Generated by CoffeeScript ${this.VERSION}`;
|
||||
js = `// ${header}\n${js}`;
|
||||
}
|
||||
if (generateSourceMap) {
|
||||
v3SourceMap = map.generate(options, code);
|
||||
@@ -129,9 +126,9 @@
|
||||
}
|
||||
if (options.inlineMap) {
|
||||
encoded = base64encode(JSON.stringify(v3SourceMap));
|
||||
sourceMapDataURI = "//# sourceMappingURL=data:application/json;base64," + encoded;
|
||||
sourceURL = "//# sourceURL=" + ((ref1 = options.filename) != null ? ref1 : 'coffeescript');
|
||||
js = js + "\n" + sourceMapDataURI + "\n" + sourceURL;
|
||||
sourceMapDataURI = `//# sourceMappingURL=data:application/json;base64,${encoded}`;
|
||||
sourceURL = `//# sourceURL=${(ref1 = options.filename) != null ? ref1 : 'coffeescript'}`;
|
||||
js = `${js}\n${sourceMapDataURI}\n${sourceURL}`;
|
||||
}
|
||||
if (options.sourceMap) {
|
||||
return {
|
||||
@@ -156,11 +153,8 @@
|
||||
}
|
||||
});
|
||||
|
||||
exports.run = function(code, options) {
|
||||
exports.run = function(code, options = {}) {
|
||||
var answer, dir, mainModule, ref;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
mainModule = require.main;
|
||||
mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '<anonymous>';
|
||||
mainModule.moduleCache && (mainModule.moduleCache = {});
|
||||
@@ -173,11 +167,8 @@
|
||||
return mainModule._compile(code, mainModule.filename);
|
||||
};
|
||||
|
||||
exports["eval"] = function(code, options) {
|
||||
exports["eval"] = function(code, options = {}) {
|
||||
var Module, _module, _require, createContext, i, isContext, js, k, len, o, r, ref, ref1, ref2, ref3, sandbox, v;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
if (!(code = code.trim())) {
|
||||
return;
|
||||
}
|
||||
@@ -248,7 +239,7 @@
|
||||
fn1 = function(ext) {
|
||||
var base;
|
||||
return (base = require.extensions)[ext] != null ? base[ext] : base[ext] = function() {
|
||||
throw new Error("Use CoffeeScript.register() or require the coffee-script/register module to require " + ext + " files.");
|
||||
throw new Error(`Use CoffeeScript.register() or require the coffeescript/register module to require ${ext} files.`);
|
||||
};
|
||||
};
|
||||
for (i = 0, len = ref.length; i < len; i++) {
|
||||
@@ -257,14 +248,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
exports._compileFile = function(filename, sourceMap, inlineMap) {
|
||||
exports._compileFile = function(filename, sourceMap = false, inlineMap = false) {
|
||||
var answer, err, raw, stripped;
|
||||
if (sourceMap == null) {
|
||||
sourceMap = false;
|
||||
}
|
||||
if (inlineMap == null) {
|
||||
inlineMap = false;
|
||||
}
|
||||
raw = fs.readFileSync(filename, 'utf8');
|
||||
stripped = raw.charCodeAt(0) === 0xFEFF ? raw.substring(1) : raw;
|
||||
try {
|
||||
@@ -325,7 +310,7 @@
|
||||
return helpers.nameWhitespaceCharacter(errorText);
|
||||
}
|
||||
})();
|
||||
return helpers.throwSyntaxError("unexpected " + errorText, errorLoc);
|
||||
return helpers.throwSyntaxError(`unexpected ${errorText}`, errorLoc);
|
||||
};
|
||||
|
||||
formatSourcePosition = function(frame, getSourceMapping) {
|
||||
@@ -338,7 +323,7 @@
|
||||
if (frame.isEval()) {
|
||||
filename = frame.getScriptNameOrSourceURL();
|
||||
if (!filename) {
|
||||
fileLocation = (frame.getEvalOrigin()) + ", ";
|
||||
fileLocation = `${frame.getEvalOrigin()}, `;
|
||||
}
|
||||
} else {
|
||||
filename = frame.getFileName();
|
||||
@@ -347,7 +332,7 @@
|
||||
line = frame.getLineNumber();
|
||||
column = frame.getColumnNumber();
|
||||
source = getSourceMapping(filename, line, column);
|
||||
fileLocation = source ? filename + ":" + source[0] + ":" + source[1] : filename + ":" + line + ":" + column;
|
||||
fileLocation = source ? `${filename}:${source[0]}:${source[1]}` : `${filename}:${line}:${column}`;
|
||||
}
|
||||
functionName = frame.getFunctionName();
|
||||
isConstructor = frame.isConstructor();
|
||||
@@ -358,19 +343,19 @@
|
||||
if (functionName) {
|
||||
tp = as = '';
|
||||
if (typeName && functionName.indexOf(typeName)) {
|
||||
tp = typeName + ".";
|
||||
tp = `${typeName}.`;
|
||||
}
|
||||
if (methodName && functionName.indexOf("." + methodName) !== functionName.length - methodName.length - 1) {
|
||||
as = " [as " + methodName + "]";
|
||||
if (methodName && functionName.indexOf(`.${methodName}`) !== functionName.length - methodName.length - 1) {
|
||||
as = ` [as ${methodName}]`;
|
||||
}
|
||||
return "" + tp + functionName + as + " (" + fileLocation + ")";
|
||||
return `${tp}${functionName}${as} (${fileLocation})`;
|
||||
} else {
|
||||
return typeName + "." + (methodName || '<anonymous>') + " (" + fileLocation + ")";
|
||||
return `${typeName}.${methodName || '<anonymous>'} (${fileLocation})`;
|
||||
}
|
||||
} else if (isConstructor) {
|
||||
return "new " + (functionName || '<anonymous>') + " (" + fileLocation + ")";
|
||||
return `new ${functionName || '<anonymous>'} (${fileLocation})`;
|
||||
} else if (functionName) {
|
||||
return functionName + " (" + fileLocation + ")";
|
||||
return `${functionName} (${fileLocation})`;
|
||||
} else {
|
||||
return fileLocation;
|
||||
}
|
||||
@@ -416,11 +401,11 @@
|
||||
if (frame.getFunction() === exports.run) {
|
||||
break;
|
||||
}
|
||||
results.push(" at " + (formatSourcePosition(frame, getSourceMapping)));
|
||||
results.push(` at ${formatSourcePosition(frame, getSourceMapping)}`);
|
||||
}
|
||||
return results;
|
||||
})();
|
||||
return (err.toString()) + "\n" + (frames.join('\n')) + "\n";
|
||||
return `${err.toString()}\n${frames.join('\n')}\n`;
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
// Generated by CoffeeScript 2.0.0-alpha1
|
||||
(function() {
|
||||
var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, findDirectoryIndex, forkNode, fs, helpers, hidden, joinTimeout, makePrelude, mkdirp, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, ref, removeSource, removeSourceDir, silentUnlink, sourceCode, sources, spawn, timeLog, usage, useWinPathSep, version, wait, watch, watchDir, watchedDirs, writeJs,
|
||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
optparse = require('./optparse');
|
||||
|
||||
CoffeeScript = require('./coffee-script');
|
||||
CoffeeScript = require('./coffeescript');
|
||||
|
||||
ref = require('child_process'), spawn = ref.spawn, exec = ref.exec;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
BANNER = 'Usage: coffee [options] path/to/script.coffee -- [args]\n\nIf called without options, `coffee` will run your script.';
|
||||
|
||||
SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-m', '--map', 'generate source map and save as .js.map files'], ['-M', '--inline-map', 'generate source map and include it directly in output'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['--no-header', 'suppress the "Generated by" header'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-r', '--require [MODULE*]', 'require the given module before eval or REPL'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-l', '--literate', 'treat stdio as literate style coffee-script'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']];
|
||||
SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-m', '--map', 'generate source map and save as .js.map files'], ['-M', '--inline-map', 'generate source map and include it directly in output'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['--no-header', 'suppress the "Generated by" header'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-r', '--require [MODULE*]', 'require the given module before eval or REPL'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-l', '--literate', 'treat stdio as literate style coffeescript'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']];
|
||||
|
||||
opts = {};
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
_ = match[0], name = match[1], module = match[2];
|
||||
}
|
||||
name || (name = helpers.baseFileName(module, true, useWinPathSep));
|
||||
return name + " = require('" + module + "')";
|
||||
return `${name} = require('${module}')`;
|
||||
}).join(';');
|
||||
};
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
} catch (error) {
|
||||
err = error;
|
||||
if (err.code === 'ENOENT') {
|
||||
console.error("File not found: " + source);
|
||||
console.error(`File not found: ${source}`);
|
||||
process.exit(1);
|
||||
}
|
||||
throw err;
|
||||
@@ -182,7 +182,7 @@
|
||||
ref1 = CoffeeScript.FILE_EXTENSIONS;
|
||||
for (i = 0, len = ref1.length; i < len; i++) {
|
||||
ext = ref1[i];
|
||||
index = path.join(source, "index" + ext);
|
||||
index = path.join(source, `index${ext}`);
|
||||
try {
|
||||
if ((fs.statSync(index)).isFile()) {
|
||||
return index;
|
||||
@@ -194,15 +194,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
console.error("Missing index.coffee or index.litcoffee in " + source);
|
||||
console.error(`Missing index.coffee or index.litcoffee in ${source}`);
|
||||
return process.exit(1);
|
||||
};
|
||||
|
||||
compileScript = function(file, input, base) {
|
||||
compileScript = function(file, input, base = null) {
|
||||
var compiled, err, message, o, options, t, task;
|
||||
if (base == null) {
|
||||
base = null;
|
||||
}
|
||||
o = opts;
|
||||
options = compileOptions(file, base);
|
||||
try {
|
||||
@@ -248,7 +245,7 @@
|
||||
if (CoffeeScript.listeners('failure').length) {
|
||||
return;
|
||||
}
|
||||
message = (err != null ? err.stack : void 0) || ("" + err);
|
||||
message = (err != null ? err.stack : void 0) || `${err}`;
|
||||
if (o.watch) {
|
||||
return printLine(message + '\x07');
|
||||
} else {
|
||||
@@ -423,7 +420,7 @@
|
||||
if (!opts.join) {
|
||||
silentUnlink(outputPath(source, base));
|
||||
silentUnlink(outputPath(source, base, '.js.map'));
|
||||
return timeLog("removed " + source);
|
||||
return timeLog(`removed ${source}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -439,11 +436,8 @@
|
||||
}
|
||||
};
|
||||
|
||||
outputPath = function(source, base, extension) {
|
||||
outputPath = function(source, base, extension = ".js") {
|
||||
var basename, dir, srcDir;
|
||||
if (extension == null) {
|
||||
extension = ".js";
|
||||
}
|
||||
basename = helpers.baseFileName(source, true, useWinPathSep);
|
||||
srcDir = path.dirname(source);
|
||||
if (!opts.output) {
|
||||
@@ -458,7 +452,7 @@
|
||||
|
||||
mkdirp = function(dir, fn) {
|
||||
var mkdirs, mode;
|
||||
mode = 0x1ff & ~process.umask();
|
||||
mode = 0o777 & ~process.umask();
|
||||
return (mkdirs = function(p, fn) {
|
||||
return fs.exists(p, function(exists) {
|
||||
if (exists) {
|
||||
@@ -477,11 +471,8 @@
|
||||
})(dir, fn);
|
||||
};
|
||||
|
||||
writeJs = function(base, sourcePath, js, jsPath, generatedSourceMap) {
|
||||
writeJs = function(base, sourcePath, js, jsPath, generatedSourceMap = null) {
|
||||
var compile, jsDir, sourceMapPath;
|
||||
if (generatedSourceMap == null) {
|
||||
generatedSourceMap = null;
|
||||
}
|
||||
sourceMapPath = outputPath(sourcePath, base, ".js.map");
|
||||
jsDir = path.dirname(jsPath);
|
||||
compile = function() {
|
||||
@@ -490,21 +481,21 @@
|
||||
js = ' ';
|
||||
}
|
||||
if (generatedSourceMap) {
|
||||
js = js + "\n//# sourceMappingURL=" + (helpers.baseFileName(sourceMapPath, false, useWinPathSep)) + "\n";
|
||||
js = `${js}\n//# sourceMappingURL=${helpers.baseFileName(sourceMapPath, false, useWinPathSep)}\n`;
|
||||
}
|
||||
fs.writeFile(jsPath, js, function(err) {
|
||||
if (err) {
|
||||
printLine(err.message);
|
||||
return process.exit(1);
|
||||
} else if (opts.compile && opts.watch) {
|
||||
return timeLog("compiled " + sourcePath);
|
||||
return timeLog(`compiled ${sourcePath}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (generatedSourceMap) {
|
||||
return fs.writeFile(sourceMapPath, generatedSourceMap, function(err) {
|
||||
if (err) {
|
||||
printLine("Could not write source map: " + err.message);
|
||||
printLine(`Could not write source map: ${err.message}`);
|
||||
return process.exit(1);
|
||||
}
|
||||
});
|
||||
@@ -524,7 +515,7 @@
|
||||
};
|
||||
|
||||
timeLog = function(message) {
|
||||
return console.log(((new Date).toLocaleTimeString()) + " - " + message);
|
||||
return console.log(`${(new Date).toLocaleTimeString()} - ${message}`);
|
||||
};
|
||||
|
||||
printTokens = function(tokens) {
|
||||
@@ -536,7 +527,7 @@
|
||||
token = tokens[i];
|
||||
tag = token[0];
|
||||
value = token[1].toString().replace(/\n/, '\\n');
|
||||
results.push("[" + tag + " " + value + "]");
|
||||
results.push(`[${tag} ${value}]`);
|
||||
}
|
||||
return results;
|
||||
})();
|
||||
@@ -604,7 +595,7 @@
|
||||
};
|
||||
|
||||
version = function() {
|
||||
return printLine("CoffeeScript version " + CoffeeScript.VERSION);
|
||||
return printLine(`CoffeeScript version ${CoffeeScript.VERSION}`);
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
// Generated by CoffeeScript 2.0.0-alpha1
|
||||
(function() {
|
||||
var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap;
|
||||
|
||||
@@ -13,19 +13,19 @@
|
||||
if (!action) {
|
||||
return [patternString, '$$ = $1;', options];
|
||||
}
|
||||
action = (match = unwrap.exec(action)) ? match[1] : "(" + action + "())";
|
||||
action = (match = unwrap.exec(action)) ? match[1] : `(${action}())`;
|
||||
action = action.replace(/\bnew /g, '$&yy.');
|
||||
action = action.replace(/\b(?:Block\.wrap|extend)\b/g, 'yy.$&');
|
||||
addLocationDataFn = function(first, last) {
|
||||
if (!last) {
|
||||
return "yy.addLocationDataFn(@" + first + ")";
|
||||
return `yy.addLocationDataFn(@${first})`;
|
||||
} else {
|
||||
return "yy.addLocationDataFn(@" + first + ", @" + last + ")";
|
||||
return `yy.addLocationDataFn(@${first}, @${last})`;
|
||||
}
|
||||
};
|
||||
action = action.replace(/LOC\(([0-9]*)\)/g, addLocationDataFn('$1'));
|
||||
action = action.replace(/LOC\(([0-9]*),\s*([0-9]*)\)/g, addLocationDataFn('$1', '$2'));
|
||||
return [patternString, "$$ = " + (addLocationDataFn(1, patternCount)) + "(" + action + ");", options];
|
||||
return [patternString, `$$ = ${addLocationDataFn(1, patternCount)}(${action});`, options];
|
||||
};
|
||||
|
||||
grammar = {
|
||||
@@ -41,7 +41,8 @@
|
||||
return $1.push($3);
|
||||
}), o('Body TERMINATOR')
|
||||
],
|
||||
Line: [o('Expression'), o('Statement'), o('YieldReturn')],
|
||||
Line: [o('Expression'), o('Statement'), o('FuncDirective')],
|
||||
FuncDirective: [o('YieldReturn'), o('AwaitReturn')],
|
||||
Statement: [
|
||||
o('Return'), o('Comment'), o('STATEMENT', function() {
|
||||
return new StatementLiteral($1);
|
||||
@@ -154,6 +155,13 @@
|
||||
return new YieldReturn;
|
||||
})
|
||||
],
|
||||
AwaitReturn: [
|
||||
o('AWAIT RETURN Expression', function() {
|
||||
return new AwaitReturn($3);
|
||||
}), o('AWAIT RETURN', function() {
|
||||
return new AwaitReturn;
|
||||
})
|
||||
],
|
||||
Comment: [
|
||||
o('HERECOMMENT', function() {
|
||||
return new Comment($1);
|
||||
@@ -227,7 +235,14 @@
|
||||
return new Value($1);
|
||||
}), o('Range', function() {
|
||||
return new Value($1);
|
||||
}), o('This')
|
||||
}), o('This'), o('Super')
|
||||
],
|
||||
Super: [
|
||||
o('SUPER . Property', function() {
|
||||
return new Super(LOC(3)(new Access($3)));
|
||||
}), o('SUPER INDEX_START Expression INDEX_END', function() {
|
||||
return new Super(LOC(3)(new Index($3)));
|
||||
})
|
||||
],
|
||||
Accessor: [
|
||||
o('. Property', function() {
|
||||
@@ -404,13 +419,8 @@
|
||||
return new Call($1, $3, $2);
|
||||
}), o('Invocation OptFuncExist Arguments', function() {
|
||||
return new Call($1, $3, $2);
|
||||
}), o('Super')
|
||||
],
|
||||
Super: [
|
||||
o('SUPER', function() {
|
||||
return new SuperCall;
|
||||
}), o('SUPER Arguments', function() {
|
||||
return new SuperCall($2);
|
||||
}), o('SUPER OptFuncExist Arguments', function() {
|
||||
return new SuperCall(LOC(1)(new Super), $3, $2);
|
||||
})
|
||||
],
|
||||
OptFuncExist: [
|
||||
@@ -723,6 +733,8 @@
|
||||
return new Op('+', $2);
|
||||
}), {
|
||||
prec: 'UNARY_MATH'
|
||||
}), o('AWAIT Expression', function() {
|
||||
return new Op($1, $2);
|
||||
}), o('-- SimpleAssignable', function() {
|
||||
return new Op('--', $2);
|
||||
}), o('++ SimpleAssignable', function() {
|
||||
@@ -775,7 +787,7 @@
|
||||
]
|
||||
};
|
||||
|
||||
operators = [['left', '.', '?.', '::', '?::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['right', '**'], ['right', 'UNARY_MATH'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', '&'], ['left', '^'], ['left', '|'], ['left', '&&'], ['left', '||'], ['left', 'BIN?'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', 'YIELD'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'FORFROM', 'BY', 'WHEN'], ['right', 'IF', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS', 'IMPORT', 'EXPORT'], ['left', 'POST_IF']];
|
||||
operators = [['left', '.', '?.', '::', '?::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['right', 'AWAIT'], ['right', '**'], ['right', 'UNARY_MATH'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', '&'], ['left', '^'], ['left', '|'], ['left', '&&'], ['left', '||'], ['left', 'BIN?'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', 'YIELD'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'FORFROM', 'BY', 'WHEN'], ['right', 'IF', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS', 'IMPORT', 'EXPORT'], ['left', 'POST_IF']];
|
||||
|
||||
tokens = [];
|
||||
|
||||
@@ -794,7 +806,7 @@
|
||||
}
|
||||
}
|
||||
if (name === 'Root') {
|
||||
alt[1] = "return " + alt[1];
|
||||
alt[1] = `return ${alt[1]}`;
|
||||
}
|
||||
results.push(alt);
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
// Generated by CoffeeScript 2.0.0-alpha1
|
||||
(function() {
|
||||
var buildLocationData, extend, flatten, ref, repeat, syntaxErrorToString;
|
||||
var buildLocationData, extend, flatten, marked, ref, repeat, syntaxErrorToString;
|
||||
|
||||
marked = require('marked');
|
||||
|
||||
exports.starts = function(string, literal, start) {
|
||||
return literal === string.substr(start, literal.length);
|
||||
@@ -96,25 +98,24 @@
|
||||
};
|
||||
|
||||
exports.invertLiterate = function(code) {
|
||||
var line, lines, maybe_code;
|
||||
maybe_code = true;
|
||||
lines = (function() {
|
||||
var i, len1, ref1, results;
|
||||
ref1 = code.split('\n');
|
||||
results = [];
|
||||
for (i = 0, len1 = ref1.length; i < len1; i++) {
|
||||
line = ref1[i];
|
||||
if (maybe_code && /^([ ]{4}|[ ]{0,3}\t)/.test(line)) {
|
||||
results.push(line);
|
||||
} else if (maybe_code = /^\s*$/.test(line)) {
|
||||
results.push(line);
|
||||
} else {
|
||||
results.push('# ' + line);
|
||||
}
|
||||
var generateRandomToken, i, item, len1, out, ref1, token;
|
||||
generateRandomToken = function() {
|
||||
return `${Math.random() * Date.now()}`;
|
||||
};
|
||||
while (token === void 0 || code.indexOf(token) !== -1) {
|
||||
token = generateRandomToken();
|
||||
}
|
||||
code = code.replace("\t", token);
|
||||
out = "";
|
||||
ref1 = marked.lexer(code, {});
|
||||
for (i = 0, len1 = ref1.length; i < len1; i++) {
|
||||
item = ref1[i];
|
||||
if (item.type === 'code') {
|
||||
out += `${item.text}\n`;
|
||||
}
|
||||
return results;
|
||||
})();
|
||||
return lines.join('\n');
|
||||
}
|
||||
out.replace(token, "\t");
|
||||
return out;
|
||||
};
|
||||
|
||||
buildLocationData = function(first, last) {
|
||||
@@ -147,20 +148,14 @@
|
||||
locationData = obj;
|
||||
}
|
||||
if (locationData) {
|
||||
return ((locationData.first_line + 1) + ":" + (locationData.first_column + 1) + "-") + ((locationData.last_line + 1) + ":" + (locationData.last_column + 1));
|
||||
return `${locationData.first_line + 1}:${locationData.first_column + 1}-` + `${locationData.last_line + 1}:${locationData.last_column + 1}`;
|
||||
} else {
|
||||
return "No location data";
|
||||
}
|
||||
};
|
||||
|
||||
exports.baseFileName = function(file, stripExt, useWinPathSep) {
|
||||
exports.baseFileName = function(file, stripExt = false, useWinPathSep = false) {
|
||||
var parts, pathSep;
|
||||
if (stripExt == null) {
|
||||
stripExt = false;
|
||||
}
|
||||
if (useWinPathSep == null) {
|
||||
useWinPathSep = false;
|
||||
}
|
||||
pathSep = useWinPathSep ? /\\|\// : /\//;
|
||||
parts = file.split(pathSep);
|
||||
file = parts[parts.length - 1];
|
||||
@@ -223,12 +218,12 @@
|
||||
}
|
||||
if ((ref4 = this.colorful) != null ? ref4 : colorsEnabled) {
|
||||
colorize = function(str) {
|
||||
return "\x1B[1;31m" + str + "\x1B[0m";
|
||||
return `\x1B[1;31m${str}\x1B[0m`;
|
||||
};
|
||||
codeLine = codeLine.slice(0, start) + colorize(codeLine.slice(start, end)) + codeLine.slice(end);
|
||||
marker = colorize(marker);
|
||||
}
|
||||
return filename + ":" + (first_line + 1) + ":" + (first_column + 1) + ": error: " + this.message + "\n" + codeLine + "\n" + marker;
|
||||
return `${filename}:${first_line + 1}:${first_column + 1}: error: ${this.message}\n${codeLine}\n${marker}`;
|
||||
};
|
||||
|
||||
exports.nameWhitespaceCharacter = function(string) {
|
||||
@@ -1,8 +1,8 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
// Generated by CoffeeScript 2.0.0-alpha1
|
||||
(function() {
|
||||
var key, ref, val;
|
||||
|
||||
ref = require('./coffee-script');
|
||||
ref = require('./coffeescript');
|
||||
for (key in ref) {
|
||||
val = ref[key];
|
||||
exports[key] = val;
|
||||
@@ -1,27 +1,22 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
// Generated by CoffeeScript 2.0.0-alpha1
|
||||
(function() {
|
||||
var BOM, BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HERECOMMENT_ILLEGAL, HEREDOC_DOUBLE, HEREDOC_INDENT, HEREDOC_SINGLE, HEREGEX, HEREGEX_OMIT, HERE_JSTOKEN, IDENTIFIER, INDENTABLE_CLOSERS, INDEXABLE, INVALID_ESCAPE, INVERSES, JSTOKEN, JS_KEYWORDS, LEADING_BLANK_LINE, LINE_BREAK, LINE_CONTINUER, Lexer, MATH, MULTI_DENT, NOT_REGEX, NUMBER, OPERATOR, POSSIBLY_DIVISION, REGEX, REGEX_FLAGS, REGEX_ILLEGAL, RELATION, RESERVED, Rewriter, SHIFT, SIMPLE_STRING_OMIT, STRICT_PROSCRIBED, STRING_DOUBLE, STRING_OMIT, STRING_SINGLE, STRING_START, TRAILING_BLANK_LINE, TRAILING_SPACES, UNARY, UNARY_MATH, VALID_FLAGS, WHITESPACE, compact, count, invertLiterate, isForFrom, isUnassignable, key, locationDataToString, ref, ref1, repeat, starts, throwSyntaxError,
|
||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
|
||||
slice = [].slice;
|
||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
ref = require('./rewriter'), Rewriter = ref.Rewriter, INVERSES = ref.INVERSES;
|
||||
|
||||
ref1 = require('./helpers'), count = ref1.count, starts = ref1.starts, compact = ref1.compact, repeat = ref1.repeat, invertLiterate = ref1.invertLiterate, locationDataToString = ref1.locationDataToString, throwSyntaxError = ref1.throwSyntaxError;
|
||||
|
||||
exports.Lexer = Lexer = (function() {
|
||||
function Lexer() {}
|
||||
|
||||
Lexer.prototype.tokenize = function(code, opts) {
|
||||
exports.Lexer = Lexer = class Lexer {
|
||||
tokenize(code, opts = {}) {
|
||||
var consumed, end, i, ref2;
|
||||
if (opts == null) {
|
||||
opts = {};
|
||||
}
|
||||
this.literate = opts.literate;
|
||||
this.indent = 0;
|
||||
this.baseIndent = 0;
|
||||
this.indebt = 0;
|
||||
this.outdebt = 0;
|
||||
this.indents = [];
|
||||
this.indentLiteral = '';
|
||||
this.ends = [];
|
||||
this.tokens = [];
|
||||
this.seenFor = false;
|
||||
@@ -45,30 +40,30 @@
|
||||
}
|
||||
this.closeIndentation();
|
||||
if (end = this.ends.pop()) {
|
||||
this.error("missing " + end.tag, end.origin[2]);
|
||||
this.error(`missing ${end.tag}`, end.origin[2]);
|
||||
}
|
||||
if (opts.rewrite === false) {
|
||||
return this.tokens;
|
||||
}
|
||||
return (new Rewriter).rewrite(this.tokens);
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.clean = function(code) {
|
||||
clean(code) {
|
||||
if (code.charCodeAt(0) === BOM) {
|
||||
code = code.slice(1);
|
||||
}
|
||||
code = code.replace(/\r/g, '').replace(TRAILING_SPACES, '');
|
||||
if (WHITESPACE.test(code)) {
|
||||
code = "\n" + code;
|
||||
code = `\n${code}`;
|
||||
this.chunkLine--;
|
||||
}
|
||||
if (this.literate) {
|
||||
code = invertLiterate(code);
|
||||
}
|
||||
return code;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.identifierToken = function() {
|
||||
identifierToken() {
|
||||
var alias, colon, colonOffset, id, idLength, input, match, poppedToken, prev, ref2, ref3, ref4, ref5, ref6, ref7, tag, tagToken;
|
||||
if (!(match = IDENTIFIER.exec(this.chunk))) {
|
||||
return 0;
|
||||
@@ -136,7 +131,7 @@
|
||||
this.seenFor = false;
|
||||
}
|
||||
if (tag === 'IDENTIFIER' && indexOf.call(RESERVED, id) >= 0) {
|
||||
this.error("reserved word '" + id + "'", {
|
||||
this.error(`reserved word '${id}'`, {
|
||||
length: id.length
|
||||
});
|
||||
}
|
||||
@@ -179,10 +174,10 @@
|
||||
this.token(':', ':', colonOffset, colon.length);
|
||||
}
|
||||
return input.length;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.numberToken = function() {
|
||||
var base, lexedLength, match, number, numberValue, ref2, tag;
|
||||
numberToken() {
|
||||
var base, lexedLength, match, number, numberValue, tag;
|
||||
if (!(match = NUMBER.exec(this.chunk))) {
|
||||
return 0;
|
||||
}
|
||||
@@ -190,22 +185,22 @@
|
||||
lexedLength = number.length;
|
||||
switch (false) {
|
||||
case !/^0[BOX]/.test(number):
|
||||
this.error("radix prefix in '" + number + "' must be lowercase", {
|
||||
this.error(`radix prefix in '${number}' must be lowercase`, {
|
||||
offset: 1
|
||||
});
|
||||
break;
|
||||
case !/^(?!0x).*E/.test(number):
|
||||
this.error("exponential notation in '" + number + "' must be indicated with a lowercase 'e'", {
|
||||
this.error(`exponential notation in '${number}' must be indicated with a lowercase 'e'`, {
|
||||
offset: number.indexOf('E')
|
||||
});
|
||||
break;
|
||||
case !/^0\d*[89]/.test(number):
|
||||
this.error("decimal literal '" + number + "' must not be prefixed with '0'", {
|
||||
this.error(`decimal literal '${number}' must not be prefixed with '0'`, {
|
||||
length: lexedLength
|
||||
});
|
||||
break;
|
||||
case !/^0\d+/.test(number):
|
||||
this.error("octal literal '" + number + "' must be prefixed with '0o'", {
|
||||
this.error(`octal literal '${number}' must be prefixed with '0o'`, {
|
||||
length: lexedLength
|
||||
});
|
||||
}
|
||||
@@ -222,15 +217,12 @@
|
||||
}
|
||||
})();
|
||||
numberValue = base != null ? parseInt(number.slice(2), base) : parseFloat(number);
|
||||
if ((ref2 = number.charAt(1)) === 'b' || ref2 === 'o') {
|
||||
number = "0x" + (numberValue.toString(16));
|
||||
}
|
||||
tag = numberValue === 2e308 ? 'INFINITY' : 'NUMBER';
|
||||
this.token(tag, number, 0, lexedLength);
|
||||
return lexedLength;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.stringToken = function() {
|
||||
stringToken() {
|
||||
var $, attempt, delimiter, doc, end, heredoc, i, indent, indentRegex, match, quote, ref2, ref3, regex, token, tokens;
|
||||
quote = (STRING_START.exec(this.chunk) || [])[0];
|
||||
if (!quote) {
|
||||
@@ -275,46 +267,42 @@
|
||||
}
|
||||
}
|
||||
if (indent) {
|
||||
indentRegex = RegExp("\\n" + indent, "g");
|
||||
indentRegex = RegExp(`\\n${indent}`, "g");
|
||||
}
|
||||
this.mergeInterpolationTokens(tokens, {
|
||||
delimiter: delimiter
|
||||
}, (function(_this) {
|
||||
return function(value, i) {
|
||||
value = _this.formatString(value);
|
||||
if (indentRegex) {
|
||||
value = value.replace(indentRegex, '\n');
|
||||
}
|
||||
if (i === 0) {
|
||||
value = value.replace(LEADING_BLANK_LINE, '');
|
||||
}
|
||||
if (i === $) {
|
||||
value = value.replace(TRAILING_BLANK_LINE, '');
|
||||
}
|
||||
return value;
|
||||
};
|
||||
})(this));
|
||||
}, (value, i) => {
|
||||
value = this.formatString(value);
|
||||
if (indentRegex) {
|
||||
value = value.replace(indentRegex, '\n');
|
||||
}
|
||||
if (i === 0) {
|
||||
value = value.replace(LEADING_BLANK_LINE, '');
|
||||
}
|
||||
if (i === $) {
|
||||
value = value.replace(TRAILING_BLANK_LINE, '');
|
||||
}
|
||||
return value;
|
||||
});
|
||||
} else {
|
||||
this.mergeInterpolationTokens(tokens, {
|
||||
delimiter: delimiter
|
||||
}, (function(_this) {
|
||||
return function(value, i) {
|
||||
value = _this.formatString(value);
|
||||
value = value.replace(SIMPLE_STRING_OMIT, function(match, offset) {
|
||||
if ((i === 0 && offset === 0) || (i === $ && offset + match.length === value.length)) {
|
||||
return '';
|
||||
} else {
|
||||
return ' ';
|
||||
}
|
||||
});
|
||||
return value;
|
||||
};
|
||||
})(this));
|
||||
}, (value, i) => {
|
||||
value = this.formatString(value);
|
||||
value = value.replace(SIMPLE_STRING_OMIT, function(match, offset) {
|
||||
if ((i === 0 && offset === 0) || (i === $ && offset + match.length === value.length)) {
|
||||
return '';
|
||||
} else {
|
||||
return ' ';
|
||||
}
|
||||
});
|
||||
return value;
|
||||
});
|
||||
}
|
||||
return end;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.commentToken = function() {
|
||||
commentToken() {
|
||||
var comment, here, match;
|
||||
if (!(match = this.chunk.match(COMMENT))) {
|
||||
return 0;
|
||||
@@ -322,20 +310,20 @@
|
||||
comment = match[0], here = match[1];
|
||||
if (here) {
|
||||
if (match = HERECOMMENT_ILLEGAL.exec(comment)) {
|
||||
this.error("block comments cannot contain " + match[0], {
|
||||
this.error(`block comments cannot contain ${match[0]}`, {
|
||||
offset: match.index,
|
||||
length: match[0].length
|
||||
});
|
||||
}
|
||||
if (here.indexOf('\n') >= 0) {
|
||||
here = here.replace(RegExp("\\n" + (repeat(' ', this.indent)), "g"), '\n');
|
||||
here = here.replace(RegExp(`\\n${repeat(' ', this.indent)}`, "g"), '\n');
|
||||
}
|
||||
this.token('HERECOMMENT', here, 0, comment.length);
|
||||
}
|
||||
return comment.length;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.jsToken = function() {
|
||||
jsToken() {
|
||||
var match, script;
|
||||
if (!(this.chunk.charAt(0) === '`' && (match = HERE_JSTOKEN.exec(this.chunk) || JSTOKEN.exec(this.chunk)))) {
|
||||
return 0;
|
||||
@@ -345,13 +333,13 @@
|
||||
});
|
||||
this.token('JS', script, 0, match[0].length);
|
||||
return match[0].length;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.regexToken = function() {
|
||||
regexToken() {
|
||||
var body, closed, end, flags, index, match, origin, prev, ref2, ref3, ref4, regex, tokens;
|
||||
switch (false) {
|
||||
case !(match = REGEX_ILLEGAL.exec(this.chunk)):
|
||||
this.error("regular expressions cannot begin with " + match[2], {
|
||||
this.error(`regular expressions cannot begin with ${match[2]}`, {
|
||||
offset: match.index + match[1].length
|
||||
});
|
||||
break;
|
||||
@@ -387,7 +375,7 @@
|
||||
origin = this.makeToken('REGEX', null, 0, end);
|
||||
switch (false) {
|
||||
case !!VALID_FLAGS.test(flags):
|
||||
this.error("invalid regular expression flags " + flags, {
|
||||
this.error(`invalid regular expression flags ${flags}`, {
|
||||
offset: index,
|
||||
length: flags.length
|
||||
});
|
||||
@@ -396,9 +384,9 @@
|
||||
if (body == null) {
|
||||
body = this.formatHeregex(tokens[0][1]);
|
||||
}
|
||||
this.token('REGEX', "" + (this.makeDelimitedLiteral(body, {
|
||||
this.token('REGEX', `${this.makeDelimitedLiteral(body, {
|
||||
delimiter: '/'
|
||||
})) + flags, 0, end, origin);
|
||||
})}${flags}`, 0, end, origin);
|
||||
break;
|
||||
default:
|
||||
this.token('REGEX_START', '(', 0, 0, origin);
|
||||
@@ -416,10 +404,10 @@
|
||||
this.token('REGEX_END', ')', end - 1, 0);
|
||||
}
|
||||
return end;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.lineToken = function() {
|
||||
var diff, indent, match, noNewlines, size;
|
||||
lineToken() {
|
||||
var diff, indent, match, minLiteralLength, newIndentLiteral, noNewlines, size;
|
||||
if (!(match = MULTI_DENT.exec(this.chunk))) {
|
||||
return 0;
|
||||
}
|
||||
@@ -427,6 +415,20 @@
|
||||
this.seenFor = false;
|
||||
size = indent.length - 1 - indent.lastIndexOf('\n');
|
||||
noNewlines = this.unfinished();
|
||||
newIndentLiteral = size > 0 ? indent.slice(-size) : '';
|
||||
if (!/^(.?)\1*$/.exec(newIndentLiteral)) {
|
||||
this.error('mixed indentation', {
|
||||
offset: indent.length
|
||||
});
|
||||
return indent.length;
|
||||
}
|
||||
minLiteralLength = Math.min(newIndentLiteral.length, this.indentLiteral.length);
|
||||
if (newIndentLiteral.slice(0, minLiteralLength) !== this.indentLiteral.slice(0, minLiteralLength)) {
|
||||
this.error('indentation mismatch', {
|
||||
offset: indent.length
|
||||
});
|
||||
return indent.length;
|
||||
}
|
||||
if (size - this.indebt === this.indent) {
|
||||
if (noNewlines) {
|
||||
this.suppressNewlines();
|
||||
@@ -443,6 +445,7 @@
|
||||
}
|
||||
if (!this.tokens.length) {
|
||||
this.baseIndent = this.indent = size;
|
||||
this.indentLiteral = newIndentLiteral;
|
||||
return indent.length;
|
||||
}
|
||||
diff = size - this.indent + this.outdebt;
|
||||
@@ -453,6 +456,7 @@
|
||||
});
|
||||
this.outdebt = this.indebt = 0;
|
||||
this.indent = size;
|
||||
this.indentLiteral = newIndentLiteral;
|
||||
} else if (size < this.baseIndent) {
|
||||
this.error('missing indentation', {
|
||||
offset: indent.length
|
||||
@@ -462,9 +466,9 @@
|
||||
this.outdentToken(this.indent - size, noNewlines, indent.length);
|
||||
}
|
||||
return indent.length;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.outdentToken = function(moveOut, noNewlines, outdentLength) {
|
||||
outdentToken(moveOut, noNewlines, outdentLength) {
|
||||
var decreasedIndent, dent, lastIndent, ref2;
|
||||
decreasedIndent = this.indent - moveOut;
|
||||
while (moveOut > 0) {
|
||||
@@ -499,10 +503,11 @@
|
||||
this.token('TERMINATOR', '\n', outdentLength, 0);
|
||||
}
|
||||
this.indent = decreasedIndent;
|
||||
this.indentLiteral = this.indentLiteral.slice(0, decreasedIndent);
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.whitespaceToken = function() {
|
||||
whitespaceToken() {
|
||||
var match, nline, prev, ref2;
|
||||
if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) {
|
||||
return 0;
|
||||
@@ -516,9 +521,9 @@
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.newlineToken = function(offset) {
|
||||
newlineToken(offset) {
|
||||
while (this.value() === ';') {
|
||||
this.tokens.pop();
|
||||
}
|
||||
@@ -526,16 +531,16 @@
|
||||
this.token('TERMINATOR', '\n', offset, 0);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.suppressNewlines = function() {
|
||||
suppressNewlines() {
|
||||
if (this.value() === '\\') {
|
||||
this.tokens.pop();
|
||||
}
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.literalToken = function() {
|
||||
literalToken() {
|
||||
var match, message, origin, prev, ref2, ref3, ref4, ref5, ref6, skipToken, tag, token, value;
|
||||
if (match = OPERATOR.exec(this.chunk)) {
|
||||
value = match[0];
|
||||
@@ -547,7 +552,7 @@
|
||||
}
|
||||
tag = value;
|
||||
ref2 = this.tokens, prev = ref2[ref2.length - 1];
|
||||
if (prev && indexOf.call(['='].concat(slice.call(COMPOUND_ASSIGN)), value) >= 0) {
|
||||
if (prev && indexOf.call(['=', ...COMPOUND_ASSIGN], value) >= 0) {
|
||||
skipToken = false;
|
||||
if (value === '=' && ((ref3 = prev[1]) === '||' || ref3 === '&&') && !prev.spaced) {
|
||||
prev[0] = 'COMPOUND_ASSIGN';
|
||||
@@ -621,9 +626,9 @@
|
||||
}
|
||||
this.tokens.push(token);
|
||||
return value.length;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.tagParameters = function() {
|
||||
tagParameters() {
|
||||
var i, stack, tok, tokens;
|
||||
if (this.tag() !== ')') {
|
||||
return this;
|
||||
@@ -650,13 +655,13 @@
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.closeIndentation = function() {
|
||||
closeIndentation() {
|
||||
return this.outdentToken(this.indent);
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.matchWithInterpolations = function(regex, delimiter) {
|
||||
matchWithInterpolations(regex, delimiter) {
|
||||
var close, column, firstToken, index, lastToken, line, nested, offsetInChunk, open, ref2, ref3, ref4, str, strPart, tokens;
|
||||
tokens = [];
|
||||
offsetInChunk = delimiter.length;
|
||||
@@ -695,7 +700,7 @@
|
||||
offsetInChunk += index;
|
||||
}
|
||||
if (str.slice(0, delimiter.length) !== delimiter) {
|
||||
this.error("missing " + delimiter, {
|
||||
this.error(`missing ${delimiter}`, {
|
||||
length: delimiter.length
|
||||
});
|
||||
}
|
||||
@@ -714,10 +719,10 @@
|
||||
tokens: tokens,
|
||||
index: offsetInChunk + delimiter.length
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.mergeInterpolationTokens = function(tokens, options, fn) {
|
||||
var converted, firstEmptyStringIndex, firstIndex, i, j, lastToken, len, locationToken, lparen, plusToken, ref2, rparen, tag, token, tokensToPush, value;
|
||||
mergeInterpolationTokens(tokens, options, fn) {
|
||||
var converted, firstEmptyStringIndex, firstIndex, i, j, lastToken, len, locationToken, lparen, plusToken, rparen, tag, token, tokensToPush, value;
|
||||
if (tokens.length > 1) {
|
||||
lparen = this.token('STRING_START', '(', 0, 0);
|
||||
}
|
||||
@@ -759,7 +764,7 @@
|
||||
last_column: locationToken[2].first_column
|
||||
};
|
||||
}
|
||||
(ref2 = this.tokens).push.apply(ref2, tokensToPush);
|
||||
this.tokens.push(...tokensToPush);
|
||||
}
|
||||
if (lparen) {
|
||||
lastToken = tokens[tokens.length - 1];
|
||||
@@ -779,23 +784,23 @@
|
||||
last_column: lastToken[2].last_column
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.pair = function(tag) {
|
||||
pair(tag) {
|
||||
var lastIndent, prev, ref2, ref3, wanted;
|
||||
ref2 = this.ends, prev = ref2[ref2.length - 1];
|
||||
if (tag !== (wanted = prev != null ? prev.tag : void 0)) {
|
||||
if ('OUTDENT' !== wanted) {
|
||||
this.error("unmatched " + tag);
|
||||
this.error(`unmatched ${tag}`);
|
||||
}
|
||||
ref3 = this.indents, lastIndent = ref3[ref3.length - 1];
|
||||
this.outdentToken(lastIndent, true);
|
||||
return this.pair(tag);
|
||||
}
|
||||
return this.ends.pop();
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.getLineAndColumnFromChunk = function(offset) {
|
||||
getLineAndColumnFromChunk(offset) {
|
||||
var column, lastLine, lineCount, ref2, string;
|
||||
if (offset === 0) {
|
||||
return [this.chunkLine, this.chunkColumn];
|
||||
@@ -814,25 +819,19 @@
|
||||
column += string.length;
|
||||
}
|
||||
return [this.chunkLine + lineCount, column];
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.makeToken = function(tag, value, offsetInChunk, length) {
|
||||
makeToken(tag, value, offsetInChunk = 0, length = value.length) {
|
||||
var lastCharacter, locationData, ref2, ref3, token;
|
||||
if (offsetInChunk == null) {
|
||||
offsetInChunk = 0;
|
||||
}
|
||||
if (length == null) {
|
||||
length = value.length;
|
||||
}
|
||||
locationData = {};
|
||||
ref2 = this.getLineAndColumnFromChunk(offsetInChunk), locationData.first_line = ref2[0], locationData.first_column = ref2[1];
|
||||
lastCharacter = length > 0 ? length - 1 : 0;
|
||||
ref3 = this.getLineAndColumnFromChunk(offsetInChunk + lastCharacter), locationData.last_line = ref3[0], locationData.last_column = ref3[1];
|
||||
token = [tag, value, locationData];
|
||||
return token;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.token = function(tag, value, offsetInChunk, length, origin) {
|
||||
token(tag, value, offsetInChunk, length, origin) {
|
||||
var token;
|
||||
token = this.makeToken(tag, value, offsetInChunk, length);
|
||||
if (origin) {
|
||||
@@ -840,38 +839,35 @@
|
||||
}
|
||||
this.tokens.push(token);
|
||||
return token;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.tag = function() {
|
||||
tag() {
|
||||
var ref2, token;
|
||||
ref2 = this.tokens, token = ref2[ref2.length - 1];
|
||||
return token != null ? token[0] : void 0;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.value = function() {
|
||||
value() {
|
||||
var ref2, token;
|
||||
ref2 = this.tokens, token = ref2[ref2.length - 1];
|
||||
return token != null ? token[1] : void 0;
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.unfinished = function() {
|
||||
unfinished() {
|
||||
var ref2;
|
||||
return LINE_CONTINUER.test(this.chunk) || ((ref2 = this.tag()) === '\\' || ref2 === '.' || ref2 === '?.' || ref2 === '?::' || ref2 === 'UNARY' || ref2 === 'MATH' || ref2 === 'UNARY_MATH' || ref2 === '+' || ref2 === '-' || ref2 === '**' || ref2 === 'SHIFT' || ref2 === 'RELATION' || ref2 === 'COMPARE' || ref2 === '&' || ref2 === '^' || ref2 === '|' || ref2 === '&&' || ref2 === '||' || ref2 === 'BIN?' || ref2 === 'THROW' || ref2 === 'EXTENDS');
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.formatString = function(str) {
|
||||
formatString(str) {
|
||||
return str.replace(STRING_OMIT, '$1');
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.formatHeregex = function(str) {
|
||||
formatHeregex(str) {
|
||||
return str.replace(HEREGEX_OMIT, '$1$2');
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.validateEscapes = function(str, options) {
|
||||
validateEscapes(str, options = {}) {
|
||||
var before, hex, invalidEscape, match, message, octal, ref2, unicode;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
match = INVALID_ESCAPE.exec(str);
|
||||
if (!match) {
|
||||
return;
|
||||
@@ -881,22 +877,19 @@
|
||||
return;
|
||||
}
|
||||
message = octal ? "octal escape sequences are not allowed" : "invalid escape sequence";
|
||||
invalidEscape = "\\" + (octal || hex || unicode);
|
||||
return this.error(message + " " + invalidEscape, {
|
||||
invalidEscape = `\\${octal || hex || unicode}`;
|
||||
return this.error(`${message} ${invalidEscape}`, {
|
||||
offset: ((ref2 = options.offsetInChunk) != null ? ref2 : 0) + match.index + before.length,
|
||||
length: invalidEscape.length
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Lexer.prototype.makeDelimitedLiteral = function(body, options) {
|
||||
makeDelimitedLiteral(body, options = {}) {
|
||||
var regex;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
if (body === '' && options.delimiter === '/') {
|
||||
body = '(?:)';
|
||||
}
|
||||
regex = RegExp("(\\\\\\\\)|(\\\\0(?=[1-7]))|\\\\?(" + options.delimiter + ")|\\\\?(?:(\\n)|(\\r)|(\\u2028)|(\\u2029))|(\\\\.)", "g");
|
||||
regex = RegExp(`(\\\\\\\\)|(\\\\0(?=[1-7]))|\\\\?(${options.delimiter})|\\\\?(?:(\\n)|(\\r)|(\\u2028)|(\\u2029))|(\\\\.)`, "g");
|
||||
body = body.replace(regex, function(match, backslash, nul, delimiter, lf, cr, ls, ps, other) {
|
||||
switch (false) {
|
||||
case !backslash:
|
||||
@@ -908,7 +901,7 @@
|
||||
case !nul:
|
||||
return '\\x00';
|
||||
case !delimiter:
|
||||
return "\\" + delimiter;
|
||||
return `\\${delimiter}`;
|
||||
case !lf:
|
||||
return '\\n';
|
||||
case !cr:
|
||||
@@ -919,43 +912,35 @@
|
||||
return '\\u2029';
|
||||
case !other:
|
||||
if (options.double) {
|
||||
return "\\" + other;
|
||||
return `\\${other}`;
|
||||
} else {
|
||||
return other;
|
||||
}
|
||||
}
|
||||
});
|
||||
return "" + options.delimiter + body + options.delimiter;
|
||||
};
|
||||
return `${options.delimiter}${body}${options.delimiter}`;
|
||||
}
|
||||
|
||||
Lexer.prototype.error = function(message, options) {
|
||||
error(message, options = {}) {
|
||||
var first_column, first_line, location, ref2, ref3, ref4;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
location = 'first_line' in options ? options : ((ref3 = this.getLineAndColumnFromChunk((ref2 = options.offset) != null ? ref2 : 0), first_line = ref3[0], first_column = ref3[1], ref3), {
|
||||
first_line: first_line,
|
||||
first_column: first_column,
|
||||
last_column: first_column + ((ref4 = options.length) != null ? ref4 : 1) - 1
|
||||
});
|
||||
return throwSyntaxError(message, location);
|
||||
};
|
||||
|
||||
return Lexer;
|
||||
|
||||
})();
|
||||
|
||||
isUnassignable = function(name, displayName) {
|
||||
if (displayName == null) {
|
||||
displayName = name;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
isUnassignable = function(name, displayName = name) {
|
||||
switch (false) {
|
||||
case indexOf.call(slice.call(JS_KEYWORDS).concat(slice.call(COFFEE_KEYWORDS)), name) < 0:
|
||||
return "keyword '" + displayName + "' can't be assigned";
|
||||
case indexOf.call([...JS_KEYWORDS, ...COFFEE_KEYWORDS], name) < 0:
|
||||
return `keyword '${displayName}' can't be assigned`;
|
||||
case indexOf.call(STRICT_PROSCRIBED, name) < 0:
|
||||
return "'" + displayName + "' can't be assigned";
|
||||
return `'${displayName}' can't be assigned`;
|
||||
case indexOf.call(RESERVED, name) < 0:
|
||||
return "reserved word '" + displayName + "' can't be assigned";
|
||||
return `reserved word '${displayName}' can't be assigned`;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -980,7 +965,7 @@
|
||||
}
|
||||
};
|
||||
|
||||
JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'yield', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super', 'import', 'export', 'default'];
|
||||
JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'yield', 'await', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super', 'import', 'export', 'default'];
|
||||
|
||||
COFFEE_KEYWORDS = ['undefined', 'Infinity', 'NaN', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when'];
|
||||
|
||||
4109
lib/coffeescript/nodes.js
Normal file
4109
lib/coffeescript/nodes.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,16 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
// Generated by CoffeeScript 2.0.0-alpha1
|
||||
(function() {
|
||||
var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments, repeat;
|
||||
|
||||
repeat = require('./helpers').repeat;
|
||||
|
||||
exports.OptionParser = OptionParser = (function() {
|
||||
function OptionParser(rules, banner) {
|
||||
exports.OptionParser = OptionParser = class OptionParser {
|
||||
constructor(rules, banner) {
|
||||
this.banner = banner;
|
||||
this.rules = buildRules(rules);
|
||||
}
|
||||
|
||||
OptionParser.prototype.parse = function(args) {
|
||||
parse(args) {
|
||||
var arg, i, isOption, j, k, len, len1, matchedRule, options, originalArgs, pos, ref, rule, seenNonOptionArg, skippingArgument, value;
|
||||
options = {
|
||||
"arguments": []
|
||||
@@ -48,7 +48,7 @@
|
||||
}
|
||||
}
|
||||
if (isOption && !matchedRule) {
|
||||
throw new Error("unrecognized option: " + arg);
|
||||
throw new Error(`unrecognized option: ${arg}`);
|
||||
}
|
||||
}
|
||||
if (seenNonOptionArg || !isOption) {
|
||||
@@ -56,13 +56,13 @@
|
||||
}
|
||||
}
|
||||
return options;
|
||||
};
|
||||
}
|
||||
|
||||
OptionParser.prototype.help = function() {
|
||||
help() {
|
||||
var j, len, letPart, lines, ref, rule, spaces;
|
||||
lines = [];
|
||||
if (this.banner) {
|
||||
lines.unshift(this.banner + "\n");
|
||||
lines.unshift(`${this.banner}\n`);
|
||||
}
|
||||
ref = this.rules;
|
||||
for (j = 0, len = ref.length; j < len; j++) {
|
||||
@@ -72,12 +72,10 @@
|
||||
letPart = rule.shortFlag ? rule.shortFlag + ', ' : ' ';
|
||||
lines.push(' ' + letPart + rule.longFlag + spaces + rule.description);
|
||||
}
|
||||
return "\n" + (lines.join('\n')) + "\n";
|
||||
};
|
||||
return `\n${lines.join('\n')}\n`;
|
||||
}
|
||||
|
||||
return OptionParser;
|
||||
|
||||
})();
|
||||
};
|
||||
|
||||
LONG_FLAG = /^(--\w[\w\-]*)/;
|
||||
|
||||
@@ -95,16 +93,13 @@
|
||||
if (tuple.length < 3) {
|
||||
tuple.unshift(null);
|
||||
}
|
||||
results.push(buildRule.apply(null, tuple));
|
||||
results.push(buildRule(...tuple));
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
buildRule = function(shortFlag, longFlag, description, options) {
|
||||
buildRule = function(shortFlag, longFlag, description, options = {}) {
|
||||
var match;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
match = longFlag.match(OPTIONAL);
|
||||
longFlag = longFlag.match(LONG_FLAG)[1];
|
||||
return {
|
||||
894
lib/coffeescript/parser.js
Executable file
894
lib/coffeescript/parser.js
Executable file
File diff suppressed because one or more lines are too long
@@ -1,8 +1,8 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
// Generated by CoffeeScript 2.0.0-alpha1
|
||||
(function() {
|
||||
var CoffeeScript, Module, binary, child_process, ext, findExtension, fork, helpers, i, len, loadFile, path, ref;
|
||||
|
||||
CoffeeScript = require('./coffee-script');
|
||||
CoffeeScript = require('./coffeescript');
|
||||
|
||||
child_process = require('child_process');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.4
|
||||
// Generated by CoffeeScript 2.0.0-alpha1
|
||||
(function() {
|
||||
var CoffeeScript, addHistory, addMultilineHandler, fs, getCommandId, merge, nodeREPL, path, ref, replDefaults, runInContext, updateSyntaxError, vm;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
nodeREPL = require('repl');
|
||||
|
||||
CoffeeScript = require('./coffee-script');
|
||||
CoffeeScript = require('./coffeescript');
|
||||
|
||||
ref = require('./helpers'), merge = ref.merge, updateSyntaxError = ref.updateSyntaxError;
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
rli.removeListener('line', nodeLineListener);
|
||||
rli.on('line', function(cmd) {
|
||||
if (multiline.enabled) {
|
||||
multiline.buffer += cmd + "\n";
|
||||
multiline.buffer += `${cmd}\n`;
|
||||
rli.setPrompt(multiline.prompt);
|
||||
rli.prompt(true);
|
||||
} else {
|
||||
@@ -124,7 +124,7 @@
|
||||
stat = fs.statSync(filename);
|
||||
size = Math.min(maxSize, stat.size);
|
||||
readFd = fs.openSync(filename, 'r');
|
||||
buffer = new Buffer(size);
|
||||
buffer = Buffer.alloc(size);
|
||||
fs.readSync(readFd, buffer, 0, size, stat.size - size);
|
||||
fs.closeSync(readFd);
|
||||
repl.rli.history = buffer.toString().split('\n').reverse();
|
||||
@@ -140,7 +140,7 @@
|
||||
fd = fs.openSync(filename, 'a');
|
||||
repl.rli.addListener('line', function(code) {
|
||||
if (code && code.length && code !== '.history' && code !== '.exit' && lastLine !== code) {
|
||||
fs.writeSync(fd, code + "\n");
|
||||
fs.writeSync(fd, `${code}\n`);
|
||||
return lastLine = code;
|
||||
}
|
||||
});
|
||||
@@ -150,7 +150,7 @@
|
||||
return repl.commands[getCommandId(repl, 'history')] = {
|
||||
help: 'Show command history',
|
||||
action: function() {
|
||||
repl.outputStream.write((repl.rli.history.slice(0).reverse().join('\n')) + "\n");
|
||||
repl.outputStream.write(`${repl.rli.history.slice(0).reverse().join('\n')}\n`);
|
||||
return repl.displayPrompt();
|
||||
}
|
||||
};
|
||||
@@ -160,23 +160,20 @@
|
||||
var commandsHaveLeadingDot;
|
||||
commandsHaveLeadingDot = repl.commands['.help'] != null;
|
||||
if (commandsHaveLeadingDot) {
|
||||
return "." + commandName;
|
||||
return `.${commandName}`;
|
||||
} else {
|
||||
return commandName;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
start: function(opts) {
|
||||
start: function(opts = {}) {
|
||||
var build, major, minor, ref1, repl;
|
||||
if (opts == null) {
|
||||
opts = {};
|
||||
}
|
||||
ref1 = process.versions.node.split('.').map(function(n) {
|
||||
return parseInt(n);
|
||||
}), major = ref1[0], minor = ref1[1], build = ref1[2];
|
||||
if (major === 0 && minor < 8) {
|
||||
console.warn("Node 0.8.0+ required for CoffeeScript REPL");
|
||||
if (major < 6) {
|
||||
console.warn("Node 6+ required for CoffeeScript REPL");
|
||||
process.exit(1);
|
||||
}
|
||||
CoffeeScript.register();
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user