coffeescript
Advanced tools
Comparing version
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var CoffeeScript, compile, runScripts, |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(function() { | ||
@@ -27,11 +27,6 @@ var CoffeeScript, cakefileDirectory, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks; | ||
task: function(name, description, action) { | ||
var ref; | ||
if (!action) { | ||
ref = [description, action], action = ref[0], description = ref[1]; | ||
[action, description] = [description, action]; | ||
} | ||
return tasks[name] = { | ||
name: name, | ||
description: description, | ||
action: action | ||
}; | ||
return tasks[name] = {name, description, action}; | ||
}, | ||
@@ -38,0 +33,0 @@ option: function(letter, flag, description) { |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(function() { | ||
@@ -12,5 +12,5 @@ var Lexer, SourceMap, base64encode, compile, ext, fn1, formatSourcePosition, fs, getSourceMap, helpers, i, len, lexer, packageJson, parser, path, ref, sourceMaps, sources, vm, withPrettyErrors, | ||
Lexer = require('./lexer').Lexer; | ||
({Lexer} = require('./lexer')); | ||
parser = require('./parser').parser; | ||
({parser} = require('./parser')); | ||
@@ -63,3 +63,3 @@ helpers = require('./helpers'); | ||
var currentColumn, currentLine, encoded, extend, filename, fragment, fragments, generateSourceMap, header, i, j, js, len, len1, map, merge, newLines, ref, ref1, sourceMapDataURI, sourceURL, token, tokens, v3SourceMap; | ||
merge = helpers.merge, extend = helpers.extend; | ||
({merge, extend} = helpers); | ||
options = extend({}, options); | ||
@@ -137,3 +137,3 @@ generateSourceMap = options.sourceMap || options.inlineMap || (options.filename == null); | ||
return { | ||
js: js, | ||
js, | ||
sourceMap: map, | ||
@@ -260,5 +260,5 @@ v3SourceMap: JSON.stringify(v3SourceMap, null, 2) | ||
answer = compile(stripped, { | ||
filename: filename, | ||
sourceMap: sourceMap, | ||
inlineMap: inlineMap, | ||
filename, | ||
sourceMap, | ||
inlineMap, | ||
sourceFiles: [filename], | ||
@@ -281,3 +281,3 @@ literate: helpers.isLiterate(filename) | ||
if (token) { | ||
tag = token[0], this.yytext = token[1], this.yylloc = token[2]; | ||
[tag, this.yytext, this.yylloc] = token; | ||
parser.errorToken = token.origin || token; | ||
@@ -301,7 +301,6 @@ this.yylineno = this.yylloc.first_line; | ||
parser.yy.parseError = function(message, arg) { | ||
var errorLoc, errorTag, errorText, errorToken, token, tokens; | ||
token = arg.token; | ||
errorToken = parser.errorToken, tokens = parser.tokens; | ||
errorTag = errorToken[0], errorText = errorToken[1], errorLoc = errorToken[2]; | ||
parser.yy.parseError = function(message, {token}) { | ||
var errorLoc, errorTag, errorText, errorToken, tokens; | ||
({errorToken, tokens} = parser); | ||
[errorTag, errorText, errorLoc] = errorToken; | ||
errorText = (function() { | ||
@@ -308,0 +307,0 @@ switch (false) { |
@@ -1,4 +0,4 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(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, | ||
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, 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; }; | ||
@@ -16,5 +16,5 @@ | ||
ref = require('child_process'), spawn = ref.spawn, exec = ref.exec; | ||
({spawn, exec} = require('child_process')); | ||
EventEmitter = require('events').EventEmitter; | ||
({EventEmitter} = require('events')); | ||
@@ -54,3 +54,3 @@ useWinPathSep = path.sep === '\\'; | ||
exports.run = function() { | ||
var i, len, literals, ref1, replCliOpts, results, source; | ||
var i, len, literals, ref, replCliOpts, results, source; | ||
parseOptions(); | ||
@@ -95,6 +95,6 @@ replCliOpts = { | ||
} | ||
ref1 = opts["arguments"]; | ||
ref = opts["arguments"]; | ||
results = []; | ||
for (i = 0, len = ref1.length; i < len; i++) { | ||
source = ref1[i]; | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
source = ref[i]; | ||
source = path.resolve(source); | ||
@@ -110,3 +110,3 @@ results.push(compilePath(source, true, source)); | ||
if (match = module.match(/^(.*)=(.*)$/)) { | ||
_ = match[0], name = match[1], module = match[2]; | ||
[_, name, module] = match; | ||
} | ||
@@ -185,6 +185,6 @@ name || (name = helpers.baseFileName(module, true, useWinPathSep)); | ||
findDirectoryIndex = function(source) { | ||
var err, ext, i, index, len, ref1; | ||
ref1 = CoffeeScript.FILE_EXTENSIONS; | ||
for (i = 0, len = ref1.length; i < len; i++) { | ||
ext = ref1[i]; | ||
var err, ext, i, index, len, ref; | ||
ref = CoffeeScript.FILE_EXTENSIONS; | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
ext = ref[i]; | ||
index = path.join(source, `index${ext}`); | ||
@@ -211,7 +211,3 @@ try { | ||
try { | ||
t = task = { | ||
file: file, | ||
input: input, | ||
options: options | ||
}; | ||
t = task = {file, input, options}; | ||
CoffeeScript.emit('compile', task); | ||
@@ -434,3 +430,3 @@ if (o.tokens) { | ||
silentUnlink = function(path) { | ||
var err, ref1; | ||
var err, ref; | ||
try { | ||
@@ -440,3 +436,3 @@ return fs.unlinkSync(path); | ||
err = error; | ||
if ((ref1 = err.code) !== 'ENOENT' && ref1 !== 'EPERM') { | ||
if ((ref = err.code) !== 'ENOENT' && ref !== 'EPERM') { | ||
throw err; | ||
@@ -557,3 +553,3 @@ } | ||
answer = { | ||
filename: filename, | ||
filename, | ||
literate: opts.literate || helpers.isLiterate(filename), | ||
@@ -571,3 +567,3 @@ bare: opts.bare, | ||
answer = helpers.merge(answer, { | ||
jsPath: jsPath, | ||
jsPath, | ||
sourceRoot: path.relative(jsDir, cwd), | ||
@@ -574,0 +570,0 @@ sourceFiles: [path.relative(cwd, filename)], |
@@ -1,6 +0,6 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(function() { | ||
var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap; | ||
Parser = require('jison').Parser; | ||
({Parser} = require('jison')); | ||
@@ -413,2 +413,4 @@ unwrap = /^function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/; | ||
return new ExportSpecifier(new Literal($1)); | ||
}), o('DEFAULT AS Identifier', function() { | ||
return new ExportSpecifier(new Literal($1), $3); | ||
}) | ||
@@ -415,0 +417,0 @@ ], |
@@ -1,6 +0,6 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(function() { | ||
var buildLocationData, extend, flatten, marked, ref, repeat, syntaxErrorToString; | ||
var buildLocationData, extend, flatten, md, ref, repeat, syntaxErrorToString; | ||
marked = require('marked'); | ||
md = require('markdown-it')(); | ||
@@ -31,6 +31,6 @@ exports.starts = function(string, literal, start) { | ||
exports.compact = function(array) { | ||
var i, item, len1, results; | ||
var item, j, len1, results; | ||
results = []; | ||
for (i = 0, len1 = array.length; i < len1; i++) { | ||
item = array[i]; | ||
for (j = 0, len1 = array.length; j < len1; j++) { | ||
item = array[j]; | ||
if (item) { | ||
@@ -69,6 +69,6 @@ results.push(item); | ||
exports.flatten = flatten = function(array) { | ||
var element, flattened, i, len1; | ||
var element, flattened, j, len1; | ||
flattened = []; | ||
for (i = 0, len1 = array.length; i < len1; i++) { | ||
element = array[i]; | ||
for (j = 0, len1 = array.length; j < len1; j++) { | ||
element = array[j]; | ||
if ('[object Array]' === Object.prototype.toString.call(element)) { | ||
@@ -91,6 +91,6 @@ flattened = flattened.concat(flatten(element)); | ||
exports.some = (ref = Array.prototype.some) != null ? ref : function(fn) { | ||
var e, i, len1, ref1; | ||
var e, j, len1, ref1; | ||
ref1 = this; | ||
for (i = 0, len1 = ref1.length; i < len1; i++) { | ||
e = ref1[i]; | ||
for (j = 0, len1 = ref1.length; j < len1; j++) { | ||
e = ref1[j]; | ||
if (fn(e)) { | ||
@@ -104,20 +104,19 @@ return true; | ||
exports.invertLiterate = function(code) { | ||
var generateRandomToken, i, item, len1, out, ref1, token; | ||
generateRandomToken = function() { | ||
return `${Math.random() * Date.now()}`; | ||
var out; | ||
out = []; | ||
md.renderer.rules = { | ||
code_block: function(tokens, idx, options, env, slf) { | ||
var i, j, len1, line, lines, results, startLine; | ||
startLine = tokens[idx].map[0]; | ||
lines = tokens[idx].content.split('\n'); | ||
results = []; | ||
for (i = j = 0, len1 = lines.length; j < len1; i = ++j) { | ||
line = lines[i]; | ||
results.push(out[startLine + i] = line); | ||
} | ||
return results; | ||
} | ||
}; | ||
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`; | ||
} | ||
} | ||
out.replace(token, "\t"); | ||
return out; | ||
md.render(code); | ||
return out.join('\n'); | ||
}; | ||
@@ -204,7 +203,7 @@ | ||
syntaxErrorToString = function() { | ||
var codeLine, colorize, colorsEnabled, end, filename, first_column, first_line, last_column, last_line, marker, ref1, ref2, ref3, ref4, start; | ||
var codeLine, colorize, colorsEnabled, end, filename, first_column, first_line, last_column, last_line, marker, ref1, ref2, ref3, start; | ||
if (!(this.code && this.location)) { | ||
return Error.prototype.toString.call(this); | ||
} | ||
ref1 = this.location, first_line = ref1.first_line, first_column = ref1.first_column, last_line = ref1.last_line, last_column = ref1.last_column; | ||
({first_line, first_column, last_line, last_column} = this.location); | ||
if (last_line == null) { | ||
@@ -222,5 +221,5 @@ last_line = first_line; | ||
if (typeof process !== "undefined" && process !== null) { | ||
colorsEnabled = ((ref2 = process.stdout) != null ? ref2.isTTY : void 0) && !((ref3 = process.env) != null ? ref3.NODE_DISABLE_COLORS : void 0); | ||
colorsEnabled = ((ref1 = process.stdout) != null ? ref1.isTTY : void 0) && !((ref2 = process.env) != null ? ref2.NODE_DISABLE_COLORS : void 0); | ||
} | ||
if ((ref4 = this.colorful) != null ? ref4 : colorsEnabled) { | ||
if ((ref3 = this.colorful) != null ? ref3 : colorsEnabled) { | ||
colorize = function(str) { | ||
@@ -227,0 +226,0 @@ return `\x1B[1;31m${str}\x1B[0m`; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var key, ref, val; |
@@ -1,13 +0,13 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(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, | ||
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, 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, REGEX_INVALID_ESCAPE, RELATION, RESERVED, Rewriter, SHIFT, SIMPLE_STRING_OMIT, STRICT_PROSCRIBED, STRING_DOUBLE, STRING_INVALID_ESCAPE, STRING_OMIT, STRING_SINGLE, STRING_START, TRAILING_BLANK_LINE, TRAILING_SPACES, UNARY, UNARY_MATH, VALID_FLAGS, WHITESPACE, compact, count, invertLiterate, isForFrom, isUnassignable, key, locationDataToString, 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; }; | ||
ref = require('./rewriter'), Rewriter = ref.Rewriter, INVERSES = ref.INVERSES; | ||
({Rewriter, INVERSES} = require('./rewriter')); | ||
ref1 = require('./helpers'), count = ref1.count, starts = ref1.starts, compact = ref1.compact, repeat = ref1.repeat, invertLiterate = ref1.invertLiterate, locationDataToString = ref1.locationDataToString, throwSyntaxError = ref1.throwSyntaxError; | ||
({count, starts, compact, repeat, invertLiterate, locationDataToString, throwSyntaxError} = require('./helpers')); | ||
exports.Lexer = Lexer = class Lexer { | ||
tokenize(code, opts = {}) { | ||
var consumed, end, i, ref2; | ||
var consumed, end, i; | ||
this.literate = opts.literate; | ||
@@ -25,2 +25,3 @@ this.indent = 0; | ||
this.seenExport = false; | ||
this.importSpecifierList = false; | ||
this.exportSpecifierList = false; | ||
@@ -33,3 +34,3 @@ this.chunkLine = opts.line || 0; | ||
consumed = this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken(); | ||
ref2 = this.getLineAndColumnFromChunk(consumed), this.chunkLine = ref2[0], this.chunkColumn = ref2[1]; | ||
[this.chunkLine, this.chunkColumn] = this.getLineAndColumnFromChunk(consumed); | ||
i += consumed; | ||
@@ -69,7 +70,7 @@ if (opts.untilBalanced && this.ends.length === 0) { | ||
identifierToken() { | ||
var alias, colon, colonOffset, id, idLength, input, match, poppedToken, prev, ref2, ref3, ref4, ref5, ref6, ref7, tag, tagToken; | ||
var alias, colon, colonOffset, id, idLength, input, match, poppedToken, prev, prevprev, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, tag, tagToken; | ||
if (!(match = IDENTIFIER.exec(this.chunk))) { | ||
return 0; | ||
} | ||
input = match[0], id = match[1], colon = match[2]; | ||
[input, id, colon] = match; | ||
idLength = id.length; | ||
@@ -88,6 +89,6 @@ poppedToken = void 0; | ||
this.tokens[this.tokens.length - 1][0] = 'IMPORT_ALL'; | ||
} else if (ref2 = this.value(), indexOf.call(COFFEE_KEYWORDS, ref2) >= 0) { | ||
} else if (ref = this.value(), indexOf.call(COFFEE_KEYWORDS, ref) >= 0) { | ||
this.tokens[this.tokens.length - 1][0] = 'IDENTIFIER'; | ||
} | ||
if ((ref3 = this.tag()) === 'DEFAULT' || ref3 === 'IMPORT_ALL' || ref3 === 'IDENTIFIER') { | ||
if ((ref1 = this.tag()) === 'DEFAULT' || ref1 === 'IMPORT_ALL' || ref1 === 'IDENTIFIER') { | ||
this.token('AS', id); | ||
@@ -97,15 +98,15 @@ return id.length; | ||
} | ||
if (id === 'as' && this.seenExport && this.tag() === 'IDENTIFIER') { | ||
if (id === 'as' && this.seenExport && ((ref2 = this.tag()) === 'IDENTIFIER' || ref2 === 'DEFAULT')) { | ||
this.token('AS', id); | ||
return id.length; | ||
} | ||
if (id === 'default' && this.seenExport) { | ||
if (id === 'default' && this.seenExport && ((ref3 = this.tag()) === 'EXPORT' || ref3 === 'AS')) { | ||
this.token('DEFAULT', id); | ||
return id.length; | ||
} | ||
ref4 = this.tokens, prev = ref4[ref4.length - 1]; | ||
tag = colon || (prev != null) && (((ref5 = prev[0]) === '.' || ref5 === '?.' || ref5 === '::' || ref5 === '?::') || !prev.spaced && prev[0] === '@') ? 'PROPERTY' : 'IDENTIFIER'; | ||
prev = this.prev(); | ||
tag = colon || (prev != null) && (((ref4 = prev[0]) === '.' || ref4 === '?.' || ref4 === '::' || ref4 === '?::') || !prev.spaced && prev[0] === '@') ? 'PROPERTY' : 'IDENTIFIER'; | ||
if (tag === 'IDENTIFIER' && (indexOf.call(JS_KEYWORDS, id) >= 0 || indexOf.call(COFFEE_KEYWORDS, id) >= 0) && !(this.exportSpecifierList && indexOf.call(COFFEE_KEYWORDS, id) >= 0)) { | ||
tag = id.toUpperCase(); | ||
if (tag === 'WHEN' && (ref6 = this.tag(), indexOf.call(LINE_BREAK, ref6) >= 0)) { | ||
if (tag === 'WHEN' && (ref5 = this.tag(), indexOf.call(LINE_BREAK, ref5) >= 0)) { | ||
tag = 'LEADING_WHEN'; | ||
@@ -137,2 +138,11 @@ } else if (tag === 'FOR') { | ||
this.seenFor = false; | ||
} else if (tag === 'PROPERTY' && prev) { | ||
if (prev.spaced && (ref6 = prev[0], indexOf.call(CALLABLE, ref6) >= 0) && /^[gs]et$/.test(prev[1])) { | ||
this.error(`'${prev[1]}' cannot be used as a keyword, or as a function call without parentheses`, prev[2]); | ||
} else { | ||
prevprev = this.tokens[this.tokens.length - 2]; | ||
if (((ref7 = prev[0]) === '@' || ref7 === 'THIS') && prevprev && prevprev.spaced && /^[gs]et$/.test(prevprev[1])) { | ||
this.error(`'${prevprev[1]}' cannot be used as a keyword, or as a function call without parentheses`, prevprev[2]); | ||
} | ||
} | ||
} | ||
@@ -176,3 +186,3 @@ if (tag === 'IDENTIFIER' && indexOf.call(RESERVED, id) >= 0) { | ||
if (poppedToken) { | ||
ref7 = [poppedToken[2].first_line, poppedToken[2].first_column], tagToken[2].first_line = ref7[0], tagToken[2].first_column = ref7[1]; | ||
[tagToken[2].first_line, tagToken[2].first_column] = [poppedToken[2].first_line, poppedToken[2].first_column]; | ||
} | ||
@@ -233,9 +243,10 @@ if (colon) { | ||
stringToken() { | ||
var $, attempt, delimiter, doc, end, heredoc, i, indent, indentRegex, match, quote, ref2, ref3, regex, token, tokens; | ||
quote = (STRING_START.exec(this.chunk) || [])[0]; | ||
var $, attempt, delimiter, doc, end, heredoc, i, indent, indentRegex, match, prev, quote, ref, regex, token, tokens; | ||
[quote] = STRING_START.exec(this.chunk) || []; | ||
if (!quote) { | ||
return 0; | ||
} | ||
if (this.tokens.length && this.value() === 'from' && (this.seenImport || this.seenExport)) { | ||
this.tokens[this.tokens.length - 1][0] = 'FROM'; | ||
prev = this.prev(); | ||
if (prev && this.value() === 'from' && (this.seenImport || this.seenExport)) { | ||
prev[0] = 'FROM'; | ||
} | ||
@@ -255,3 +266,6 @@ regex = (function() { | ||
heredoc = quote.length === 3; | ||
ref2 = this.matchWithInterpolations(regex, quote), tokens = ref2.tokens, end = ref2.index; | ||
({ | ||
tokens, | ||
index: end | ||
} = this.matchWithInterpolations(regex, quote)); | ||
$ = tokens.length - 1; | ||
@@ -274,3 +288,3 @@ delimiter = quote.charAt(0); | ||
attempt = match[1]; | ||
if (indent === null || (0 < (ref3 = attempt.length) && ref3 < indent.length)) { | ||
if (indent === null || (0 < (ref = attempt.length) && ref < indent.length)) { | ||
indent = attempt; | ||
@@ -282,5 +296,3 @@ } | ||
} | ||
this.mergeInterpolationTokens(tokens, { | ||
delimiter: delimiter | ||
}, (value, i) => { | ||
this.mergeInterpolationTokens(tokens, {delimiter}, (value, i) => { | ||
value = this.formatString(value); | ||
@@ -299,5 +311,3 @@ if (indentRegex) { | ||
} else { | ||
this.mergeInterpolationTokens(tokens, { | ||
delimiter: delimiter | ||
}, (value, i) => { | ||
this.mergeInterpolationTokens(tokens, {delimiter}, (value, i) => { | ||
value = this.formatString(value); | ||
@@ -322,3 +332,3 @@ value = value.replace(SIMPLE_STRING_OMIT, function(match, offset) { | ||
} | ||
comment = match[0], here = match[1]; | ||
[comment, here] = match; | ||
if (here) { | ||
@@ -352,3 +362,3 @@ if (match = HERECOMMENT_ILLEGAL.exec(comment)) { | ||
regexToken() { | ||
var body, closed, end, flags, index, match, origin, prev, ref2, ref3, ref4, regex, tokens; | ||
var body, closed, end, flags, index, match, origin, prev, ref, ref1, regex, tokens; | ||
switch (false) { | ||
@@ -361,6 +371,6 @@ case !(match = REGEX_ILLEGAL.exec(this.chunk)): | ||
case !(match = this.matchWithInterpolations(HEREGEX, '///')): | ||
tokens = match.tokens, index = match.index; | ||
({tokens, index} = match); | ||
break; | ||
case !(match = REGEX.exec(this.chunk)): | ||
regex = match[0], body = match[1], closed = match[2]; | ||
[regex, body, closed] = match; | ||
this.validateEscapes(body, { | ||
@@ -371,9 +381,9 @@ isRegex: true, | ||
index = regex.length; | ||
ref2 = this.tokens, prev = ref2[ref2.length - 1]; | ||
prev = this.prev(); | ||
if (prev) { | ||
if (prev.spaced && (ref3 = prev[0], indexOf.call(CALLABLE, ref3) >= 0)) { | ||
if (prev.spaced && (ref = prev[0], indexOf.call(CALLABLE, ref) >= 0)) { | ||
if (!closed || POSSIBLY_DIVISION.test(regex)) { | ||
return 0; | ||
} | ||
} else if (ref4 = prev[0], indexOf.call(NOT_REGEX, ref4) >= 0) { | ||
} else if (ref1 = prev[0], indexOf.call(NOT_REGEX, ref1) >= 0) { | ||
return 0; | ||
@@ -389,3 +399,3 @@ } | ||
} | ||
flags = REGEX_FLAGS.exec(this.chunk.slice(index))[0]; | ||
[flags] = REGEX_FLAGS.exec(this.chunk.slice(index)); | ||
end = index + flags.length; | ||
@@ -433,2 +443,8 @@ origin = this.makeToken('REGEX', null, 0, end); | ||
this.seenFor = false; | ||
if (!this.importSpecifierList) { | ||
this.seenImport = false; | ||
} | ||
if (!this.exportSpecifierList) { | ||
this.seenExport = false; | ||
} | ||
size = indent.length - 1 - indent.lastIndexOf('\n'); | ||
@@ -490,3 +506,3 @@ noNewlines = this.unfinished(); | ||
outdentToken(moveOut, noNewlines, outdentLength) { | ||
var decreasedIndent, dent, lastIndent, ref2; | ||
var decreasedIndent, dent, lastIndent, ref; | ||
decreasedIndent = this.indent - moveOut; | ||
@@ -497,11 +513,8 @@ while (moveOut > 0) { | ||
moveOut = 0; | ||
} else if (lastIndent === this.outdebt) { | ||
moveOut -= this.outdebt; | ||
this.outdebt = 0; | ||
} else if (lastIndent < this.outdebt) { | ||
this.outdebt -= lastIndent; | ||
moveOut -= lastIndent; | ||
} else if (this.outdebt && moveOut <= this.outdebt) { | ||
this.outdebt -= moveOut; | ||
moveOut = 0; | ||
} else { | ||
dent = this.indents.pop() + this.outdebt; | ||
if (outdentLength && (ref2 = this.chunk[outdentLength], indexOf.call(INDENTABLE_CLOSERS, ref2) >= 0)) { | ||
if (outdentLength && (ref = this.chunk[outdentLength], indexOf.call(INDENTABLE_CLOSERS, ref) >= 0)) { | ||
decreasedIndent -= dent - moveOut; | ||
@@ -531,7 +544,7 @@ moveOut = dent; | ||
whitespaceToken() { | ||
var match, nline, prev, ref2; | ||
var match, nline, prev; | ||
if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) { | ||
return 0; | ||
} | ||
ref2 = this.tokens, prev = ref2[ref2.length - 1]; | ||
prev = this.prev(); | ||
if (prev) { | ||
@@ -565,5 +578,5 @@ prev[match ? 'spaced' : 'newLine'] = true; | ||
literalToken() { | ||
var match, message, origin, prev, ref2, ref3, ref4, ref5, ref6, skipToken, tag, token, value; | ||
var match, message, origin, prev, ref, ref1, ref2, ref3, skipToken, tag, token, value; | ||
if (match = OPERATOR.exec(this.chunk)) { | ||
value = match[0]; | ||
[value] = match; | ||
if (CODE.test(value)) { | ||
@@ -576,6 +589,6 @@ this.tagParameters(); | ||
tag = value; | ||
ref2 = this.tokens, prev = ref2[ref2.length - 1]; | ||
prev = this.prev(); | ||
if (prev && indexOf.call(['=', ...COMPOUND_ASSIGN], value) >= 0) { | ||
skipToken = false; | ||
if (value === '=' && ((ref3 = prev[1]) === '||' || ref3 === '&&') && !prev.spaced) { | ||
if (value === '=' && ((ref = prev[1]) === '||' || ref === '&&') && !prev.spaced) { | ||
prev[0] = 'COMPOUND_ASSIGN'; | ||
@@ -587,3 +600,3 @@ prev[1] += '='; | ||
if (prev && prev[0] !== 'PROPERTY') { | ||
origin = (ref4 = prev.origin) != null ? ref4 : prev; | ||
origin = (ref1 = prev.origin) != null ? ref1 : prev; | ||
message = isUnassignable(prev[1], origin[1]); | ||
@@ -598,3 +611,7 @@ if (message) { | ||
} | ||
if (value === '{' && (prev != null ? prev[0] : void 0) === 'EXPORT') { | ||
if (value === '{' && this.seenImport) { | ||
this.importSpecifierList = true; | ||
} else if (this.importSpecifierList && value === '}') { | ||
this.importSpecifierList = false; | ||
} else if (value === '{' && (prev != null ? prev[0] : void 0) === 'EXPORT') { | ||
this.exportSpecifierList = true; | ||
@@ -624,3 +641,3 @@ } else if (this.exportSpecifierList && value === '}') { | ||
} else if (prev && !prev.spaced) { | ||
if (value === '(' && (ref5 = prev[0], indexOf.call(CALLABLE, ref5) >= 0)) { | ||
if (value === '(' && (ref2 = prev[0], indexOf.call(CALLABLE, ref2) >= 0)) { | ||
if (prev[0] === '?') { | ||
@@ -630,3 +647,3 @@ prev[0] = 'FUNC_EXIST'; | ||
tag = 'CALL_START'; | ||
} else if (value === '[' && (ref6 = prev[0], indexOf.call(INDEXABLE, ref6) >= 0)) { | ||
} else if (value === '[' && (ref3 = prev[0], indexOf.call(INDEXABLE, ref3) >= 0)) { | ||
tag = 'INDEX_START'; | ||
@@ -664,3 +681,3 @@ switch (prev[0]) { | ||
stack = []; | ||
tokens = this.tokens; | ||
({tokens} = this); | ||
i = tokens.length; | ||
@@ -693,3 +710,3 @@ tokens[--i][0] = 'PARAM_END'; | ||
matchWithInterpolations(regex, delimiter) { | ||
var close, column, firstToken, index, lastToken, line, nested, offsetInChunk, open, ref2, ref3, ref4, str, strPart, tokens; | ||
var close, column, firstToken, index, lastToken, line, nested, offsetInChunk, open, ref, str, strPart, tokens; | ||
tokens = []; | ||
@@ -702,6 +719,6 @@ offsetInChunk = delimiter.length; | ||
while (true) { | ||
strPart = regex.exec(str)[0]; | ||
[strPart] = regex.exec(str); | ||
this.validateEscapes(strPart, { | ||
isRegex: delimiter.charAt(0) === '/', | ||
offsetInChunk: offsetInChunk | ||
offsetInChunk | ||
}); | ||
@@ -714,8 +731,11 @@ tokens.push(this.makeToken('NEOSTRING', strPart, offsetInChunk)); | ||
} | ||
ref2 = this.getLineAndColumnFromChunk(offsetInChunk + 1), line = ref2[0], column = ref2[1]; | ||
ref3 = new Lexer().tokenize(str.slice(1), { | ||
[line, column] = this.getLineAndColumnFromChunk(offsetInChunk + 1); | ||
({ | ||
tokens: nested, | ||
index | ||
} = new Lexer().tokenize(str.slice(1), { | ||
line: line, | ||
column: column, | ||
untilBalanced: true | ||
}), nested = ref3.tokens, index = ref3.index; | ||
})); | ||
index += 1; | ||
@@ -726,3 +746,3 @@ open = nested[0], close = nested[nested.length - 1]; | ||
close.origin = ['', 'end of interpolation', close[2]]; | ||
if (((ref4 = nested[1]) != null ? ref4[0] : void 0) === 'TERMINATOR') { | ||
if (((ref = nested[1]) != null ? ref[0] : void 0) === 'TERMINATOR') { | ||
nested.splice(1, 1); | ||
@@ -751,3 +771,3 @@ } | ||
return { | ||
tokens: tokens, | ||
tokens, | ||
index: offsetInChunk + delimiter.length | ||
@@ -765,3 +785,3 @@ }; | ||
token = tokens[i]; | ||
tag = token[0], value = token[1]; | ||
[tag, value] = token; | ||
switch (tag) { | ||
@@ -824,4 +844,4 @@ case 'TOKENS': | ||
pair(tag) { | ||
var lastIndent, prev, ref2, ref3, wanted; | ||
ref2 = this.ends, prev = ref2[ref2.length - 1]; | ||
var lastIndent, prev, ref, ref1, wanted; | ||
ref = this.ends, prev = ref[ref.length - 1]; | ||
if (tag !== (wanted = prev != null ? prev.tag : void 0)) { | ||
@@ -831,3 +851,3 @@ if ('OUTDENT' !== wanted) { | ||
} | ||
ref3 = this.indents, lastIndent = ref3[ref3.length - 1]; | ||
ref1 = this.indents, lastIndent = ref1[ref1.length - 1]; | ||
this.outdentToken(lastIndent, true); | ||
@@ -840,3 +860,3 @@ return this.pair(tag); | ||
getLineAndColumnFromChunk(offset) { | ||
var column, lastLine, lineCount, ref2, string; | ||
var column, lastLine, lineCount, ref, string; | ||
if (offset === 0) { | ||
@@ -853,3 +873,3 @@ return [this.chunkLine, this.chunkColumn]; | ||
if (lineCount > 0) { | ||
ref2 = string.split('\n'), lastLine = ref2[ref2.length - 1]; | ||
ref = string.split('\n'), lastLine = ref[ref.length - 1]; | ||
column = lastLine.length; | ||
@@ -863,7 +883,7 @@ } else { | ||
makeToken(tag, value, offsetInChunk = 0, length = value.length) { | ||
var lastCharacter, locationData, ref2, ref3, token; | ||
var lastCharacter, locationData, token; | ||
locationData = {}; | ||
ref2 = this.getLineAndColumnFromChunk(offsetInChunk), locationData.first_line = ref2[0], locationData.first_column = ref2[1]; | ||
[locationData.first_line, locationData.first_column] = this.getLineAndColumnFromChunk(offsetInChunk); | ||
lastCharacter = length > 0 ? length - 1 : 0; | ||
ref3 = this.getLineAndColumnFromChunk(offsetInChunk + lastCharacter), locationData.last_line = ref3[0], locationData.last_column = ref3[1]; | ||
[locationData.last_line, locationData.last_column] = this.getLineAndColumnFromChunk(offsetInChunk + lastCharacter); | ||
token = [tag, value, locationData]; | ||
@@ -884,4 +904,4 @@ return token; | ||
tag() { | ||
var ref2, token; | ||
ref2 = this.tokens, token = ref2[ref2.length - 1]; | ||
var ref, token; | ||
ref = this.tokens, token = ref[ref.length - 1]; | ||
return token != null ? token[0] : void 0; | ||
@@ -891,10 +911,14 @@ } | ||
value() { | ||
var ref2, token; | ||
ref2 = this.tokens, token = ref2[ref2.length - 1]; | ||
var ref, token; | ||
ref = this.tokens, token = ref[ref.length - 1]; | ||
return token != null ? token[1] : void 0; | ||
} | ||
prev() { | ||
return this.tokens[this.tokens.length - 1]; | ||
} | ||
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'); | ||
var ref; | ||
return LINE_CONTINUER.test(this.chunk) || ((ref = this.tag()) === '\\' || ref === '.' || ref === '?.' || ref === '?::' || ref === 'UNARY' || ref === 'MATH' || ref === 'UNARY_MATH' || ref === '+' || ref === '-' || ref === '**' || ref === 'SHIFT' || ref === 'RELATION' || ref === 'COMPARE' || ref === '&' || ref === '^' || ref === '|' || ref === '&&' || ref === '||' || ref === 'BIN?' || ref === 'THROW' || ref === 'EXTENDS'); | ||
} | ||
@@ -911,4 +935,5 @@ | ||
validateEscapes(str, options = {}) { | ||
var before, hex, invalidEscape, match, message, octal, ref2, unicode; | ||
match = INVALID_ESCAPE.exec(str); | ||
var before, hex, invalidEscape, invalidEscapeRegex, match, message, octal, ref, unicode; | ||
invalidEscapeRegex = options.isRegex ? REGEX_INVALID_ESCAPE : STRING_INVALID_ESCAPE; | ||
match = invalidEscapeRegex.exec(str); | ||
if (!match) { | ||
@@ -918,9 +943,6 @@ return; | ||
match[0], before = match[1], octal = match[2], hex = match[3], unicode = match[4]; | ||
if (options.isRegex && octal && octal.charAt(0) !== '0') { | ||
return; | ||
} | ||
message = octal ? "octal escape sequences are not allowed" : "invalid escape sequence"; | ||
invalidEscape = `\\${octal || hex || unicode}`; | ||
return this.error(`${message} ${invalidEscape}`, { | ||
offset: ((ref2 = options.offsetInChunk) != null ? ref2 : 0) + match.index + before.length, | ||
offset: ((ref = options.offsetInChunk) != null ? ref : 0) + match.index + before.length, | ||
length: invalidEscape.length | ||
@@ -968,7 +990,7 @@ }); | ||
error(message, options = {}) { | ||
var first_column, first_line, location, ref2, ref3, ref4; | ||
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 | ||
var first_column, first_line, location, ref, ref1; | ||
location = 'first_line' in options ? options : ([first_line, first_column] = this.getLineAndColumnFromChunk((ref = options.offset) != null ? ref : 0), { | ||
first_line, | ||
first_column, | ||
last_column: first_column + ((ref1 = options.length) != null ? ref1 : 1) - 1 | ||
}); | ||
@@ -996,3 +1018,3 @@ return throwSyntaxError(message, location); | ||
isForFrom = function(prev) { | ||
var ref2; | ||
var ref; | ||
if (prev[0] === 'IDENTIFIER') { | ||
@@ -1006,3 +1028,3 @@ if (prev[1] === 'from') { | ||
return false; | ||
} else if ((ref2 = prev[1]) === '{' || ref2 === '[' || ref2 === ',' || ref2 === ':') { | ||
} else if ((ref = prev[1]) === '{' || ref === '[' || ref === ',' || ref === ':') { | ||
return false; | ||
@@ -1101,4 +1123,6 @@ } else { | ||
INVALID_ESCAPE = /((?:^|[^\\])(?:\\\\)*)\\(?:(0[0-7]|[1-7])|(x(?![\da-fA-F]{2}).{0,2})|(u(?![\da-fA-F]{4}).{0,4}))/; | ||
STRING_INVALID_ESCAPE = /((?:^|[^\\])(?:\\\\)*)\\(?:(0[0-7]|[1-7])|(x(?![\da-fA-F]{2}).{0,2})|(u(?![\da-fA-F]{4}).{0,4}))/; | ||
REGEX_INVALID_ESCAPE = /((?:^|[^\\])(?:\\\\)*)\\(?:(0[0-7])|(x(?![\da-fA-F]{2}).{0,2})|(u(?![\da-fA-F]{4}).{0,4}))/; | ||
LEADING_BLANK_LINE = /^[^\n\S]*\n/; | ||
@@ -1105,0 +1129,0 @@ |
@@ -1,6 +0,6 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(function() { | ||
var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments, repeat; | ||
repeat = require('./helpers').repeat; | ||
({repeat} = require('./helpers')); | ||
@@ -7,0 +7,0 @@ exports.OptionParser = OptionParser = class OptionParser { |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(function() { | ||
@@ -51,3 +51,3 @@ var CoffeeScript, Module, binary, child_process, ext, findExtension, fork, helpers, i, len, loadFile, path, ref; | ||
if (child_process) { | ||
fork = child_process.fork; | ||
({fork} = child_process); | ||
binary = require.resolve('../../bin/coffee'); | ||
@@ -54,0 +54,0 @@ child_process.fork = function(path, args, options) { |
@@ -1,4 +0,4 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(function() { | ||
var CoffeeScript, addHistory, addMultilineHandler, fs, getCommandId, merge, nodeREPL, path, ref, replDefaults, runInContext, updateSyntaxError, vm; | ||
var CoffeeScript, addHistory, addMultilineHandler, fs, getCommandId, merge, nodeREPL, path, replDefaults, runInContext, updateSyntaxError, vm; | ||
@@ -15,3 +15,3 @@ fs = require('fs'); | ||
ref = require('./helpers'), merge = ref.merge, updateSyntaxError = ref.updateSyntaxError; | ||
({merge, updateSyntaxError} = require('./helpers')); | ||
@@ -23,7 +23,7 @@ replDefaults = { | ||
"eval": function(input, context, filename, cb) { | ||
var Assign, Block, Literal, Value, ast, err, js, ref1, referencedVars, token, tokens; | ||
var Assign, Block, Literal, Value, ast, err, js, referencedVars, token, tokens; | ||
input = input.replace(/\uFF00/g, '\n'); | ||
input = input.replace(/^\(([\s\S]*)\n\)$/m, '$1'); | ||
input = input.replace(/^\s*try\s*{([\s\S]*)}\s*catch.*$/m, '$1'); | ||
ref1 = require('./nodes'), Block = ref1.Block, Assign = ref1.Assign, Value = ref1.Value, Literal = ref1.Literal; | ||
({Block, Assign, Value, Literal} = require('./nodes')); | ||
try { | ||
@@ -47,3 +47,3 @@ tokens = CoffeeScript.tokens(input); | ||
locals: Object.keys(context), | ||
referencedVars: referencedVars | ||
referencedVars | ||
}); | ||
@@ -68,5 +68,5 @@ return cb(null, runInContext(js, context, filename)); | ||
addMultilineHandler = function(repl) { | ||
var inputStream, multiline, nodeLineListener, origPrompt, outputStream, ref1, rli; | ||
rli = repl.rli, inputStream = repl.inputStream, outputStream = repl.outputStream; | ||
origPrompt = (ref1 = repl._prompt) != null ? ref1 : repl.prompt; | ||
var inputStream, multiline, nodeLineListener, origPrompt, outputStream, ref, rli; | ||
({rli, inputStream, outputStream} = repl); | ||
origPrompt = (ref = repl._prompt) != null ? ref : repl.prompt; | ||
multiline = { | ||
@@ -175,6 +175,6 @@ enabled: false, | ||
start: function(opts = {}) { | ||
var build, major, minor, ref1, repl; | ||
ref1 = process.versions.node.split('.').map(function(n) { | ||
var build, major, minor, repl; | ||
[major, minor, build] = process.versions.node.split('.').map(function(n) { | ||
return parseInt(n); | ||
}), major = ref1[0], minor = ref1[1], build = ref1[2]; | ||
}); | ||
if (major < 6) { | ||
@@ -181,0 +181,0 @@ console.warn("Node 6+ required for CoffeeScript REPL"); |
@@ -1,4 +0,4 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(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, | ||
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, 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; }; | ||
@@ -33,3 +33,3 @@ | ||
var i, token, tokens; | ||
tokens = this.tokens; | ||
({tokens} = this); | ||
i = 0; | ||
@@ -44,3 +44,3 @@ while (token = tokens[i]) { | ||
var levels, ref, ref1, token, tokens; | ||
tokens = this.tokens; | ||
({tokens} = this); | ||
levels = 0; | ||
@@ -68,3 +68,3 @@ while (token = tokens[i]) { | ||
for (i = k = 0, len = ref.length; k < len; i = ++k) { | ||
tag = ref[i][0]; | ||
[tag] = ref[i]; | ||
if (tag !== 'TERMINATOR') { | ||
@@ -174,6 +174,6 @@ break; | ||
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]; | ||
var endImplicitCall, endImplicitObject, forward, inImplicit, inImplicitCall, inImplicitControl, inImplicitObject, newLine, nextTag, offset, prevTag, prevToken, ref, ref1, ref2, s, sameLine, stackIdx, stackTag, stackTop, startIdx, startImplicitCall, startImplicitObject, startsLine, tag; | ||
[tag] = token; | ||
[prevTag] = prevToken = i > 0 ? tokens[i - 1] : []; | ||
[nextTag] = i < tokens.length - 1 ? tokens[i + 1] : []; | ||
stackTop = function() { | ||
@@ -309,3 +309,3 @@ return stack[stack.length - 1]; | ||
if (stackTop()) { | ||
ref3 = stackTop(), stackTag = ref3[0], stackIdx = ref3[1]; | ||
[stackTag, stackIdx] = stackTop(); | ||
if ((stackTag === '{' || stackTag === 'INDENT' && this.tag(stackIdx - 1) === '{') && (startsLine || this.tag(s - 1) === ',' || this.tag(s - 1) === '{')) { | ||
@@ -324,3 +324,3 @@ return forward(1); | ||
while (inImplicit()) { | ||
ref4 = stackTop(), stackTag = ref4[0], stackIdx = ref4[1], (ref5 = ref4[2], sameLine = ref5.sameLine, startsLine = ref5.startsLine); | ||
[stackTag, stackIdx, {sameLine, startsLine}] = stackTop(); | ||
if (inImplicitCall() && prevTag !== ',') { | ||
@@ -360,5 +360,11 @@ endImplicitCall(); | ||
if (token[0] === '{' && (nextLocation = (ref = tokens[i + 1]) != null ? ref[2] : void 0)) { | ||
line = nextLocation.first_line, column = nextLocation.first_column; | ||
({ | ||
first_line: line, | ||
first_column: column | ||
} = nextLocation); | ||
} else if (prevLocation = (ref1 = tokens[i - 1]) != null ? ref1[2] : void 0) { | ||
line = prevLocation.last_line, column = prevLocation.last_column; | ||
({ | ||
last_line: line, | ||
last_column: column | ||
} = prevLocation); | ||
} else { | ||
@@ -405,4 +411,4 @@ line = column = 0; | ||
return this.scanTokens(function(token, i, tokens) { | ||
var j, k, ref, ref1, ref2, tag; | ||
tag = token[0]; | ||
var j, k, ref, ref1, tag; | ||
[tag] = token; | ||
if (tag === 'TERMINATOR') { | ||
@@ -429,3 +435,3 @@ if (this.tag(i + 1) === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') { | ||
starter = tag; | ||
ref2 = this.indentation(tokens[i]), indent = ref2[0], outdent = ref2[1]; | ||
[indent, outdent] = this.indentation(tokens[i]); | ||
if (starter === 'THEN') { | ||
@@ -450,4 +456,4 @@ indent.fromThen = true; | ||
var prevTag, tag; | ||
tag = token[0]; | ||
prevTag = this.tokens[i - 1][0]; | ||
[tag] = token; | ||
[prevTag] = this.tokens[i - 1]; | ||
return tag === 'TERMINATOR' || (tag === 'INDENT' && indexOf.call(SINGLE_LINERS, prevTag) < 0); | ||
@@ -505,3 +511,3 @@ }; | ||
for (k = 0, len = BALANCED_PAIRS.length; k < len; k++) { | ||
ref = BALANCED_PAIRS[k], left = ref[0], rite = ref[1]; | ||
[left, rite] = BALANCED_PAIRS[k]; | ||
EXPRESSION_START.push(INVERSES[rite] = left); | ||
@@ -508,0 +514,0 @@ EXPRESSION_END.push(INVERSES[left] = rite); |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(function() { | ||
@@ -33,6 +33,3 @@ var Scope, | ||
} else { | ||
return this.positions[name] = this.variables.push({ | ||
name: name, | ||
type: type | ||
}) - 1; | ||
return this.positions[name] = this.variables.push({name, type}) - 1; | ||
} | ||
@@ -114,3 +111,3 @@ } | ||
this.add(name, { | ||
value: value, | ||
value, | ||
assigned: true | ||
@@ -117,0 +114,0 @@ }, true); |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 2.0.0-alpha1 | ||
// Generated by CoffeeScript 2.0.0-beta1 | ||
(function() { | ||
@@ -11,8 +11,3 @@ var LineMap, SourceMap; | ||
add(column, arg, options) { | ||
var sourceColumn, sourceLine; | ||
sourceLine = arg[0], sourceColumn = arg[1]; | ||
if (options === void 0) { | ||
options = {}; | ||
} | ||
add(column, [sourceLine, sourceColumn], options = {}) { | ||
if (this.columns[column] && options.noReplace) { | ||
@@ -23,5 +18,5 @@ return; | ||
line: this.line, | ||
column: column, | ||
sourceLine: sourceLine, | ||
sourceColumn: sourceColumn | ||
column, | ||
sourceLine, | ||
sourceColumn | ||
}; | ||
@@ -50,3 +45,3 @@ } | ||
var base, column, line, lineMap; | ||
line = generatedLocation[0], column = generatedLocation[1]; | ||
[line, column] = generatedLocation; | ||
lineMap = ((base = this.lines)[line] || (base[line] = new LineMap(line))); | ||
@@ -56,5 +51,4 @@ return lineMap.add(column, sourceLocation, options); | ||
sourceLocation(arg) { | ||
var column, line, lineMap; | ||
line = arg[0], column = arg[1]; | ||
sourceLocation([line, column]) { | ||
var lineMap; | ||
while (!((lineMap = this.lines[line]) || (line <= 0))) { | ||
@@ -61,0 +55,0 @@ line--; |
@@ -11,6 +11,6 @@ { | ||
"author": "Jeremy Ashkenas", | ||
"version": "2.0.0-alpha1", | ||
"version": "2.0.0-beta1", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=7.2.1" | ||
"node": ">=7.6.0" | ||
}, | ||
@@ -44,11 +44,10 @@ "directories": { | ||
"docco": "~0.7.0", | ||
"google-closure-compiler-js": "^20170124.0.0", | ||
"highlight.js": "~9.9.0", | ||
"google-closure-compiler-js": "^20170409.0.0", | ||
"highlight.js": "~9.10.0", | ||
"jison": ">=0.4.17", | ||
"marked": "^0.3.6", | ||
"underscore": "~1.8.3" | ||
}, | ||
"dependencies": { | ||
"marked": "~0.3.6" | ||
"markdown-it": "^8.3.1" | ||
} | ||
} |
@@ -28,3 +28,3 @@ { | ||
```shell | ||
npm install --global coffee-script | ||
npm install --global coffeescript | ||
``` | ||
@@ -31,0 +31,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
404991
0.94%5
-16.67%9294
1.74%4
-20%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed