From 670afd8921d46956cc3d43dd34078c2dc984faf2 Mon Sep 17 00:00:00 2001 From: RabsRincon Date: Tue, 13 Feb 2018 14:49:07 +0100 Subject: [PATCH] Move to ESLint Somewhat compilant! --- .eslintignore | 17 + .eslintrc | 22 + .idea/inspectionProfiles/Project_Default.xml | 1 + .idea/jsDialects.xml | 7 + Makefile | 4 +- app.js | 68 +- etc/jshintrc.client | 9 - etc/jshintrc.server | 8 - lib/asm-cl.js | 19 +- lib/asm.js | 7 +- lib/base-compiler.js | 42 +- lib/cfg.js | 9 +- lib/compilers/Wine-CL.js | 2 +- lib/compilers/assembly.js | 2 +- lib/compilers/fake-for-test.js | 2 +- lib/compilers/golang.js | 4 +- lib/compilers/haskell.js | 2 +- lib/compilers/ispc.js | 2 +- lib/compilers/ldc.js | 2 +- lib/compilers/pascal.js | 4 +- lib/csp.js | 18 +- lib/google.js | 2 +- lib/handlers/asm-docs-api.js | 2 +- lib/handlers/compile.js | 63 +- lib/handlers/health-check.js | 4 +- lib/handlers/source.js | 2 +- lib/logger.js | 4 +- lib/pascal-support.js | 175 ++-- etc/oldhash.txt => oldhash.txt | 2 +- package.json | 2 +- static/.eslintignore | 3 + static/.eslintrc | 28 + static/analytics.js | 5 +- static/ansi-to-html.js | 870 +++++++++---------- static/asm-mode.js | 10 +- static/ast-view.js | 9 +- static/compiler-service.js | 2 +- static/compiler.js | 20 +- static/components.js | 283 +++--- static/conformance-view.js | 17 +- static/d-mode.js | 16 +- static/gccdump-rtl-gimple-mode.js | 509 ++++++----- static/gccdump-view.js | 540 ++++++------ static/haskell-mode.js | 379 +------- static/loadSave.js | 4 +- static/main.js | 2 +- static/monaco-loader.js | 4 +- static/monaco.js | 4 +- static/opt-view.js | 1 - static/pascal-mode.js | 287 +++--- static/rison.js | 2 +- static/rust-mode.js | 12 +- static/sharing.js | 1 + static/themes.js | 1 - static/urlshorten-google.js | 11 +- yarn.lock | 452 +++++++--- 56 files changed, 1939 insertions(+), 2040 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc create mode 100644 .idea/jsDialects.xml delete mode 100644 etc/jshintrc.client delete mode 100644 etc/jshintrc.server rename etc/oldhash.txt => oldhash.txt (98%) create mode 100644 static/.eslintignore create mode 100644 static/.eslintrc diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..8f9669056 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,17 @@ +# Top level js files +app.build.js +webpack.config.js + +# Uninteresting folders for server linting (node_modules ignored by default) +static +test +rust +haskell +examples +etc +docs +d +c-preload + +# Autogenerated files +lib/handlers/asm-docs.js diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 000000000..c7cb24c6a --- /dev/null +++ b/.eslintrc @@ -0,0 +1,22 @@ +// Server code linter config +{ + "root": true, + "extends": "eslint:recommended", + "env": { + "mocha": true, + "node": true, + "es6": true + }, + "rules": { + // The idea is to implement this first 2 warnings slowly into the code, and to eventually enforce them + "max-statements": ["warn", 55], + "max-len": ["warn", 130, { "ignoreRegExpLiterals": true }], + "eol-last": ["error", "always"], + "semi": ["error", "always"], + "indent": ["error", 4, { "SwitchCase": 1 }], + "no-control-regex": 0 + }, + "parserOptions": { + "ecmaVersion": 6 + } +} diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index f3c778abb..46ce21253 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -4,5 +4,6 @@ + \ No newline at end of file diff --git a/.idea/jsDialects.xml b/.idea/jsDialects.xml new file mode 100644 index 000000000..51ca20bed --- /dev/null +++ b/.idea/jsDialects.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Makefile b/Makefile index e04462c17..7b148ff45 100644 --- a/Makefile +++ b/Makefile @@ -64,8 +64,8 @@ webpack: $(NODE) node_modules/webpack/bin/webpack.js ${WEBPACK_ARGS} lint: $(NODE_MODULES) - $(NODE) ./node_modules/.bin/jshint --config etc/jshintrc.server app.js $(shell find lib -name '*.js') - $(NODE) ./node_modules/.bin/jshint --config etc/jshintrc.client $(shell find static -name '*.js' -not -path 'static/dist/*' -not -path static/analytics.js -not -path 'static/vs/*' -not -path 'static/ext/*') + $(NODE) ./node_modules/.bin/eslint --config .eslintrc --ignore-path .eslintignore --fix app.js $(shell find lib -name '*.js' -not -path 'lib/handlers/asm-docs.js') + $(NODE) ./node_modules/.bin/eslint --config static/.eslintrc --ignore-path static/.eslintignore --fix $(shell find static -name '*.js' -not -path 'static/dist/*' -not -path 'static/vs/*' -not -path 'static/ext/*') node_modules: $(NODE_MODULES) webpack: $(WEBPACK) diff --git a/app.js b/app.js index b23cb74af..d03b9fba4 100755 --- a/app.js +++ b/app.js @@ -86,7 +86,6 @@ const env = opts.env || ['dev']; const hostname = opts.host; const port = opts.port || 10240; const staticDir = opts.static || 'static'; -const archivedVersions = opts.archivedVersions; let gitReleaseName = ""; const wantedLanguage = opts.language || null; @@ -189,7 +188,6 @@ function compilerPropsAT(langs, transform, property, defaultValue) { } const staticMaxAgeSecs = ceProps('staticMaxAgeSecs', 0); -const contentPolicy = ceProps('contentPolicy', 'default-src *'); const maxUploadSize = ceProps('maxUploadSize', '1mb'); let extraBodyClass = ceProps('extraBodyClass', ''); @@ -364,40 +362,40 @@ function findCompilers() { function fetchRemote(host, port, props) { logger.info(`Fetching compilers from remote source ${host}:${port}`); return retryPromise(() => { - return new Promise((resolve, reject) => { - let request = http.get({ - hostname: host, - port: port, - path: "/api/compilers", - headers: { - 'Accept': 'application/json' - } - }, res => { - let str = ''; - res.on('data', chunk => { - str += chunk; + return new Promise((resolve, reject) => { + let request = http.get({ + hostname: host, + port: port, + path: "/api/compilers", + headers: { + 'Accept': 'application/json' + } + }, res => { + let str = ''; + res.on('data', chunk => { + str += chunk; + }); + res.on('end', () => { + let compilers = JSON.parse(str).map(compiler => { + compiler.exe = null; + compiler.remote = `http://${host}:${port}`; + return compiler; }); - res.on('end', () => { - let compilers = JSON.parse(str).map(compiler => { - compiler.exe = null; - compiler.remote = `http://${host}:${port}`; - return compiler; - }); - resolve(compilers); - }); - }) - .on('error', reject) - .on('timeout', () => reject("timeout")); - request.setTimeout(awsProps('proxyTimeout', 1000)); - }); - }, - `${host}:${port}`, - props('proxyRetries', 5), - props('proxyRetryMs', 500)) - .catch(() => { - logger.warn(`Unable to contact ${host}:${port}; skipping`); - return []; + resolve(compilers); + }); + }) + .on('error', reject) + .on('timeout', () => reject("timeout")); + request.setTimeout(awsProps('proxyTimeout', 1000)); }); + }, + `${host}:${port}`, + props('proxyRetries', 5), + props('proxyRetryMs', 500) + ).catch(() => { + logger.warn(`Unable to contact ${host}:${port}; skipping`); + return []; + }); } function fetchAws() { @@ -497,7 +495,7 @@ function findCompilers() { if (list.length !== 1) { logger.error(`Compiler ID clash for '${id}' - used by ${ _.map(list, o => `lang:${o.lang} name:${o.name}`).join(', ') - }`); + }`); } }); return compilers; diff --git a/etc/jshintrc.client b/etc/jshintrc.client deleted file mode 100644 index a1108c6a7..000000000 --- a/etc/jshintrc.client +++ /dev/null @@ -1,9 +0,0 @@ -{ - "strict": true, - "undef": true, - "browser": true, - "node": true, - "globals": {"define": false, "monaco": true, "__webpack_public_path__": true}, - "esversion": 5, - "eqeqeq": true -} diff --git a/etc/jshintrc.server b/etc/jshintrc.server deleted file mode 100644 index dd63eeecb..000000000 --- a/etc/jshintrc.server +++ /dev/null @@ -1,8 +0,0 @@ -{ - "esversion": 6, - "undef": true, - "node": true, - "mocha": true, - "expr": true, - "eqeqeq": true -} diff --git a/lib/asm-cl.js b/lib/asm-cl.js index 8d49ae452..6891c1630 100644 --- a/lib/asm-cl.js +++ b/lib/asm-cl.js @@ -147,8 +147,8 @@ class ClParser { } addLine(line) { - if (!!line.match(ignoreAll)) return; - if (!!line.match(ceErrorLine)) { + if (line.match(ignoreAll)) return; + if (line.match(ceErrorLine)) { this._add({keep: true, text: line, source: null}); return; } @@ -158,16 +158,17 @@ class ClParser { return; } - let match; - if (!!(match = line.match(fileFind))) { - if (!!match[1].match(gccExplorerDir)) { + let match = line.match(fileFind); + if (match) { + if (match[1].match(gccExplorerDir)) { this.sourceFilename = null; } else { this.sourceFilename = match[1]; } return; } - if (!!(match = line.match(sourceTag))) { + match = line.match(sourceTag); + if (match) { this.source = {'file': this.sourceFilename, 'line': parseInt(match[1])}; return; } @@ -198,12 +199,14 @@ class ClParser { this.currentLabel = null; } let tempDef = false; - if (!!(match = command.match(labelDef))) { + match = command.match(labelDef); + if (match) { keep = !this.filters.labels; this.currentLabel = match[1]; debug(match, this.currentLabel); } - if (!!(match = command.match(constDef))) { + match = command.match(constDef); + if (match) { keep = !this.filters.labels; this.currentLabel = match[1]; debug(match, this.currentLabel); diff --git a/lib/asm.js b/lib/asm.js index a252a99b6..2f7993012 100644 --- a/lib/asm.js +++ b/lib/asm.js @@ -203,8 +203,8 @@ function AsmParser(compilerProps) { } else if (line.match(endAppBlock) || line.match(endAsmNesting)) { inCustomAssembly--; } - - if (!!(match = line.match(sourceTag))) { + match = line.match(sourceTag); + if (match) { const file = files[parseInt(match[1])]; const sourceLine = parseInt(match[2]); if (file) { @@ -216,7 +216,8 @@ function AsmParser(compilerProps) { source = null; } } - if (!!(match = line.match(sourceStab))) { + match = line.match(sourceStab); + if (match) { // cf http://www.math.utah.edu/docs/info/stabs_11.html#SEC48 switch (parseInt(match[1])) { case 68: diff --git a/lib/base-compiler.js b/lib/base-compiler.js index 64b4e8086..1f5d8d773 100644 --- a/lib/base-compiler.js +++ b/lib/base-compiler.js @@ -149,7 +149,7 @@ class BaseCompiler { return fn; } - optionsForFilter(filters, outputFilename, userOptions) { + optionsForFilter(filters, outputFilename) { let options = ['-g', '-o', this.filename(outputFilename)]; if (this.compiler.intelAsm && filters.intel && !filters.binary) { options = options.concat(this.compiler.intelAsm.split(" ")); @@ -509,7 +509,7 @@ class BaseCompiler { if (fs.existsSync(passDump) && fs.statSync(passDump).isFile()) { output.currentPassOutput = fs.readFileSync(passDump, 'utf-8'); - if (output.currentPassOutput.match('^\s*$')) { + if (output.currentPassOutput.match('^s*$')) { output.currentPassOutput = 'File for selected pass is empty.'; } else { output.syntaxHighlight = true; @@ -542,27 +542,27 @@ class BaseCompiler { asmPromise = this.objdump(outputFilename, result, maxSize, filters.intel, filters.demangle); } else { asmPromise = this.stat(outputFilename).then(stat => { - if (stat.size >= maxSize) { - result.asm = " " + maxSize + " bytes)>"; - return result; - } - if (postProcess.length) { - const postCommand = 'cat "' + outputFilename + '" | ' + postProcess.join(" | "); - return this.exec("bash", ["-c", postCommand], {maxOutput: maxSize}) - .then((postResult) => { - return this.handlePostProcessResult(result, postResult); - }); - } else { - return this.readFile(outputFilename).then(contents => { - result.asm = contents.toString(); - return Promise.resolve(result); - }); - } - }, - () => { - result.asm = ""; + if (stat.size >= maxSize) { + result.asm = " " + maxSize + " bytes)>"; return result; } + if (postProcess.length) { + const postCommand = 'cat "' + outputFilename + '" | ' + postProcess.join(" | "); + return this.exec("bash", ["-c", postCommand], {maxOutput: maxSize}) + .then((postResult) => { + return this.handlePostProcessResult(result, postResult); + }); + } else { + return this.readFile(outputFilename).then(contents => { + result.asm = contents.toString(); + return Promise.resolve(result); + }); + } + }, + () => { + result.asm = ""; + return result; + } ); } if (filters.execute) { diff --git a/lib/cfg.js b/lib/cfg.js index 08a069bd6..21db00827 100644 --- a/lib/cfg.js +++ b/lib/cfg.js @@ -193,11 +193,11 @@ function concatInstructions(asmArr, first, last) { .join('\n'); } -function makeNodes(asmArr, arrOfCanonicalBasicBlock) { +function makeNodes(asms, arrOfCanonicalBasicBlock) { return _.map(arrOfCanonicalBasicBlock, e => { return { id: e.nameId, - label: `${e.nameId}${e.nameId.indexOf(':') !== -1 ? '' : ':'}\n${concatInstructions(asmArr, e.start, e.end)}`, + label: `${e.nameId}${e.nameId.indexOf(':') !== -1 ? '' : ':'}\n${concatInstructions(asms, e.start, e.end)}`, color: '#99ccff', shape: 'box' }; @@ -228,8 +228,9 @@ function makeEdges(asmArr, arrOfCanonicalBasicBlock, rules) { return name.substring(0, pos + 1) + suffix; }; - - // note: x.end-1 possible value: jmp .L*, {jne,je,jg,...} .L*, ret/rep ret, call and any other instruction that doesn't change control flow + /* note: x.end-1 possible values: + jmp .L*, {jne,je,jg,...} .L*, ret/rep ret, call and any other instruction that doesn't change control flow + */ _.each(arrOfCanonicalBasicBlock, function (x) { let targetNode; diff --git a/lib/compilers/Wine-CL.js b/lib/compilers/Wine-CL.js index b2c8f738b..8be9bb6af 100644 --- a/lib/compilers/Wine-CL.js +++ b/lib/compilers/Wine-CL.js @@ -59,7 +59,7 @@ class CLCompiler extends BaseCompiler { return RunCLDemangler(this, result); } - optionsForFilter(filters, outputFilename, userOptions) { + optionsForFilter(filters, outputFilename) { return [ '/FAsc', '/c', diff --git a/lib/compilers/assembly.js b/lib/compilers/assembly.js index e6efb0603..e9faa8e14 100644 --- a/lib/compilers/assembly.js +++ b/lib/compilers/assembly.js @@ -40,7 +40,7 @@ class AssemblyCompiler extends BaseCompiler { return argumentParsers.Base; } - optionsForFilter(filters, outputFilename, userOptions) { + optionsForFilter(filters) { filters.binary = true; return []; } diff --git a/lib/compilers/fake-for-test.js b/lib/compilers/fake-for-test.js index efbdedccb..72731dfab 100644 --- a/lib/compilers/fake-for-test.js +++ b/lib/compilers/fake-for-test.js @@ -63,4 +63,4 @@ class FakeCompiler { } -module.exports = FakeCompiler; \ No newline at end of file +module.exports = FakeCompiler; diff --git a/lib/compilers/golang.js b/lib/compilers/golang.js index a2052382b..c351757b9 100644 --- a/lib/compilers/golang.js +++ b/lib/compilers/golang.js @@ -51,13 +51,13 @@ class GolangCompiler extends BaseCompiler { })).join("\n"); } - postProcess(result, outputFilename, filters) { + postProcess(result) { result.asm = this.convertNewGoL(result.stdout); result.stdout = []; return Promise.resolve(result); } - optionsForFilter(filters, outputFilename, userOptions) { + optionsForFilter(filters, outputFilename) { // If we're dealing with an older version... if (this.compiler.id === '6g141') { return ['tool', '6g', '-g', '-o', outputFilename, '-S']; diff --git a/lib/compilers/haskell.js b/lib/compilers/haskell.js index b267cf4b1..b161046ef 100644 --- a/lib/compilers/haskell.js +++ b/lib/compilers/haskell.js @@ -25,7 +25,7 @@ const BaseCompiler = require('../base-compiler'); class HaskellCompiler extends BaseCompiler { - optionsForFilter(filters, outputFilename, userOptions) { + optionsForFilter(filters, outputFilename) { return ['-S', '-g', '-o', this.filename(outputFilename)]; } } diff --git a/lib/compilers/ispc.js b/lib/compilers/ispc.js index adf30f73b..4de55800d 100644 --- a/lib/compilers/ispc.js +++ b/lib/compilers/ispc.js @@ -25,7 +25,7 @@ const BaseCompiler = require('../base-compiler'); class ISPCCompiler extends BaseCompiler { - optionsForFilter(filters, outputFilename, userOptions) { + optionsForFilter(filters, outputFilename) { return ['--target=sse2-i32x4', '--emit-asm', '-g', '-o', this.filename(outputFilename)]; } } diff --git a/lib/compilers/ldc.js b/lib/compilers/ldc.js index eba7f6622..fc231481f 100644 --- a/lib/compilers/ldc.js +++ b/lib/compilers/ldc.js @@ -31,7 +31,7 @@ class LDCCompiler extends BaseCompiler { this.compiler.supportsIntel = true; } - optionsForFilter(filters, outputFilename, userOptions) { + optionsForFilter(filters, outputFilename) { let options = ['-g', '-of', this.filename(outputFilename)]; if (filters.intel && !filters.binary) options = options.concat('-x86-asm-syntax=intel'); if (!filters.binary) options = options.concat('-output-s'); diff --git a/lib/compilers/pascal.js b/lib/compilers/pascal.js index 3aeb3a8d7..ad6d1f8f6 100644 --- a/lib/compilers/pascal.js +++ b/lib/compilers/pascal.js @@ -54,7 +54,7 @@ class FPCCompiler extends BaseCompiler { return result; } - optionsForFilter(filters, outputFilename, userOptions) { + optionsForFilter(filters) { let options = ['-g', '-al']; if (this.compiler.intelAsm && filters.intel && !filters.binary) { @@ -66,7 +66,7 @@ class FPCCompiler extends BaseCompiler { return options; } - getOutputFilename(dirPath, outputFilebase) { + getOutputFilename(dirPath) { return path.join(dirPath, `${path.basename(this.compileFilename, this.lang.extensions[0])}.s`); } diff --git a/lib/csp.js b/lib/csp.js index c632126c9..53a2ec6f3 100644 --- a/lib/csp.js +++ b/lib/csp.js @@ -28,14 +28,16 @@ const _ = require('underscore-node'); const data = { 'default-src': ["'self'", "'report-sample'", 'https://*.godbolt.org', 'localhost:*'], 'style-src': ["'self'", "'unsafe-inline'", "'report-sample'", 'https://*.godbolt.org', 'localhost:*'], - 'script-src': ["'self'", "'unsafe-inline'", "'report-sample'", 'data:', 'https://*.godbolt.org', 'localhost:*', 'https://*.twitter.com', 'https://www.fullstory.com', - 'https://www.google-analytics.com', 'https://apis.google.com', 'https://ssl.google-analytics.com'], - 'img-src': ["'self'", 'https://*.godbolt.org', 'localhost:*', 'data:', 'https://www.google-analytics.com/', 'https://syndication.twitter.com', - 'https://ssl.google-analytics.com', 'https://csi.gstatic.com'], - 'font-src': ["'self'", 'data:', 'https://*.godbolt.org', 'localhost:*', 'https://fonts.gstatic.com', 'https://themes.googleusercontent.com'], - 'frame-src': ["'self'", 'https://*.godbolt.org', 'localhost:*', 'https://www.google-analytics.com', 'https://accounts.google.com/', - 'https://content.googleapis.com/', 'https://rs.fullstory.com/', 'https://sentry.io', 'https://platform.twitter.com/', - 'https://syndication.twitter.com/'], + 'script-src': ["'self'", "'unsafe-inline'", "'report-sample'", 'data:', 'https://*.godbolt.org', 'localhost:*', + 'https://*.twitter.com', 'https://www.fullstory.com', 'https://www.google-analytics.com', + 'https://apis.google.com', 'https://ssl.google-analytics.com'], + 'img-src': ["'self'", 'https://*.godbolt.org', 'localhost:*', 'data:', 'https://www.google-analytics.com/', + 'https://syndication.twitter.com', 'https://ssl.google-analytics.com', 'https://csi.gstatic.com'], + 'font-src': ["'self'", 'data:', 'https://*.godbolt.org', 'localhost:*', 'https://fonts.gstatic.com', + 'https://themes.googleusercontent.com'], + 'frame-src': ["'self'", 'https://*.godbolt.org', 'localhost:*', 'https://www.google-analytics.com', + 'https://accounts.google.com/', 'https://content.googleapis.com/', 'https://rs.fullstory.com/', + 'https://sentry.io', 'https://platform.twitter.com/', 'https://syndication.twitter.com/'], 'connect-src': ['*'], 'media-src': ['https://ssl.gstatic.com'] }; diff --git a/lib/google.js b/lib/google.js index 432fc304e..c6f92a2d4 100644 --- a/lib/google.js +++ b/lib/google.js @@ -55,4 +55,4 @@ class ShortLinkResolver { } } -module.exports.ShortLinkResolver = ShortLinkResolver; \ No newline at end of file +module.exports.ShortLinkResolver = ShortLinkResolver; diff --git a/lib/handlers/asm-docs-api.js b/lib/handlers/asm-docs-api.js index b8e830e83..66fd05827 100644 --- a/lib/handlers/asm-docs-api.js +++ b/lib/handlers/asm-docs-api.js @@ -33,7 +33,7 @@ class Handler { this.atAndTSuffixRemover = /^([A-Z]+)[BWLQ]$/i; } - handle(req, res, next) { + handle(req, res) { let info = asmDocs.getAsmOpcode(req.params.opcode); if (!info) { // If the opcode ends with an AT&T suffix, try removing that and giving it another go. diff --git a/lib/handlers/compile.js b/lib/handlers/compile.js index c016d894e..5b6040a64 100644 --- a/lib/handlers/compile.js +++ b/lib/handlers/compile.js @@ -214,40 +214,39 @@ class CompileHandler { compiler.compile(source, options, backendOptions, filters) .then(result => { - if (req.accepts(['text', 'json']) === 'json') { - res.set('Content-Type', 'application/json'); - res.end(JSON.stringify(result)); - } else { - res.set('Content-Type', 'text/plain'); - try { - if (!_.isEmpty(this.textBanner)) res.write('# ' + this.textBanner + "\n"); - res.write(textify(result.asm)); - if (result.code !== 0) res.write("\n# Compiler exited with result code " + result.code); - if (!_.isEmpty(result.stdout)) res.write("\nStandard out:\n" + textify(result.stdout)); - if (!_.isEmpty(result.stderr)) res.write("\nStandard error:\n" + textify(result.stderr)); - } catch (ex) { - Raven.captureException(ex, {req: req}); - res.write("Error handling request: " + ex); - } - res.end('\n'); + if (req.accepts(['text', 'json']) === 'json') { + res.set('Content-Type', 'application/json'); + res.end(JSON.stringify(result)); + } else { + res.set('Content-Type', 'text/plain'); + try { + if (!_.isEmpty(this.textBanner)) res.write('# ' + this.textBanner + "\n"); + res.write(textify(result.asm)); + if (result.code !== 0) res.write("\n# Compiler exited with result code " + result.code); + if (!_.isEmpty(result.stdout)) res.write("\nStandard out:\n" + textify(result.stdout)); + if (!_.isEmpty(result.stderr)) res.write("\nStandard error:\n" + textify(result.stderr)); + } catch (ex) { + Raven.captureException(ex, {req: req}); + res.write("Error handling request: " + ex); } - }, - error => { - logger.error("Error during compilation", error); - if (typeof(error) !== "string") { - if (error.code) { - if (typeof(error.stderr) === "string") { - error.stdout = utils.parseOutput(error.stdout); - error.stderr = utils.parseOutput(error.stderr); - } - res.end(JSON.stringify(error)); - return; - } - error = "Internal Compiler Explorer error: " + (error.stack || error); - } - res.end(JSON.stringify({code: -1, stderr: [{text: error}]})); + res.end('\n'); } - ); + }, + error => { + logger.error("Error during compilation", error); + if (typeof(error) !== "string") { + if (error.code) { + if (typeof(error.stderr) === "string") { + error.stdout = utils.parseOutput(error.stdout); + error.stderr = utils.parseOutput(error.stderr); + } + res.end(JSON.stringify(error)); + return; + } + error = "Internal Compiler Explorer error: " + (error.stack || error); + } + res.end(JSON.stringify({code: -1, stderr: [{text: error}]})); + }); } } diff --git a/lib/handlers/health-check.js b/lib/handlers/health-check.js index e9cbe9d6b..857ae67ab 100644 --- a/lib/handlers/health-check.js +++ b/lib/handlers/health-check.js @@ -23,9 +23,9 @@ // POSSIBILITY OF SUCH DAMAGE. class HealthCheckHandler { - handle(req, res, next) { + handle(req, res) { res.end("Everything is awesome"); } } -module.exports.HealthCheckHandler = HealthCheckHandler; \ No newline at end of file +module.exports.HealthCheckHandler = HealthCheckHandler; diff --git a/lib/handlers/source.js b/lib/handlers/source.js index 2932a4161..9f811883c 100644 --- a/lib/handlers/source.js +++ b/lib/handlers/source.js @@ -59,4 +59,4 @@ class Handler { } } -module.exports.Handler = Handler; \ No newline at end of file +module.exports.Handler = Handler; diff --git a/lib/logger.js b/lib/logger.js index c48a057b5..a336cee3a 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -31,9 +31,9 @@ const logger = new (winston.Logger)({ }); logger.stream = { - write: function (message, encoding) { + write: message => { logger.info(message.trim()); } }; -exports.logger = logger; \ No newline at end of file +exports.logger = logger; diff --git a/lib/pascal-support.js b/lib/pascal-support.js index 0b331510b..1df557825 100644 --- a/lib/pascal-support.js +++ b/lib/pascal-support.js @@ -76,97 +76,94 @@ class PascalDemangler { } demangle(text) { - if (text.endsWith(':')) { - if (this.shouldIgnoreSymbol(text)) { - return false; - } - - text = text.substr(0, text.length - 1); - - for (let k in this.fixedsymbols) { - if (text === k) { - text = text.replace(k, this.fixedsymbols[k]); - this.symbolStore.Add(k, this.fixedsymbols[k]); - return this.fixedsymbols[k]; - } - } - - let unmangledglobalvar; - if (text.startsWith("U_$OUTPUT_$$_")) { - unmangledglobalvar = text.substr(13).toLowerCase(); - this.symbolStore.Add(text, unmangledglobalvar); - return unmangledglobalvar; - } else if (text.startsWith("U_OUTPUT_")) { - unmangledglobalvar = text.substr(9).toLowerCase(); - this.symbolStore.Add(text, unmangledglobalvar); - return unmangledglobalvar; - } - - let idx, paramtype = "", signature = "", phase = 0; - let unitname = "", classname = "", methodname = "", params = "", resulttype = ""; - - idx = text.indexOf("$_$"); - if (idx !== -1) { - unitname = text.substr(0, idx - 1); - classname = text.substr(idx + 3, text.indexOf("_$_", idx + 2) - idx - 3); - } - - signature = ""; - idx = text.indexOf("_$$_"); - if (idx !== -1) { - if (unitname === "") unitname = text.substr(0, idx - 1); - signature = text.substr(idx + 3); - } - - if (unitname === "") { - idx = text.indexOf("OUTPUT_"); - if (idx !== -1) { - unitname = "OUTPUT"; - - idx = text.indexOf("_$__"); - if (idx !== -1) { - classname = text.substr(7, idx - 7); - signature = text.substr(idx + 3); - } else { - signature = text.substr(6); - } - } - } - - if (signature !== "") { - for (idx = 1; idx < signature.length; idx++) { - if (signature[idx] === '$') { - if (phase === 0) phase = 1; - else if (phase === 1) { - if (paramtype === "") phase = 2; - else if (params !== "") { - params = params + "," + paramtype; - paramtype = ""; - } else if (params === "") { - params = paramtype; - paramtype = ""; - } - } - } else { - if (phase === 0) methodname = methodname + signature[idx]; - else if (phase === 1) paramtype = paramtype + signature[idx]; - else if (phase === 2) resulttype = resulttype + signature[idx]; - } - } - - if (paramtype !== "") { - if (params !== "") params = params + "," + paramtype; - else params = paramtype; - } - } - - const unmangled = this.composeReadableMethodSignature(unitname, classname, methodname, params); - this.symbolStore.Add(text, unmangled); - - return unmangled; + if (!text.endsWith(':')) return false; + if (this.shouldIgnoreSymbol(text)) { + return false; } - return false; + text = text.substr(0, text.length - 1); + + for (let k in this.fixedsymbols) { + if (text === k) { + text = text.replace(k, this.fixedsymbols[k]); + this.symbolStore.Add(k, this.fixedsymbols[k]); + return this.fixedsymbols[k]; + } + } + + let unmangledGlobalVar; + if (text.startsWith("U_$OUTPUT_$$_")) { + unmangledGlobalVar = text.substr(13).toLowerCase(); + this.symbolStore.Add(text, unmangledGlobalVar); + return unmangledGlobalVar; + } else if (text.startsWith("U_OUTPUT_")) { + unmangledGlobalVar = text.substr(9).toLowerCase(); + this.symbolStore.Add(text, unmangledGlobalVar); + return unmangledGlobalVar; + } + + let idx, paramtype = "", signature = "", phase = 0; + let unitname = "", classname = "", methodname = "", params = "", resulttype = ""; + + idx = text.indexOf("$_$"); + if (idx !== -1) { + unitname = text.substr(0, idx - 1); + classname = text.substr(idx + 3, text.indexOf("_$_", idx + 2) - idx - 3); + } + + signature = ""; + idx = text.indexOf("_$$_"); + if (idx !== -1) { + if (unitname === "") unitname = text.substr(0, idx - 1); + signature = text.substr(idx + 3); + } + + if (unitname === "") { + idx = text.indexOf("OUTPUT_"); + if (idx !== -1) { + unitname = "OUTPUT"; + + idx = text.indexOf("_$__"); + if (idx !== -1) { + classname = text.substr(7, idx - 7); + signature = text.substr(idx + 3); + } else { + signature = text.substr(6); + } + } + } + + if (signature !== "") { + for (idx = 1; idx < signature.length; idx++) { + if (signature[idx] === '$') { + if (phase === 0) phase = 1; + else if (phase === 1) { + if (paramtype === "") phase = 2; + else if (params !== "") { + params = params + "," + paramtype; + paramtype = ""; + } else if (params === "") { + params = paramtype; + paramtype = ""; + } + } + } else { + if (phase === 0) methodname = methodname + signature[idx]; + else if (phase === 1) paramtype = paramtype + signature[idx]; + else if (phase === 2) resulttype = resulttype + signature[idx]; + } + } + + if (paramtype !== "") { + if (params !== "") params = params + "," + paramtype; + else params = paramtype; + } + } + + const unmangled = this.composeReadableMethodSignature(unitname, classname, methodname, params); + this.symbolStore.Add(text, unmangled); + + return unmangled; } addDemangleToCache(text) { diff --git a/etc/oldhash.txt b/oldhash.txt similarity index 98% rename from etc/oldhash.txt rename to oldhash.txt index 78406f28f..8f66bf1b9 100644 --- a/etc/oldhash.txt +++ b/oldhash.txt @@ -1,6 +1,6 @@ http://lud-ldnmg01:10240/#%7B%22version%22%3A2%2C%22source%22%3A%22%23include%20%3Cxmmintrin.h%3E%5Cn%5Cnvoid%20f(__m128%20a%2C%20__m128%20b)%5Cn%7B%5Cn%20%20%2F%2F%20I%20am%20a%20walrus.%5Cn%7D%22%2C%22compiler%22%3A%22%2Fhome%2Fmgodbolt%2Fapps%2Fintel-icc-oss%2Fbin%2Ficc%22%2C%22options%22%3A%22-O3%20-std%3Dc%2B%2B0x%22%2C%22filterAsm%22%3A%7B%22labels%22%3Atrue%2C%22directives%22%3Atrue%7D%7D -- should be icc, "-O3 -std=c++0x", all filters but comments http://lud-ldnmg01:10240/#compilers:!((compiler:g7snapshot,options:'-std%3Dc%2B%2B1z+-O3+',source:'%23include+%3Cvector%3E%0A%0Astruct+Widget+%7B%0A++int+n%3B%0A++double+x,+y%3B%0A++Widget(const+Widget%26+o)+:+x(o.x),+y(o.y),+n(o.n)+%7B%7D%0A++Widget(int+n,+double+x,+double+y)+:+n(n),+x(x),+y(y)+%7B%7D%0A%7D%3B%0A%0Astd::vector%3CWidget%3E+vector%3B%0Aconst+int+N+%3D+1002%3B%0Adouble+a+%3D+0.1%3B%0Adouble+b+%3D+0.2%3B%0A%0Avoid+demo()+%7B%0A++vector.reserve(N)%3B%0A++for+(int+i+%3D+01%3B+i+%3C+N%3B+%2B%2Bi)%0A++%7B%0A%09Widget+w+%7Bi,+a,+b%7D%3B%0A%09vector.push_back(w)%3B+//+or+vector.push_back(std::move(w))%0A++%7D%0A%7D%0A%0Aint+main()%0A%7B%0A+%0A+%0A%7D%0A')),filterAsm:(colouriseAsm:!t,commentOnly:!t,directives:!t,intel:!t,labels:!t),version:3 --- should be GCC 7, with widgets source. Binary mode off, all other labels on. -std=c++1z -O3 +-- should be GCC 7, with widgets source. Binary mode off, all other labels on. -std=c++1z -O3 http://lud-ldnmg01:10240/#compilers:!((compiler:g474,options:'',sourcez:PQKgBALgpgzhYHsBmYDGCC2AHATrGAlggHYB0pamGUx8AFlHmEgjmADY0DmEdAXACgAhiNFjxEyVOkzZw2QsVLl85WvVrVG7TolbdB7fsMmlx0xennLNsddu37Dy0%2BenXbwx8%2B7vPo/7OfoGaIMACAgS0YBhCUQAUUfBCOFyoADSUxHBodClgICApXABuAJRgAN4CYGB4EACuOMRgAIwATADcAgC%2BQAA)),filterAsm:(binary:!t,colouriseAsm:!t,commentOnly:!t,directives:!t,intel:!t,labels:!t),version:3 -- should be 4.7.4, no options, binary, intel, colourise. diff --git a/package.json b/package.json index 3c264719a..7988e2323 100644 --- a/package.json +++ b/package.json @@ -63,9 +63,9 @@ "copy-webpack-plugin": "^4.1.1", "css-loader": "^0.28.7", "extract-text-webpack-plugin": "^3.0.1", + "eslint": "^4.17.0", "file-loader": "^1.1.5", "istanbul": "^0.4.5", - "jshint": "^2.9.5", "mocha": "^3.3.0", "nock": "^9.1.4", "requirejs": "*", diff --git a/static/.eslintignore b/static/.eslintignore new file mode 100644 index 000000000..4cece457a --- /dev/null +++ b/static/.eslintignore @@ -0,0 +1,3 @@ +dist +vs +ext \ No newline at end of file diff --git a/static/.eslintrc b/static/.eslintrc new file mode 100644 index 000000000..4634e092b --- /dev/null +++ b/static/.eslintrc @@ -0,0 +1,28 @@ +// Client code linter config +{ + "root": true, + "extends": "eslint:recommended", + "env": { + "browser": true, + "node": true, + "es6": false + }, + "rules": { + // The idea is to implement this first 2 warnings slowly into the code, and to eventually enforce them + "max-statements": ["warn", 55], + "max-len": ["warn", 130, { "ignoreRegExpLiterals": true }], + "strict": ["error", "safe"], + "eol-last": ["error", "always"], + "semi": ["error", "always"], + "indent": ["error", 4, { "SwitchCase": 1 }], + "no-control-regex": 0 + }, + "parserOptions": { + "ecmaVersion": 5 + }, + "globals": { + "define": false, + "monaco": true, + "__webpack_public_path__": true + } +} diff --git a/static/analytics.js b/static/analytics.js index bfea77360..899aa2cf8 100644 --- a/static/analytics.js +++ b/static/analytics.js @@ -36,6 +36,7 @@ if (options.raven) { } var gaProxy; +/* eslint-disable */ if (options.googleAnalyticsEnabled) { (function (i, s, o, g, r, a, m) { i.GoogleAnalyticsObject = r; @@ -100,9 +101,9 @@ if (options.googleAnalyticsEnabled) { }; })(window, document, window['_fs_namespace'], 'script', 'user'); } else { - gaProxy = function () { - }; + gaProxy = function () {}; } +/* eslint-enable */ function initialise() { if (options.embedded) return; diff --git a/static/ansi-to-html.js b/static/ansi-to-html.js index f264d4fff..65f29a3f9 100644 --- a/static/ansi-to-html.js +++ b/static/ansi-to-html.js @@ -23,501 +23,499 @@ // Converted from https://github.com/rburns/ansi-to-html -define(function (require) { - 'use strict'; +'use strict'; - var _ = require('underscore'); +var _ = require('underscore'); - var defaults = { - fg: '#FFF', - bg: '#000', - newline: false, - escapeXML: false, - stream: false, - colors: getDefaultColors() +var defaults = { + fg: '#FFF', + bg: '#000', + newline: false, + escapeXML: false, + stream: false, + colors: getDefaultColors() +}; + +function getDefaultColors() { + var colors = { + 0: '#000', + 1: '#A00', + 2: '#0A0', + 3: '#A50', + 4: '#00A', + 5: '#A0A', + 6: '#0AA', + 7: '#AAA', + 8: '#555', + 9: '#F55', + 10: '#5F5', + 11: '#FF5', + 12: '#55F', + 13: '#F5F', + 14: '#5FF', + 15: '#FFF' }; - function getDefaultColors() { - var colors = { - 0: '#000', - 1: '#A00', - 2: '#0A0', - 3: '#A50', - 4: '#00A', - 5: '#A0A', - 6: '#0AA', - 7: '#AAA', - 8: '#555', - 9: '#F55', - 10: '#5F5', - 11: '#FF5', - 12: '#55F', - 13: '#F5F', - 14: '#5FF', - 15: '#FFF' - }; - - range(0, 5).forEach(function (red) { - range(0, 5).forEach(function (green) { - range(0, 5).forEach(function (blue) { - return setStyleColor(red, green, blue, colors); - }); + range(0, 5).forEach(function (red) { + range(0, 5).forEach(function (green) { + range(0, 5).forEach(function (blue) { + return setStyleColor(red, green, blue, colors); }); }); + }); - range(0, 23).forEach(function (gray) { - var c = gray + 232; - var l = toHexString(gray * 10 + 8); + range(0, 23).forEach(function (gray) { + var c = gray + 232; + var l = toHexString(gray * 10 + 8); - colors[c] = '#' + l + l + l; - }); + colors[c] = '#' + l + l + l; + }); - return colors; + return colors; +} + +/** + * @param {number} red + * @param {number} green + * @param {number} blue + * @param {object} colors + */ +function setStyleColor(red, green, blue, colors) { + var c = 16 + red * 36 + green * 6 + blue; + var r = red > 0 ? red * 40 + 55 : 0; + var g = green > 0 ? green * 40 + 55 : 0; + var b = blue > 0 ? blue * 40 + 55 : 0; + + colors[c] = toColorHexString([r, g, b]); +} + +/** + * Converts from a number like 15 to a hex string like 'F' + * @param {number} num + * @returns {string} + */ +function toHexString(num) { + var str = num.toString(16); + + while (str.length < 2) { + str = '0' + str; } - /** - * @param {number} red - * @param {number} green - * @param {number} blue - * @param {object} colors - */ - function setStyleColor(red, green, blue, colors) { - var c = 16 + red * 36 + green * 6 + blue; - var r = red > 0 ? red * 40 + 55 : 0; - var g = green > 0 ? green * 40 + 55 : 0; - var b = blue > 0 ? blue * 40 + 55 : 0; + return str; +} - colors[c] = toColorHexString([r, g, b]); +/** + * Converts from an array of numbers like [15, 15, 15] to a hex string like 'FFF' + * @param {[red, green, blue]} ref + * @returns {string} + */ +function toColorHexString(ref) { + var results = []; + + for (var j = 0, len = ref.length; j < len; j++) { + results.push(toHexString(ref[j])); } - /** - * Converts from a number like 15 to a hex string like 'F' - * @param {number} num - * @returns {string} - */ - function toHexString(num) { - var str = num.toString(16); + return '#' + results.join(''); +} - while (str.length < 2) { - str = '0' + str; +/** + * @param {Array} stack + * @param {string} token + * @param {*} data + * @param {object} options + */ +function generateOutput(stack, token, data, options) { + var result; + + if (token === 'text') { + result = pushText(data, options); + } else if (token === 'display') { + result = handleDisplay(stack, data, options); + } else if (token === 'xterm256') { + result = pushForegroundColor(stack, options.colors[data]); + } + + return result; +} + +/** + * @param {Array} stack + * @param {number} code + * @param {object} options + * @returns {*} + */ +function handleDisplay(stack, code, options) { + code = parseInt(code, 10); + var result; + + var codeMap = { + '-1': function _() { + return '
'; + }, + 0: function _() { + return stack.length && resetStyles(stack); + }, + 1: function _() { + return pushTag(stack, 'b'); + }, + 3: function _() { + return pushTag(stack, 'i'); + }, + 4: function _() { + return pushTag(stack, 'u'); + }, + 8: function _() { + return pushStyle(stack, 'display:none'); + }, + 9: function _() { + return pushTag(stack, 'strike'); + }, + 22: function _() { + return closeTag(stack, 'b'); + }, + 23: function _() { + return closeTag(stack, 'i'); + }, + 24: function _() { + return closeTag(stack, 'u'); + }, + 39: function _() { + return pushForegroundColor(stack, options.fg); + }, + 49: function _() { + return pushBackgroundColor(stack, options.bg); } + }; - return str; + if (codeMap[code]) { + result = codeMap[code](); + } else if (4 < code && code < 7) { + result = pushTag(stack, 'blink'); + } else if (29 < code && code < 38) { + result = pushForegroundColor(stack, options.colors[code - 30]); + } else if (39 < code && code < 48) { + result = pushBackgroundColor(stack, options.colors[code - 40]); + } else if (89 < code && code < 98) { + result = pushForegroundColor(stack, options.colors[8 + (code - 90)]); + } else if (99 < code && code < 108) { + result = pushBackgroundColor(stack, options.colors[8 + (code - 100)]); } - /** - * Converts from an array of numbers like [15, 15, 15] to a hex string like 'FFF' - * @param {[red, green, blue]} ref - * @returns {string} - */ - function toColorHexString(ref) { - var results = []; + return result; +} - for (var j = 0, len = ref.length; j < len; j++) { - results.push(toHexString(ref[j])); - } +/** + * Clear all the styles + * @returns {string} + */ +function resetStyles(stack) { + var stackClone = stack.slice(0); - return '#' + results.join(''); + stack.length = 0; + + return stackClone.reverse().map(function (tag) { + return ''; + }).join(''); +} + +/** + * Creates an array of numbers ranging from low to high + * @param {number} low + * @param {number} high + * @returns {Array} + * @example range(3, 7); // creates [3, 4, 5, 6, 7] + */ +function range(low, high) { + var results = []; + + for (var j = low; j <= high; j++) { + results.push(j); } - /** - * @param {Array} stack - * @param {string} token - * @param {*} data - * @param {object} options - */ - function generateOutput(stack, token, data, options) { - var result; + return results; +} - if (token === 'text') { - result = pushText(data, options); - } else if (token === 'display') { - result = handleDisplay(stack, data, options); - } else if (token === 'xterm256') { - result = pushForegroundColor(stack, options.colors[data]); - } +/** + * Returns a new function that is true if value is NOT the same category + * @param {string} category + * @returns {function} + */ +function notCategory(category) { + return function (e) { + return (category === null || e.category !== category) && category !== 'all'; + }; +} - return result; +/** + * Converts a code into an ansi token type + * @param {number} code + * @returns {string} + */ +function categoryForCode(code) { + code = parseInt(code, 10); + var result = null; + + if (code === 0) { + result = 'all'; + } else if (code === 1) { + result = 'bold'; + } else if (2 < code && code < 5) { + result = 'underline'; + } else if (4 < code && code < 7) { + result = 'blink'; + } else if (code === 8) { + result = 'hide'; + } else if (code === 9) { + result = 'strike'; + } else if (29 < code && code < 38 || code === 39 || 89 < code && code < 98) { + result = 'foreground-color'; + } else if (39 < code && code < 48 || code === 49 || 99 < code && code < 108) { + result = 'background-color'; } - /** - * @param {Array} stack - * @param {number} code - * @param {object} options - * @returns {*} - */ - function handleDisplay(stack, code, options) { - code = parseInt(code, 10); - var result; + return result; +} - var codeMap = { - '-1': function _() { - return '
'; - }, - 0: function _() { - return stack.length && resetStyles(stack); - }, - 1: function _() { - return pushTag(stack, 'b'); - }, - 3: function _() { - return pushTag(stack, 'i'); - }, - 4: function _() { - return pushTag(stack, 'u'); - }, - 8: function _() { - return pushStyle(stack, 'display:none'); - }, - 9: function _() { - return pushTag(stack, 'strike'); - }, - 22: function _() { - return closeTag(stack, 'b'); - }, - 23: function _() { - return closeTag(stack, 'i'); - }, - 24: function _() { - return closeTag(stack, 'u'); - }, - 39: function _() { - return pushForegroundColor(stack, options.fg); - }, - 49: function _() { - return pushBackgroundColor(stack, options.bg); - } - }; - - if (codeMap[code]) { - result = codeMap[code](); - } else if (4 < code && code < 7) { - result = pushTag(stack, 'blink'); - } else if (29 < code && code < 38) { - result = pushForegroundColor(stack, options.colors[code - 30]); - } else if (39 < code && code < 48) { - result = pushBackgroundColor(stack, options.colors[code - 40]); - } else if (89 < code && code < 98) { - result = pushForegroundColor(stack, options.colors[8 + (code - 90)]); - } else if (99 < code && code < 108) { - result = pushBackgroundColor(stack, options.colors[8 + (code - 100)]); - } - - return result; +/** + * @param {string} text + * @param {object} options + * @returns {string} + */ +function pushText(text, options) { + if (options.escapeXML) { + return text.replace(/&/g, '&').replace(//g, '>'); } - /** - * Clear all the styles - * @returns {string} - */ - function resetStyles(stack) { - var stackClone = stack.slice(0); + return text; +} - stack.length = 0; - - return stackClone.reverse().map(function (tag) { - return ''; - }).join(''); +/** + * @param {Array} stack + * @param {string} tag + * @param {string} [style=''] + * @returns {string} + */ +function pushTag(stack, tag, style) { + if (!style) { + style = ''; } - /** - * Creates an array of numbers ranging from low to high - * @param {number} low - * @param {number} high - * @returns {Array} - * @example range(3, 7); // creates [3, 4, 5, 6, 7] - */ - function range(low, high) { - var results = []; + stack.push(tag); - for (var j = low; j <= high; j++) { - results.push(j); - } + return ['<' + tag, style ? ' style="' + style + '"' : void 0, '>'].join(''); +} - return results; +/** + * @param {Array} stack + * @param {string} style + * @returns {string} + */ +function pushStyle(stack, style) { + return pushTag(stack, 'span', style); +} + +function pushForegroundColor(stack, color) { + return pushTag(stack, 'span', 'color:' + color); +} + +function pushBackgroundColor(stack, color) { + return pushTag(stack, 'span', 'background-color:' + color); +} + +/** + * @param {Array} stack + * @param {string} style + * @returns {string} + */ +function closeTag(stack, style) { + var last; + + if (stack.slice(-1)[0] === style) { + last = stack.pop(); } - /** - * Returns a new function that is true if value is NOT the same category - * @param {string} category - * @returns {function} - */ - function notCategory(category) { - return function (e) { - return (category === null || e.category !== category) && category !== 'all'; - }; + if (last) { + return ''; + } +} + +/** + * @param {string} text + * @param {object} options + * @param {function} callback + * @returns {Array} + */ +function tokenize(text, options, callback) { + var ansiMatch = false; + var ansiHandler = 3; + + function remove() { + return ''; } - /** - * Converts a code into an ansi token type - * @param {number} code - * @returns {string} - */ - function categoryForCode(code) { - code = parseInt(code, 10); - var result = null; - - if (code === 0) { - result = 'all'; - } else if (code === 1) { - result = 'bold'; - } else if (2 < code && code < 5) { - result = 'underline'; - } else if (4 < code && code < 7) { - result = 'blink'; - } else if (code === 8) { - result = 'hide'; - } else if (code === 9) { - result = 'strike'; - } else if (29 < code && code < 38 || code === 39 || 89 < code && code < 98) { - result = 'foreground-color'; - } else if (39 < code && code < 48 || code === 49 || 99 < code && code < 108) { - result = 'background-color'; - } - - return result; + function removeXterm256(m, g1) { + callback('xterm256', g1); + return ''; } - /** - * @param {string} text - * @param {object} options - * @returns {string} - */ - function pushText(text, options) { - if (options.escapeXML) { - return text.replace(/&/g, '&').replace(//g, '>'); - } - - return text; - } - - /** - * @param {Array} stack - * @param {string} tag - * @param {string} [style=''] - * @returns {string} - */ - function pushTag(stack, tag, style) { - if (!style) { - style = ''; - } - - stack.push(tag); - - return ['<' + tag, style ? ' style="' + style + '"' : void 0, '>'].join(''); - } - - /** - * @param {Array} stack - * @param {string} style - * @returns {string} - */ - function pushStyle(stack, style) { - return pushTag(stack, 'span', style); - } - - function pushForegroundColor(stack, color) { - return pushTag(stack, 'span', 'color:' + color); - } - - function pushBackgroundColor(stack, color) { - return pushTag(stack, 'span', 'background-color:' + color); - } - - /** - * @param {Array} stack - * @param {string} style - * @returns {string} - */ - function closeTag(stack, style) { - var last; - - if (stack.slice(-1)[0] === style) { - last = stack.pop(); - } - - if (last) { - return ''; - } - } - - /** - * @param {string} text - * @param {object} options - * @param {function} callback - * @returns {Array} - */ - function tokenize(text, options, callback) { - var ansiMatch = false; - var ansiHandler = 3; - - function remove() { - return ''; - } - - function removeXterm256(m, g1) { - callback('xterm256', g1); - return ''; - } - - function newline(m) { - if (options.newline) { - callback('display', -1); - } else { - callback('text', m); - } - - return ''; - } - - function ansiMess(m, g1) { - ansiMatch = true; - if (g1.trim().length === 0) { - g1 = '0'; - } - - g1 = g1.replace(/;+$/, "").split(';'); - - for (var o = 0, len = g1.length; o < len; o++) { - callback('display', g1[o]); - } - - return ''; - } - - function realText(m) { + function newline(m) { + if (options.newline) { + callback('display', -1); + } else { callback('text', m); - - return ''; } - /* eslint no-control-regex:0 */ - var tokens = [{ - pattern: /^\x08+/, - sub: remove - }, { - pattern: /^\x1b\[[012]?K/, - sub: remove - }, { - pattern: /^\x1b\[38;5;(\d+)m/, - sub: removeXterm256 - }, { - pattern: /^\n/, - sub: newline - }, { - pattern: /^\x1b\[((?:\d{1,3};?)+|)m/, - sub: ansiMess - }, { - pattern: /^\x1b\[?[\d;]{0,3}/, - sub: remove - }, { - pattern: /^([^\x1b\x08\n]+)/, - sub: realText - }]; - - function process(handler, i) { - if (i > ansiHandler && ansiMatch) { - return; - } - - ansiMatch = false; - - text = text.replace(handler.pattern, handler.sub); - } - - var handler; - var results1 = []; - var length = text.length; - - outer: while (length > 0) { - for (var i = 0, o = 0, len = tokens.length; o < len; i = ++o) { - handler = tokens[i]; - process(handler, i); - - if (text.length !== length) { - // We matched a token and removed it from the text. We need to - // start matching *all* tokens against the new text. - length = text.length; - continue outer; - } - } - - if (text.length === length) { - break; - } else { - results1.push(0); - } - - length = text.length; - } - - return results1; + return ''; } - /** - * If streaming, then the stack is "sticky" - * - * @param {Array} stickyStack - * @param {string} token - * @param {*} data - * @returns {Array} - */ - function updateStickyStack(stickyStack, token, data) { - if (token !== 'text') { - stickyStack = stickyStack.filter(notCategory(categoryForCode(data))); - stickyStack.push({token: token, data: data, category: categoryForCode(data)}); + function ansiMess(m, g1) { + ansiMatch = true; + if (g1.trim().length === 0) { + g1 = '0'; } - return stickyStack; - } + g1 = g1.replace(/;+$/, "").split(';'); - function Filter(options) { - options = options || {}; - - if (options.colors) { - options.colors = _.extend(defaults.colors, options.colors); + for (var o = 0, len = g1.length; o < len; o++) { + callback('display', g1[o]); } - this.opts = _.extend({}, defaults, options); - this.stack = []; - this.stickyStack = []; + + return ''; } - Filter.prototype = { - toHtml: function toHtml(input) { - var _this = this; + function realText(m) { + callback('text', m); - input = typeof input === 'string' ? [input] : input; - var stack = this.stack; - var options = this.opts; - var buf = []; + return ''; + } - this.stickyStack.forEach(function (element) { - var output = generateOutput(stack, element.token, element.data, options); + /* eslint no-control-regex:0 */ + var tokens = [{ + pattern: /^\x08+/, + sub: remove + }, { + pattern: /^\x1b\[[012]?K/, + sub: remove + }, { + pattern: /^\x1b\[38;5;(\d+)m/, + sub: removeXterm256 + }, { + pattern: /^\n/, + sub: newline + }, { + pattern: /^\x1b\[((?:\d{1,3};?)+|)m/, + sub: ansiMess + }, { + pattern: /^\x1b\[?[\d;]{0,3}/, + sub: remove + }, { + pattern: /^([^\x1b\x08\n]+)/, + sub: realText + }]; - if (output) { - buf.push(output); - } - }); + function process(handler, i) { + if (i > ansiHandler && ansiMatch) { + return; + } - tokenize(input.join(''), options, function (token, data) { - var output = generateOutput(stack, token, data, options); + ansiMatch = false; - if (output) { - buf.push(output); - } + text = text.replace(handler.pattern, handler.sub); + } - if (options.stream) { - _this.stickyStack = updateStickyStack(_this.stickyStack, token, data); - } - }); + var handler; + var results1 = []; + var length = text.length; - if (stack.length) { - buf.push(resetStyles(stack)); + outer: while (length > 0) { + for (var i = 0, o = 0, len = tokens.length; o < len; i = ++o) { + handler = tokens[i]; + process(handler, i); + + if (text.length !== length) { + // We matched a token and removed it from the text. We need to + // start matching *all* tokens against the new text. + length = text.length; + continue outer; + } + } + + if (text.length === length) { + break; + } else { + results1.push(0); + } + + length = text.length; + } + + return results1; +} + +/** + * If streaming, then the stack is "sticky" + * + * @param {Array} stickyStack + * @param {string} token + * @param {*} data + * @returns {Array} + */ +function updateStickyStack(stickyStack, token, data) { + if (token !== 'text') { + stickyStack = stickyStack.filter(notCategory(categoryForCode(data))); + stickyStack.push({token: token, data: data, category: categoryForCode(data)}); + } + + return stickyStack; +} + +function Filter(options) { + options = options || {}; + + if (options.colors) { + options.colors = _.extend(defaults.colors, options.colors); + } + this.opts = _.extend({}, defaults, options); + this.stack = []; + this.stickyStack = []; +} + +Filter.prototype = { + toHtml: function toHtml(input) { + var _this = this; + + input = typeof input === 'string' ? [input] : input; + var stack = this.stack; + var options = this.opts; + var buf = []; + + this.stickyStack.forEach(function (element) { + var output = generateOutput(stack, element.token, element.data, options); + + if (output) { + buf.push(output); + } + }); + + tokenize(input.join(''), options, function (token, data) { + var output = generateOutput(stack, token, data, options); + + if (output) { + buf.push(output); } - return buf.join(''); - } - }; + if (options.stream) { + _this.stickyStack = updateStickyStack(_this.stickyStack, token, data); + } + }); - return Filter; -}); \ No newline at end of file + if (stack.length) { + buf.push(resetStyles(stack)); + } + + return buf.join(''); + } +}; + +module.exports = Filter; diff --git a/static/asm-mode.js b/static/asm-mode.js index 3a230c651..f2c26f7a2 100644 --- a/static/asm-mode.js +++ b/static/asm-mode.js @@ -62,20 +62,20 @@ function definition() { [/@registers/, 'variable.predefined'], [/@intelOperators/, 'annotation'], // brackets - [/[{}<>()\[\]]/, '@brackets'], + [/[{}<>()[\]]/, '@brackets'], // ARM-style label reference [/[|][^|]*[|]*/, 'type.identifier'], // numbers - [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], + [/\d*\.\d+([eE][-+]?\d+)?/, 'number.float'], [/([$]|0[xX])[0-9a-fA-F]+/, 'number.hex'], [/\d+/, 'number'], // ARM-style immediate numbers (which otherwise look like comments) [/#-?\d+/, 'number'], // operators - [/[-+,*\/!:&]/, 'operator'], + [/[-+,*/!:&]/, 'operator'], // strings [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-terminated string @@ -94,10 +94,10 @@ function definition() { ], comment: [ - [/[^\/*]+/, 'comment'], + [/[^/*]+/, 'comment'], [/\/\*/, 'comment', '@push'], // nested comment ["\\*/", 'comment', '@pop'], - [/[\/*]/, 'comment'] + [/[/*]/, 'comment'] ], string: [ diff --git a/static/ast-view.js b/static/ast-view.js index 39921c8ac..fd9ec7ff2 100644 --- a/static/ast-view.js +++ b/static/ast-view.js @@ -61,7 +61,6 @@ function Ast(hub, container, state) { this.eventHub.on('compileResult', this.onCompileResult, this); this.eventHub.on('compiler', this.onCompiler, this); this.eventHub.on('compilerClose', this.onCompilerClose, this); - this.eventHub.on('editorChange', this.onEditorChange, this); this.eventHub.on('settingsChange', this.onSettingsChange, this); this.eventHub.emit('astViewOpened', this._compilerid); this.eventHub.emit('requestSettings'); @@ -83,9 +82,6 @@ Ast.prototype.resize = function () { }); }; -Ast.prototype.onEditorChange = function (id, source) { -}; - Ast.prototype.onCompileResult = function (id, compiler, result) { if (this._compilerid === id) { if (result.hasAstOutput) { @@ -96,8 +92,11 @@ Ast.prototype.onCompileResult = function (id, compiler, result) { } } }; + Ast.prototype.setTitle = function () { - this.container.setTitle(this._compilerName + " Ast Viewer (Editor #" + this._editorid + ", Compiler #" + this._compilerid + ")"); + this.container.setTitle( + this._compilerName + " Ast Viewer (Editor #" + this._editorid + ", Compiler #" + this._compilerid + ")" + ); }; Ast.prototype.getDisplayableAst = function (astResult) { diff --git a/static/compiler-service.js b/static/compiler-service.js index 66b94ba59..4caee71d0 100644 --- a/static/compiler-service.js +++ b/static/compiler-service.js @@ -120,7 +120,7 @@ CompilerService.prototype.expand = function (source) { _.each(lines, function (line, lineNumZeroBased) { var match = line.match(includeFind); if (match) { - promises.push(new Promise(function (resolve, reject) { + promises.push(new Promise(function (resolve) { var req = $.get(match[1], function (data) { data = '#line 1 "' + match[1] + '"\n' + data + '\n\n#line ' + (lineNumZeroBased + 1) + ' ""\n'; diff --git a/static/compiler.js b/static/compiler.js index b39e048df..72e9e751d 100644 --- a/static/compiler.js +++ b/static/compiler.js @@ -1076,19 +1076,21 @@ Compiler.prototype.onAsmToolTip = function (ed) { var word = ed.getModel().getWordAtPosition(pos); if (!word || !word.word) return; var opcode = word.word.toUpperCase(); + + function appendInfo(url) { + return '

For more information, visit the ' + + opcode + ' documentation .'; + } getAsmInfo(word.word).then( _.bind(function (asmHelp) { if (asmHelp) { - new Alert().alert(opcode + ' help', asmHelp.html + - '

For more information, visit the ' + - opcode + ' documentation .', - function () { - ed.focus(); - ed.setPosition(pos); - } - ); + new Alert().alert(opcode + ' help', asmHelp.html + appendInfo(asmHelp.url), function () { + ed.focus(); + ed.setPosition(pos); + }); } else { - new Alert().notify('This token was not found in the documentation.
Only most Intel x86 opcodes supported for now.', { + new Alert().notify('This token was not found in the documentation. Sorry!', { group: 'notokenindocs', alertClass: 'notification-error', dismissTime: 3000 diff --git a/static/components.js b/static/components.js index 2795ca511..5fef7564b 100644 --- a/static/components.js +++ b/static/components.js @@ -23,149 +23,146 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. -define(function () { - 'use strict'; - // here instead of in the editor.js and compiler.js etc to prevent circular dependencies. - return { - getCompiler: function (editorId, lang) { - return { - type: 'component', - componentName: 'compiler', - componentState: {source: editorId, lang: lang} - }; - }, - getCompilerWith: function (editorId, filters, options, compilerId) { - return { - type: 'component', - componentName: 'compiler', - componentState: { - source: editorId, - filters: filters, - options: options, - compiler: compilerId - } - }; - }, - getEditor: function (id, langId) { - return { - type: 'component', - componentName: 'codeEditor', - componentState: {id: id, lang: langId} - }; - }, - getEditorWith: function (id, source, options) { - return { - type: 'component', - componentName: 'codeEditor', - componentState: {id: id, source: source, options: options} - }; - }, - getOutput: function (compiler, editor) { - return { - type: 'component', - componentName: 'output', - componentState: {compiler: compiler, editor: editor} - }; - }, - getDiff: function () { - return { - type: 'component', - componentName: 'diff', - componentState: {} - }; - }, - getOptView: function () { - return { - type: 'component', - componentName: 'opt', - componentState: {} - }; - }, - getOptViewWith: function (id, source, optimization, compilerName, editorid) { - return { - type: 'component', - componentName: 'opt', - componentState: { - id: id, - source: source, - optOutput: optimization, - compilerName: compilerName, - editorid: editorid - } - }; - }, - getAstView: function () { - return { - type: 'component', - componentName: 'ast', - componentState: {} - }; - }, - getAstViewWith: function (id, source, astOutput, compilerName, editorid) { - return { - type: 'component', - componentName: 'ast', - componentState: { - id: id, - source: source, - astOutput: astOutput, - compilerName: compilerName, - editorid: editorid - } - }; - }, - getGccDumpView: function () { - return { - type: 'component', - componentName: 'gccdump', - componentState: {} - }; - }, - getGccDumpViewWith: function (id, compilerName, editorid, gccDumpOutput) { - var ret = { - type: 'component', - componentName: 'gccdump', - componentState: { - _compilerid: id, - _compilerName: compilerName, - _editorid: editorid - } - }; - if (gccDumpOutput) { - ret.treeDump = gccDumpOutput.treeDump; - ret.rtlDump = gccDumpOutput.rtlDump; - ret.selectedPass = gccDumpOutput.selectedPass; +'use strict'; +// here instead of in the editor.js and compiler.js etc to prevent circular dependencies. +module.exports = { + getCompiler: function (editorId, lang) { + return { + type: 'component', + componentName: 'compiler', + componentState: {source: editorId, lang: lang} + }; + }, + getCompilerWith: function (editorId, filters, options, compilerId) { + return { + type: 'component', + componentName: 'compiler', + componentState: { + source: editorId, + filters: filters, + options: options, + compiler: compilerId } - return ret; - }, - - getCfgView: function () { - return { - type: 'component', - componentName: 'cfg', - componentState: {} - }; - }, - getCfgViewWith: function (id, editorid) { - return { - type: 'component', - componentName: 'cfg', - componentState: { - id: id, - editorid: editorid - } - }; - }, - getConformanceView: function (editorid, source) { - return { - type: 'component', - componentName: 'conformance', - componentState: { - editorid: editorid, - source: source - } - }; + }; + }, + getEditor: function (id, langId) { + return { + type: 'component', + componentName: 'codeEditor', + componentState: {id: id, lang: langId} + }; + }, + getEditorWith: function (id, source, options) { + return { + type: 'component', + componentName: 'codeEditor', + componentState: {id: id, source: source, options: options} + }; + }, + getOutput: function (compiler, editor) { + return { + type: 'component', + componentName: 'output', + componentState: {compiler: compiler, editor: editor} + }; + }, + getDiff: function () { + return { + type: 'component', + componentName: 'diff', + componentState: {} + }; + }, + getOptView: function () { + return { + type: 'component', + componentName: 'opt', + componentState: {} + }; + }, + getOptViewWith: function (id, source, optimization, compilerName, editorid) { + return { + type: 'component', + componentName: 'opt', + componentState: { + id: id, + source: source, + optOutput: optimization, + compilerName: compilerName, + editorid: editorid + } + }; + }, + getAstView: function () { + return { + type: 'component', + componentName: 'ast', + componentState: {} + }; + }, + getAstViewWith: function (id, source, astOutput, compilerName, editorid) { + return { + type: 'component', + componentName: 'ast', + componentState: { + id: id, + source: source, + astOutput: astOutput, + compilerName: compilerName, + editorid: editorid + } + }; + }, + getGccDumpView: function () { + return { + type: 'component', + componentName: 'gccdump', + componentState: {} + }; + }, + getGccDumpViewWith: function (id, compilerName, editorid, gccDumpOutput) { + var ret = { + type: 'component', + componentName: 'gccdump', + componentState: { + _compilerid: id, + _compilerName: compilerName, + _editorid: editorid + } + }; + if (gccDumpOutput) { + ret.treeDump = gccDumpOutput.treeDump; + ret.rtlDump = gccDumpOutput.rtlDump; + ret.selectedPass = gccDumpOutput.selectedPass; } - }; + return ret; + }, -}); + getCfgView: function () { + return { + type: 'component', + componentName: 'cfg', + componentState: {} + }; + }, + getCfgViewWith: function (id, editorid) { + return { + type: 'component', + componentName: 'cfg', + componentState: { + id: id, + editorid: editorid + } + }; + }, + getConformanceView: function (editorid, source) { + return { + type: 'component', + componentName: 'conformance', + componentState: { + editorid: editorid, + source: source + } + }; + } +}; diff --git a/static/conformance-view.js b/static/conformance-view.js index 978e2bdf7..eaa3d90d2 100644 --- a/static/conformance-view.js +++ b/static/conformance-view.js @@ -39,7 +39,7 @@ function Conformance(hub, container, state) { this.domRoot.html($('#conformance').html()); this.selectorList = this.domRoot.find('.compiler-list'); this.addCompilerButton = this.domRoot.find('.add-compiler'); - this.selectorTemplate = $('#compiler-selector .compiler-row'); + this.selectorTemplate = $('#compiler-selector').find('.compiler-row'); this.editorId = state.editorid; this.nextSelectorId = 0; this.maxCompilations = options.cvCompilerCountMax || 6; @@ -160,6 +160,7 @@ Conformance.prototype.addCompilerSelector = function (config) { this.handleToolbarUI(); this.saveState(); }; + Conformance.prototype.removeCompilerSelector = function (cv) { _.each(this.selectorList.children(), function (row) { var child = $(row); @@ -252,11 +253,21 @@ Conformance.prototype.handleToolbarUI = function () { Conformance.prototype.handleStatusIcon = function (element, status) { if (!element) return; - element.attr("class", "status glyphicon glyphicon-" + (status.code === 3 ? "remove-sign" : (status.code === 2 ? "info-sign" : "ok-sign"))) + + function glyphClass(code) { + return code === 3 ? "remove-sign" : (code === 2 ? "info-sign" : "ok-sign"); + } + + function ariaLabel(code) { + return code === 3 ? "Compilation failed!" : (code === 2 ? "Compiled with warnings" : "No warnings"); + } + + element + .attr("class", "status glyphicon glyphicon-" + glyphClass(status.code)) .css("visibility", status.code === 0 ? "hidden" : "visible") .css("color", status.code === 3 ? "red" : (status.code === 2 ? "yellow" : "green")) .attr("title", status.text) - .attr("aria-label", status.code === 3 ? "Compilation failed!" : (status.code === 2 ? "Compiled with warnings" : "Compiled without warnings")) + .attr("aria-label", ariaLabel(status.code)) .attr("data-status", status.code); }; diff --git a/static/d-mode.js b/static/d-mode.js index 70398adf1..1fee61493 100644 --- a/static/d-mode.js +++ b/static/d-mode.js @@ -155,7 +155,7 @@ function definition() { ], // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], [/@symbols/, { cases: { @@ -185,7 +185,7 @@ function definition() { }], // numbers - [/\d*\.\d+([eE][\-+]?\d+)?[fFdD]?/, 'number.float'], + [/\d*\.\d+([eE][-+]?\d+)?[fFdD]?/, 'number.float'], [/0[xX][0-9a-fA-F_]*[0-9a-fA-F][Ll]?/, 'number.hex'], [/0[0-7_]*[0-7][Ll]?/, 'number.octal'], [/0[bB][0-1_]*[0-1][Ll]?/, 'number.binary'], @@ -213,17 +213,17 @@ function definition() { ], comment: [ - [/[^\/*]+/, 'comment'], + [/[^/*]+/, 'comment'], [/\*\//, 'comment', '@pop'], - [/[\/*]/, 'comment'] + [/[/*]/, 'comment'] ], nestingcomment: [ - [/[^\/+]+/, 'comment'], + [/[^/+]+/, 'comment'], [/\/\+/, 'comment', '@push'], [/\/\+/, 'comment.invalid'], [/\+\//, 'comment', '@pop'], - [/[\/+]/, 'comment'] + [/[/+]/, 'comment'] ], string: [ @@ -234,7 +234,7 @@ function definition() { ], rawstring: [ - [/[^\`]/, "string"], + [/[^`]/, "string"], [/`/, "string", "@pop"] ] } diff --git a/static/gccdump-rtl-gimple-mode.js b/static/gccdump-rtl-gimple-mode.js index 3d458f7fb..81e602f8a 100644 --- a/static/gccdump-rtl-gimple-mode.js +++ b/static/gccdump-rtl-gimple-mode.js @@ -26,270 +26,269 @@ // POSSIBILITY OF SUCH DAMAGE. // this is mostly based on 'mylang' example from https://microsoft.github.io/monaco-editor/monarch.html -define(function (require) { - "use strict"; - var monaco = require('monaco'); - function definition() { - return { - // Set defaultToken to invalid to see what you do not tokenize yet - // defaultToken: 'invalid', +"use strict"; +var monaco = require('monaco'); - keywords: [ - 'abstract', 'continue', 'for', 'new', 'switch', 'assert', 'goto', 'do', - 'if', 'private', 'this', 'break', 'protected', 'throw', 'else', 'public', - 'enum', 'return', 'catch', 'try', 'interface', 'static', 'class', - 'finally', 'const', 'super', 'while', 'true', 'false', +function definition() { + return { + // Set defaultToken to invalid to see what you do not tokenize yet + // defaultToken: 'invalid', - // Generated using the following: - // #define DEF_RTL_EXPR(a,b,c,d) b, - // keyword: [ - // #include - // ], - // And by invoking the cpp : - // cpp -P -I/path/to/gcc/gcc/ + keywords: [ + 'abstract', 'continue', 'for', 'new', 'switch', 'assert', 'goto', 'do', + 'if', 'private', 'this', 'break', 'protected', 'throw', 'else', 'public', + 'enum', 'return', 'catch', 'try', 'interface', 'static', 'class', + 'finally', 'const', 'super', 'while', 'true', 'false', - // All RTL classes. - "UnKnown", - "value", - "debug_expr", - "expr_list", - "insn_list", - "int_list", - "sequence", - "address", - "debug_insn", - "insn", - "jump_insn", - "call_insn", - "jump_table_data", - "barrier", - "code_label", - "note", - "cond_exec", - "parallel", - "asm_input", - "asm_operands", - "unspec", - "unspec_volatile", - "addr_vec", - "addr_diff_vec", - "prefetch", - "set", - "use", - "clobber", - "call", - "return", - "simple_return", - "eh_return", - "trap_if", - "const_int", - "const_fixed", - "const_double", - "const_vector", - "const_string", - "const", - "pc", - "reg", - "scratch", - "subreg", - "strict_low_part", - "concat", - "concatn", - "mem", - "label_ref", - "symbol_ref", - "cc0", - "if_then_else", - "compare", - "plus", - "minus", - "neg", - "mult", - "ss_mult", - "us_mult", - "div", - "ss_div", - "us_div", - "mod", - "udiv", - "umod", - "and", - "ior", - "xor", - "not", - "ashift", - "rotate", - "ashiftrt", - "lshiftrt", - "rotatert", - "smin", - "smax", - "umin", - "umax", - "pre_dec", - "pre_inc", - "post_dec", - "post_inc", - "pre_modify", - "post_modify", - "ne", - "eq", - "ge", - "gt", - "le", - "lt", - "geu", - "gtu", - "leu", - "ltu", - "unordered", - "ordered", - "uneq", - "unge", - "ungt", - "unle", - "unlt", - "ltgt", - "sign_extend", - "zero_extend", - "truncate", - "float_extend", - "float_truncate", - "float", - "fix", - "unsigned_float", - "unsigned_fix", - "fract_convert", - "unsigned_fract_convert", - "sat_fract", - "unsigned_sat_fract", - "abs", - "sqrt", - "bswap", - "ffs", - "clrsb", - "clz", - "ctz", - "popcount", - "parity", - "sign_extract", - "zero_extract", - "high", - "lo_sum", - "vec_merge", - "vec_select", - "vec_concat", - "vec_duplicate", - "ss_plus", - "us_plus", - "ss_minus", - "ss_neg", - "us_neg", - "ss_abs", - "ss_ashift", - "us_ashift", - "us_minus", - "ss_truncate", - "us_truncate", - "fma", - "var_location", - "debug_implicit_ptr", - "entry_value", - "debug_parameter_ref" + // Generated using the following: + // #define DEF_RTL_EXPR(a,b,c,d) b, + // keyword: [ + // #include + // ], + // And by invoking the cpp : + // cpp -P -I/path/to/gcc/gcc/ + + // All RTL classes. + "UnKnown", + "value", + "debug_expr", + "expr_list", + "insn_list", + "int_list", + "sequence", + "address", + "debug_insn", + "insn", + "jump_insn", + "call_insn", + "jump_table_data", + "barrier", + "code_label", + "note", + "cond_exec", + "parallel", + "asm_input", + "asm_operands", + "unspec", + "unspec_volatile", + "addr_vec", + "addr_diff_vec", + "prefetch", + "set", + "use", + "clobber", + "call", + "return", + "simple_return", + "eh_return", + "trap_if", + "const_int", + "const_fixed", + "const_double", + "const_vector", + "const_string", + "const", + "pc", + "reg", + "scratch", + "subreg", + "strict_low_part", + "concat", + "concatn", + "mem", + "label_ref", + "symbol_ref", + "cc0", + "if_then_else", + "compare", + "plus", + "minus", + "neg", + "mult", + "ss_mult", + "us_mult", + "div", + "ss_div", + "us_div", + "mod", + "udiv", + "umod", + "and", + "ior", + "xor", + "not", + "ashift", + "rotate", + "ashiftrt", + "lshiftrt", + "rotatert", + "smin", + "smax", + "umin", + "umax", + "pre_dec", + "pre_inc", + "post_dec", + "post_inc", + "pre_modify", + "post_modify", + "ne", + "eq", + "ge", + "gt", + "le", + "lt", + "geu", + "gtu", + "leu", + "ltu", + "unordered", + "ordered", + "uneq", + "unge", + "ungt", + "unle", + "unlt", + "ltgt", + "sign_extend", + "zero_extend", + "truncate", + "float_extend", + "float_truncate", + "float", + "fix", + "unsigned_float", + "unsigned_fix", + "fract_convert", + "unsigned_fract_convert", + "sat_fract", + "unsigned_sat_fract", + "abs", + "sqrt", + "bswap", + "ffs", + "clrsb", + "clz", + "ctz", + "popcount", + "parity", + "sign_extract", + "zero_extract", + "high", + "lo_sum", + "vec_merge", + "vec_select", + "vec_concat", + "vec_duplicate", + "ss_plus", + "us_plus", + "ss_minus", + "ss_neg", + "us_neg", + "ss_abs", + "ss_ashift", + "us_ashift", + "us_minus", + "ss_truncate", + "us_truncate", + "fma", + "var_location", + "debug_implicit_ptr", + "entry_value", + "debug_parameter_ref" + ], + + typeKeywords: [ + 'boolean', 'double', 'byte', 'int', 'short', 'char', 'void', 'long', 'float' + ], + + operators: [ + '=', '>', '<', '!', '~', '?', ':', '==', '<=', '>=', '!=', + '&&', '||', '++', '--', '+', '-', '*', '/', '&', '|', '^', '%', + '<<', '>>', '>>>', '+=', '-=', '*=', '/=', '&=', '|=', '^=', + '%=', '<<=', '>>=', '>>>=' + ], + + // we include these common regular expressions + symbols: /[=>](?!@symbols)/, '@brackets'], + [/@symbols/, { + cases: { + '@operators': 'operator', + '@default': '' + } + }], + + // @ annotations. + // As an example, we emit a debugging log message on these tokens. + // Note: message are supressed during the first load -- change some lines to see them. + // [/@\s*[a-zA-Z_\$][\w\$]*/, { token: 'annotation', log: 'annotation token: $0' }], + + // numbers + [/\d*\.\d+([eE][-+]?\d+)?/, 'number.float'], + [/0[xX][0-9a-fA-F]+/, 'number.hex'], + [/\d+/, 'number'], + + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + + // strings + [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string + [/"/, {token: 'string.quote', bracket: '@open', next: '@string'}], + + // characters + [/'[^\\']'/, 'string'], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], + [/'/, 'string.invalid'] ], - typeKeywords: [ - 'boolean', 'double', 'byte', 'int', 'short', 'char', 'void', 'long', 'float' + comment: [ + [/[^/*]+/, 'comment'], + [/\/\*/, 'comment', '@push'], // nested comment + ["\\*/", 'comment', '@pop'], + [/[/*]/, 'comment'] ], - operators: [ - '=', '>', '<', '!', '~', '?', ':', '==', '<=', '>=', '!=', - '&&', '||', '++', '--', '+', '-', '*', '/', '&', '|', '^', '%', - '<<', '>>', '>>>', '+=', '-=', '*=', '/=', '&=', '|=', '^=', - '%=', '<<=', '>>=', '>>>=' + string: [ + [/[^\\"]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/"/, {token: 'string.quote', bracket: '@close', next: '@pop'}] ], - // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], - [/@symbols/, { - cases: { - '@operators': 'operator', - '@default': '' - } - }], - - // @ annotations. - // As an example, we emit a debugging log message on these tokens. - // Note: message are supressed during the first load -- change some lines to see them. - // [/@\s*[a-zA-Z_\$][\w\$]*/, { token: 'annotation', log: 'annotation token: $0' }], - - // numbers - [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], - [/0[xX][0-9a-fA-F]+/, 'number.hex'], - [/\d+/, 'number'], - - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string - [/"/, {token: 'string.quote', bracket: '@open', next: '@string'}], - - // characters - [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], - [/'/, 'string.invalid'] - ], - - comment: [ - [/[^\/*]+/, 'comment'], - [/\/\*/, 'comment', '@push'], // nested comment - ["\\*/", 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, {token: 'string.quote', bracket: '@close', next: '@pop'}] - ], - - whitespace: [ - [/[ \t\r\n]+/, 'white'], - [/\/\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'], - [/^;;.*$/, 'comment'] - - ] - } - }; - } - - monaco.languages.register({id: 'gccdump-rtl-gimple'}); - monaco.languages.setMonarchTokensProvider('gccdump-rtl-gimple', definition()); -}); +monaco.languages.register({id: 'gccdump-rtl-gimple'}); +monaco.languages.setMonarchTokensProvider('gccdump-rtl-gimple', definition()); diff --git a/static/gccdump-view.js b/static/gccdump-view.js index f1519431a..f7d4f0fbb 100644 --- a/static/gccdump-view.js +++ b/static/gccdump-view.js @@ -24,299 +24,297 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. -define(function (require) { - 'use strict'; +'use strict'; - var FontScale = require('fontscale'); - var monaco = require('monaco'); - var Toggles = require('toggles'); - require('gccdump-rtl-gimple-mode'); - var _ = require('underscore'); - var $ = require('jquery'); +var FontScale = require('fontscale'); +var monaco = require('monaco'); +var Toggles = require('toggles'); +require('gccdump-rtl-gimple-mode'); +var _ = require('underscore'); +var $ = require('jquery'); - require('selectize'); +require('selectize'); - function GccDump(hub, container, state) { - this.container = container; - this.eventHub = hub.createEventHub(); - this.domRoot = container.getElement(); - this.domRoot.html($('#gccdump').html()); - this.filters = new Toggles(this.domRoot.find('.dump-filters'), state); +function GccDump(hub, container, state) { + this.container = container; + this.eventHub = hub.createEventHub(); + this.domRoot = container.getElement(); + this.domRoot.html($('#gccdump').html()); + this.filters = new Toggles(this.domRoot.find('.dump-filters'), state); - this._currentDecorations = []; + this._currentDecorations = []; - // until we get our first result from compilation backend with all fields, - // disable UI callbacks. - this.uiIsReady = false; - // disable filter buttons - this.domRoot.find('.dump-filters .btn') - .each(function () { - $(this).addClass('disabled'); - }); - - this.gccDumpEditor = monaco.editor.create(this.domRoot.find('.monaco-placeholder')[0], { - value: '', - scrollBeyondLastLine: false, - readOnly: true, - glyphMargin: true, - quickSuggestions: false, - fixedOverflowWidgets: true, - fontFamily: 'monospace', - minimap: { - maxColumn: 80 - }, - lineNumbersMinChars: 3 + // until we get our first result from compilation backend with all fields, + // disable UI callbacks. + this.uiIsReady = false; + // disable filter buttons + this.domRoot.find('.dump-filters .btn') + .each(function () { + $(this).addClass('disabled'); }); - var selectize = this.domRoot.find('.gccdump-pass-picker').selectize({ - sortField: 'name', - valueField: 'name', - labelField: 'name', - searchField: ['name'], - options: [], - items: [] + this.gccDumpEditor = monaco.editor.create(this.domRoot.find('.monaco-placeholder')[0], { + value: '', + scrollBeyondLastLine: false, + readOnly: true, + glyphMargin: true, + quickSuggestions: false, + fixedOverflowWidgets: true, + fontFamily: 'monospace', + minimap: { + maxColumn: 80 + }, + lineNumbersMinChars: 3 + }); + + var selectize = this.domRoot.find('.gccdump-pass-picker').selectize({ + sortField: 'name', + valueField: 'name', + labelField: 'name', + searchField: ['name'], + options: [], + items: [] + }); + + this.selectize = selectize[0].selectize; + this.selectize.disable(); + + // this is used to save internal state. + this.state = {}; + + this.state._compilerid = state._compilerid; + this.state._editorid = state._editorid; + this._compilerName = state._compilerName; + + this.fontScale = new FontScale(this.domRoot, state, this.gccDumpEditor); + this.fontScale.on('change', _.bind(this.saveState, this)); + + this.eventHub.on('compileResult', this.onCompileResult, this); + this.eventHub.on('compiler', this.onCompiler, this); + this.eventHub.on('compilerClose', this.onCompilerClose, this); + this.eventHub.on('settingsChange', this.onSettingsChange, this); + + this.eventHub.emit('gccDumpViewOpened', this.state._compilerid); + this.eventHub.emit('requestSettings'); + this.container.on('destroy', this.close, this); + + container.on('resize', this.resize, this); + container.on('shown', this.resize, this); + + if (state && state.selectedPass) { + this.state.selectedPass = state.selectedPass; + this.eventHub.emit('gccDumpPassSelected', + this.state._compilerid, + state.selectedPass, + false); + } + + this.eventHub.emit('gccDumpFiltersChanged', + this.state._compilerid, + this.getEffectiveFilters(), + false); + + this.saveState(); + this.setTitle(); + + // UI is ready, request compilation to get passes list and + // current output (if any) + this.eventHub.emit('gccDumpUIInit', this.state._compilerid); +} + +// Disable view's menu when invalid compiler has been +// selected after view is opened. +GccDump.prototype.onUiNotReady = function () { + this.filters.off('change'); + this.selectize.off('change'); + + // disable drop down menu and buttons + this.selectize.disable(); + this.domRoot.find('.dump-filters .btn') + .each(function () { + $(this).addClass('disabled'); }); +}; - this.selectize = selectize[0].selectize; - this.selectize.disable(); +GccDump.prototype.onUiReady = function () { + this.filters.on('change', _.bind(this.onFilterChange, this)); + this.selectize.on('change', _.bind(this.onPassSelect, this)); - // this is used to save internal state. - this.state = {}; + // enable drop down menu and buttons + this.selectize.enable(); + this.domRoot.find('.dump-filters .btn') + .each(function () { + $(this).removeClass('disabled'); + }); +}; - this.state._compilerid = state._compilerid; - this.state._editorid = state._editorid; - this._compilerName = state._compilerName; +GccDump.prototype.onPassSelect = function (passId) { + if (this.inhibitPassSelect !== true) { + this.eventHub.emit('gccDumpPassSelected', + this.state._compilerid, + passId, + true); + } + this.state.selectedPass = passId; + this.saveState(); +}; - this.fontScale = new FontScale(this.domRoot, state, this.gccDumpEditor); - this.fontScale.on('change', _.bind(this.saveState, this)); +// TODO: de-dupe with compiler etc +GccDump.prototype.resize = function () { + var topBarHeight = this.domRoot.find('.top-bar').outerHeight(true); + this.gccDumpEditor.layout({ + width: this.domRoot.width(), + height: this.domRoot.height() - topBarHeight + }); +}; - this.eventHub.on('compileResult', this.onCompileResult, this); - this.eventHub.on('compiler', this.onCompiler, this); - this.eventHub.on('compilerClose', this.onCompilerClose, this); - this.eventHub.on('settingsChange', this.onSettingsChange, this); +// Called after result from new compilation received +// if gccDumpOutput is false, cleans the select menu +GccDump.prototype.updatePass = function (filters, selectize, gccDumpOutput) { + var passes = gccDumpOutput ? gccDumpOutput.all : []; - this.eventHub.emit('gccDumpViewOpened', this.state._compilerid); - this.eventHub.emit('requestSettings'); - this.container.on('destroy', this.close, this); + // we are changing selectize but don't want any callback to + // trigger new compilation + this.inhibitPassSelect = true; - container.on('resize', this.resize, this); - container.on('shown', this.resize, this); - - if (state && state.selectedPass) { - this.state.selectedPass = state.selectedPass; - this.eventHub.emit('gccDumpPassSelected', - this.state._compilerid, - state.selectedPass, - false); + _.each(selectize.options, function (p) { + if (passes.indexOf(p.name) === -1) { + selectize.removeOption(p.name); } + }, this); + _.each(passes, function (p) { + selectize.addOption({ + name: p + }); + }, this); + + if (gccDumpOutput.selectedPass && gccDumpOutput.selectedPass !== '') { + selectize.addItem(gccDumpOutput.selectedPass, true); + } else { + selectize.clear(true); + } + + this.eventHub.emit('gccDumpPassSelected', + this.state._compilerid, + gccDumpOutput.selectedPass, + false); + + this.inhibitPassSelect = false; +}; + +GccDump.prototype.onCompileResult = function (id, compiler, result) { + if (this.state._compilerid !== id) return; + + if (result.hasGccDumpOutput && result.gccDumpOutput.syntaxHighlight) { + monaco.editor.setModelLanguage(this.gccDumpEditor.getModel(), 'gccdump-rtl-gimple'); + } else { + monaco.editor.setModelLanguage(this.gccDumpEditor.getModel(), null); + } + + if (result.hasGccDumpOutput) { + var currOutput = result.gccDumpOutput.currentPassOutput; + + // if result contains empty selected pass, probably means + // we requested an invalid/outdated pass. + if (result.gccDumpOutput.selectedPass === '') { + this.selectize.clear(true); + this.state.selectedPass = ''; + } + this.updatePass(this.filters, this.selectize, result.gccDumpOutput); + this.showGccDumpResults(currOutput); + + // enable UI on first successful compilation or after an invalid compiler selection (eg. clang) + if (!this.uiIsReady) { + this.uiIsReady = true; + this.onUiReady(); + } + } else { + this.selectize.clear(true); + this.state.selectedPass = ''; + this.updatePass(this.filters, this.selectize, false); + this.showGccDumpResults(''); + this.uiIsReady = false; + this.onUiNotReady(); + } + + this.saveState(); +}; + +GccDump.prototype.setTitle = function () { + this.container.setTitle((this._compilerName || '') + + ' GCC Tree/RTL Viewer (Editor #' + this.state._editorid + ', Compiler #' + this.state._compilerid + ')'); +}; + +GccDump.prototype.showGccDumpResults = function (results) { + this.gccDumpEditor.setValue(results); +}; + +GccDump.prototype.onCompiler = function (id, compiler, options, editorid) { + if (id === this.state._compilerid) { + this._compilerName = compiler ? compiler.name : ''; + this.state._editorid = editorid; + this.setTitle(); + } +}; + +GccDump.prototype.onCompilerClose = function (id) { + if (id === this.state._compilerid) { + // We can't immediately close as an outer loop somewhere in GoldenLayout is iterating over + // the hierarchy. We can't modify while it's being iterated over. + this.close(); + _.defer(function (self) { + self.container.close(); + }, this); + } +}; + +GccDump.prototype.getEffectiveFilters = function () { + return this.filters.get(); +}; + +GccDump.prototype.onFilterChange = function () { + this.saveState(); + + if (this.inhibitPassSelect !== true) { this.eventHub.emit('gccDumpFiltersChanged', this.state._compilerid, this.getEffectiveFilters(), - false); - - this.saveState(); - this.setTitle(); - - // UI is ready, request compilation to get passes list and - // current output (if any) - this.eventHub.emit('gccDumpUIInit', this.state._compilerid); + true); } +}; - // Disable view's menu when invalid compiler has been - // selected after view is opened. - GccDump.prototype.onUiNotReady = function () { - this.filters.off('change'); - this.selectize.off('change'); - - // disable drop down menu and buttons - this.selectize.disable(); - this.domRoot.find('.dump-filters .btn') - .each(function () { - $(this).addClass('disabled'); - }); - }; - - GccDump.prototype.onUiReady = function () { - this.filters.on('change', _.bind(this.onFilterChange, this)); - this.selectize.on('change', _.bind(this.onPassSelect, this)); - - // enable drop down menu and buttons - this.selectize.enable(); - this.domRoot.find('.dump-filters .btn') - .each(function () { - $(this).removeClass('disabled'); - }); - }; - - GccDump.prototype.onPassSelect = function (passId) { - if (this.inhibitPassSelect !== true) { - this.eventHub.emit('gccDumpPassSelected', - this.state._compilerid, - passId, - true); - } - this.state.selectedPass = passId; - this.saveState(); - }; - - // TODO: de-dupe with compiler etc - GccDump.prototype.resize = function () { - var topBarHeight = this.domRoot.find('.top-bar').outerHeight(true); - this.gccDumpEditor.layout({ - width: this.domRoot.width(), - height: this.domRoot.height() - topBarHeight - }); - }; - - // Called after result from new compilation received - // if gccDumpOutput is false, cleans the select menu - GccDump.prototype.updatePass = function (filters, selectize, gccDumpOutput) { - var passes = gccDumpOutput ? gccDumpOutput.all : []; - - // we are changing selectize but don't want any callback to - // trigger new compilation - this.inhibitPassSelect = true; - - _.each(selectize.options, function (p) { - if (passes.indexOf(p.name) === -1) { - selectize.removeOption(p.name); - } - }, this); - - _.each(passes, function (p) { - selectize.addOption({ - name: p - }); - }, this); - - if (gccDumpOutput.selectedPass && gccDumpOutput.selectedPass !== '') { - selectize.addItem(gccDumpOutput.selectedPass, true); - } else { - selectize.clear(true); - } - - this.eventHub.emit('gccDumpPassSelected', - this.state._compilerid, - gccDumpOutput.selectedPass, - false); - - this.inhibitPassSelect = false; - }; - - GccDump.prototype.onCompileResult = function (id, compiler, result) { - if (this.state._compilerid !== id) return; - - if (result.hasGccDumpOutput && result.gccDumpOutput.syntaxHighlight) { - monaco.editor.setModelLanguage(this.gccDumpEditor.getModel(), 'gccdump-rtl-gimple'); - } else { - monaco.editor.setModelLanguage(this.gccDumpEditor.getModel(), null); - } - - if (result.hasGccDumpOutput) { - var currOutput = result.gccDumpOutput.currentPassOutput; - - // if result contains empty selected pass, probably means - // we requested an invalid/outdated pass. - if (result.gccDumpOutput.selectedPass === '') { - this.selectize.clear(true); - this.state.selectedPass = ''; - } - this.updatePass(this.filters, this.selectize, result.gccDumpOutput); - this.showGccDumpResults(currOutput); - - // enable UI on first successful compilation or after an invalid compiler selection (eg. clang) - if (!this.uiIsReady) { - this.uiIsReady = true; - this.onUiReady(); - } - } else { - this.selectize.clear(true); - this.state.selectedPass = ''; - this.updatePass(this.filters, this.selectize, false); - this.showGccDumpResults(''); - this.uiIsReady = false; - this.onUiNotReady(); - } - - this.saveState(); - }; - - GccDump.prototype.setTitle = function () { - this.container.setTitle((this._compilerName || '') + - ' GCC Tree/RTL Viewer (Editor #' + this.state._editorid + ', Compiler #' + this.state._compilerid + ')'); - }; - - GccDump.prototype.showGccDumpResults = function (results) { - this.gccDumpEditor.setValue(results); - }; - - GccDump.prototype.onCompiler = function (id, compiler, options, editorid) { - if (id === this.state._compilerid) { - this._compilerName = compiler ? compiler.name : ''; - this.state._editorid = editorid; - this.setTitle(); - } - }; - - GccDump.prototype.onCompilerClose = function (id) { - if (id === this.state._compilerid) { - // We can't immediately close as an outer loop somewhere in GoldenLayout is iterating over - // the hierarchy. We can't modify while it's being iterated over. - this.close(); - _.defer(function (self) { - self.container.close(); - }, this); - } - }; - - GccDump.prototype.getEffectiveFilters = function () { - return this.filters.get(); - }; - - GccDump.prototype.onFilterChange = function () { - this.saveState(); - - if (this.inhibitPassSelect !== true) { - this.eventHub.emit('gccDumpFiltersChanged', - this.state._compilerid, - this.getEffectiveFilters(), - true); - } - }; - - GccDump.prototype.saveState = function () { - var state = this.currentState(); - this.container.setState(state); - this.fontScale.addState(state); - }; - - GccDump.prototype.currentState = function () { - var filters = this.getEffectiveFilters(); - return { - _compilerid: this.state._compilerid, - _editorid: this.state._editorid, - selectedPass: this.state.selectedPass, - treeDump: filters.treeDump, - rtlDump: filters.rtlDump - }; - }; - - GccDump.prototype.onSettingsChange = function (newSettings) { - this.gccDumpEditor.updateOptions({ - minimap: { - enabled: newSettings.showMinimap - } - }); - }; - - GccDump.prototype.close = function () { - this.eventHub.unsubscribe(); - this.eventHub.emit('gccDumpViewClosed', this.state._compilerid); - this.gccDumpEditor.dispose(); - }; +GccDump.prototype.saveState = function () { + var state = this.currentState(); + this.container.setState(state); + this.fontScale.addState(state); +}; +GccDump.prototype.currentState = function () { + var filters = this.getEffectiveFilters(); return { - GccDump: GccDump + _compilerid: this.state._compilerid, + _editorid: this.state._editorid, + selectedPass: this.state.selectedPass, + treeDump: filters.treeDump, + rtlDump: filters.rtlDump }; -}); +}; + +GccDump.prototype.onSettingsChange = function (newSettings) { + this.gccDumpEditor.updateOptions({ + minimap: { + enabled: newSettings.showMinimap + } + }); +}; + +GccDump.prototype.close = function () { + this.eventHub.unsubscribe(); + this.eventHub.emit('gccDumpViewClosed', this.state._compilerid); + this.gccDumpEditor.dispose(); +}; + +module.exports = { + GccDump: GccDump +}; diff --git a/static/haskell-mode.js b/static/haskell-mode.js index 47ca4290f..55487ed08 100644 --- a/static/haskell-mode.js +++ b/static/haskell-mode.js @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2018, Matt Godbolt, Rubén Rincón, byteally +// Copyright (c) 2018, Rubén Rincón // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -22,383 +22,6 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. - "use strict"; -// From https://github.com/byteally/monaco-haskell -// It does not work right now. Here as a reminder until the author fixes it -function definition() { - return { - module: /^(module)\b/, - import: /^(import)\b/, - module_name: /([A-Z][\w']*)(\.[A-Z][\w']*)*/, - module_exports: /([A-Z][\w']*)(\.[A-Z][\w']*)*/, - target: /([A-Z][\w']*)(\.[A-Z][\w']*)*/, - invalid: /[a-z]+/, - datatype: /[A-Z][\w]+/, - datatypekey: /Int|Float|Text/, - functions: /[a-z]+/, - datacons: /[A-Z][\w]+/, - typcons: /\s*[A-Z][\w]+/, - text: /[A-Z][\w]+/, - classname: /\s*[A-Z][\w]+/, - arguments: /[a-z][\w]*/, - reservedid: /qualified|hiding|case|default|deriving|do|else|if|import|in|infix|infixr|let|of|then|type|where|show|_/, - tokenizer: { - root: [ - [/(@module)/, 'keyword.module.haskell', '@module'], - [/@import/, 'keyword.module.haskell', '@import'], - [/\bdata\b(?=@typcons)/, 'keyword', '@typcons'], - [/\bnewtype\b(?=\s*@typcons)/, 'keyword', '@typcons'], - [/\bclass\b(?=\s*@classname)/, 'keyword', '@classname'], - [/\bclass\b(?=\s*\()/, 'keyword', '@classname'], - [/@reservedid/, 'keyword'], - [/[a-z][\w]+(?=\s*?=)/, 'binderas', '@binder'], - [/[a-z][\w]+(?=\s*::)/, 'binderad', '@typconss'], - [/[a-z][\w]+(?=\s*?[a-z]\w*)/, 'binder', '@typconss'], - [/[a-z][\w]+(?=\s*?::\s*?@datatypekey)/, 'bind', '@binder'], - [/[a-z][\w]+(?=\s*?=\s*?@datacons)/, 'bindings'], - {include: '@whitespace'}, - {include: '@comment'} - ], - import: [ - [/@module_name/, 'storage.module,haskell'], - [/(@module_name)(?=\s*as)/, 'storage.module.haskell'], - [/\b(qualified)\b(?=\s*@module_name)/, 'keyword'], - [/(@module_name)(?=\s*?\()/, 'storage.module.haskell'], - [/(@module_name)(?=\s*\bhiding\b)/, 'storage.module.haskell'], - [/\b(hiding)\b(?=\s*?\()/, 'keyword'], - [/\b(as)\b(?=\s*@module_name)/, 'keyword'], - [/\(/, 'openbracketss', '@functions'], - {include: '@comment'} - //{include:'@blockComment'} - ], - module: [ - [/(@module_name)/, 'storage.module.haskell'], - [/\(/, 'openbracket', '@module_exports'], - [/@reservedid/, 'keyword', '@pop'], - [/@invalid/, 'invalid'], - [/,/, 'commas'], - {include: '@whitespace'}, - {include: '@comment'} - //{include:'@blockComment'} - ], - functions: [ - [/@datatype/, 'dcataype', '@datatype'], - [/@functions/, 'functions'], - [/,/, 'commas'], - [/\)(?=\))/, 'closebracket'], - [/\)/, 'closebracketalla', '@popall'], - {include: '@comment'} - //{include:'@blockComment'} - ], - typconss: [ - [/=/, 'eqals'], - [/\bundefined\b/, 'val', '@all'], - [/\bclass\b(?=\s*@classname)/, 'keyword', '@classname'], - [/\bclass\b(?=\s*\()/, 'keyword', '@classname'], - [/\binstance\b/, 'keyword', '@classname'], - [/\bdata\b(?=@typcons)/, 'keyword', '@typcons'], - [/\bnewtype\b(?=\s*@typcons)/, 'keyword', '@typcons'], - [/@reservedid/, 'keyword', '@function'], - [/[a-z]\w*/, 'arguments121'], - [/[a-z][\w]+(?=\s*=)/, 'binderad', '@datacons'], - [/[a-z][\w]+(?=\s*::)/, 'binderad', '@typconss'], - [/[a-z][\w]+(?=\s*[a-z]\w*)/, 'binderad', '@typconss'], - [/[a-z]\w*/, 'arguments121'], - [/::/, 'dcol', '@datacons'], - [/->/, 'pipes', '@binder'], - {include: '@whitespace'}, - {include: '@comment'} - //{include:'@blockComment'} - ], - - function: [ - [/@reservedid/, 'keyword'], - [/@datatypekey/, 'dtype'], - [/[a-z][\w]+(?=\s*::)/, 'binderad', '@typconss'], - [/[a-z][\w]+(?=\s*?[a-z]\w*)/, 'binder', '@typconss'], - [/[a-z]\w*/, 'arguments12'], - [/::/, 'dcol'], - [/->/, 'pipe'], - [/\bclass\b(?=\s*@classname)/, 'keyword', '@classname'], - [/\bclass\b(?=\s*\()/, 'keyword', '@classname'], - [/\binstance\b/, 'keyword', '@classname'], - [/\bdata\b(?=@typcons)/, 'keyword', '@typcons'], - [/\bnewtype\b(?=\s*@typcons)/, 'keyword'], - {include: '@comment'} - //{include:'@blockComment'} - ], - typcons: [ - [/=>/, 'pipes'], - [/->/, 'pipe', '@bind'], - [/\bclass\b(?=\s*@classname)/, 'keyword', '@classname'], - [/\bclass\b(?=\s*\()/, 'keyword', '@classname'], - [/\binstance\b/, 'keyword', '@classname'], - [/\bdata\b(?=@typcons)/, 'keyword', '@typcons'], - [/\bnewtype\b(?=\s*@typcons)/, 'keyword'], - [/@reservedid(?=\s*\()/, 'keyword', '@typcons'], - [/@reservedid(?=\s*[A-Z][\w]+)/, 'keyword', '@typcons'], - [/@reservedid/, 'keyword', '@binder'], - [/@datatypekey/, 'dtypes2'], - [/[A-Z][\w]+(?=\s*,)/, 'classname', '@types'], - [/[A-Z][\w]+(?=\s*[a-z][\w]*\s*,)/, 'classname', '@types'], - [/@arguments(?=\s*,\s*)/, 'argument', '@types'], - - [/[A-Z][\w]+/, 'typecons'], - [/[a-z][\w]+(?=\s*?=)/, 'binderas', '@binder'], - [/[a-z][\w]+(?=\s*::)/, 'binderad', '@typconss'], - [/[a-z][\w]+(?=\s*?[a-z]\w*)/, 'bind', '@typconss'], - [/[a-z][\w]+(?=\s*?::\s*?@datatypekey)/, 'bind', '@binder'], - [/[a-z][\w]+(?=\s*?=\s*?@datacons)/, 'bindings'], - [/{/, 'oopen', '@initialise'], - [/[a-z]\w*/, 'arguments13'], - - [/\(/, 'open_bracket'], - [/=/, 'Equalss', '@datacons'], - [/,/, 'commaa'], - [/::/, 'colondouble', '@datacons'], - [/\)/, 'closebrak', '@initialise'], - [/\)(?=\s* \t\r\n\bdata\b)/, 'closed', '@popall'], - {include: '@whitespace'}, - {include: '@comment'} -// {include:'@blockComment'} - ], - bind: [ - [/@datatypekey/, 'dtyp', '@typconss'], - [/[a-z][\w]*/, 'typvar', '@typconss'], - [/\(/, 'opens', '@typcons'], - {include: '@whitespace'} - ], - types: [ - [/[a-z][\w]*/, 'argument123'], - [/,/, 'commaa'], - [/[A-Z][\w]*/, 'classname'], - [/\)/, 'closex'], - [/=>/, 'pipe', '@type'], - {include: '@whitespace'}, - {include: '@comment'} -// {include:'@blockComment'} - ], - datacons: [ - [/=/, 'Equalst'], - [/\bclass\b(?=\s*@classname)/, 'keyword', '@classname'], - [/\bclass\b(?=\s*\()/, 'keyword', '@classname'], - - [/\bundefined\b/, 'val', '@all'], - [/\bnewtype\b(?=\s*@typcons)/, 'keyword', '@typcons'], - [/\binstance\b/, 'keyword', '@classname'], - [/[a-z][\w]*(?=\s*?->)/, 'typvar', '@typcons'], - - [/@reservedid(?=\s*\()/, 'keyword', '@typcons'], - [/@datatypekey(?=\s*[a-z]\w*)/, 'dtypess1', '@typcons'], - [/@datatypekey/, 'dtypes1'], - [/@reservedid(?=\s*[A-Z][\w]+)/, 'keyword', '@typcons'], - [/@reservedid/, 'keyword'], - [/[A-Z][\w]+(?=\s*=>)/, 'classname', '@type'], - [/[A-Z][\w]+(?=\s*[a-z][\w]*\s*=>)/, 'classnames', '@type'], - [/[a-z][\w]+(?=\s*?::)/, 'bindera', '@typconss'], - [/[a-z][\w]+(?=\s*?[a-z]\w*)/, 'binde', '@typconss'], - - [/[a-z][\w]+/, 'binder', '@typconss'], - - [/\bdata\b(?=@typcons)/, 'keyword', '@typcons'], - - [/@datacons/, 'datacon'], - [/@reservedid/, 'keyword', '@binder'], - [/@datacons(?=\s*@datatypekey)/, 'datacons'], - - [/[a-z][\w]+(?=\s*?::\s*@datatype,)/, 'bindera', '@binder'], - [/[a-z][\w]+(?=\s*?::\s*@datatype,)/, 'bindera', '@binder'], - [/[a-z][\w]+(?=\s*?=\s*(\d)+,)/, 'binderb', '@binder'], - [/[a-z][\w]+(?=\s*?=\s*(\d)+)/, 'binderc', '@binder'], - [/[a-z][\w]+(?=\s*?=\s*"(\w)+.+?")/, 'binderd', '@binder'], - [/[a-z][\w]+(?=\s*?=\s*"(\w)+.+?",)/, 'bindere', '@binder'], - [/{/, 'openbracketd', '@initialise'], - [/"\w+.+"/, 'type'], - [/\d+/, 'type'], - [/->/, 'pip', '@binder'], - [/,/, 'commas33', '@initialise'], - [/\|/, 'alternate'], - [/\(/, 'open', '@typcons'], - [/}/, 'clos', '@initialise'], - {include: '@whitespace'}, - {include: '@comment'} -// {include:'@blockComment'} - ], - type: [ - [/[a-z][\w]*/, 'argument'], - [/,/, 'commas'], - [/=>/, 'pipe'], - [/[A-Z][\w]*/, 'typcons'], - [/->/, 'pipe', '@binder'], - {include: '@whitespace'}, - {include: '@comment'} -// {include:'@blockComment'} - ], - all: [ - [/=/, 'equals'], - - [/\binstance\b/, 'keyword', '@classname'], - [/\bclass\b(?=\s*@classname)/, 'keyword', '@classname'], - [/\bclass\b(?=\s*\()/, 'keyword', '@classname'], - [/\bdata\b(?=@typcons)/, 'keyword', '@typcons'], - - [/\bnewtype\b(?=\s*@typcons)/, 'keyword'], - [/@reservedid/, 'keyword', '@typconss'], - [/[A-Z][\w]+/, 'typecons', '@typcons'], - [/[a-z][\w]+(?=\s*=)/, 'binderad', '@typconss'], - [/[a-z][\w]+(?=\s*::)/, 'binderad', '@typconss'], - [/[a-z][\w]+(?=\s*?[a-z]\w*)/, 'binder', '@typconss'], - {include: '@comment'} -// {include:'@blockComment'} - ], - selectors: [ - [/[a-z][\w]+/, 'selectors'], - [/=/, 'Equalsto', '@datacons'], - [/"(\w)+.+"/, 'type'], - [/\d+/, 'type'], - [/}/, 'closeS'], - {include: '@comment'} -// {include:'@blockComment'} - ], - initialise: [ - [/\binstance\b/, 'keyword', '@classname'], - [/\bdata\b(?=\s*@typcons)/, 'keyword', '@typcons'], - [/\bnewtype\b(?=\s*@typcons)/, 'keyword', '@typcons'], - [/\bclass\b(?=\s*@classname)/, 'keyword', '@classname'], - [/\bclass\b(?=\s*\()/, 'keyword', '@classname'], - [/@datatypekey(?=\s*)/, 'datatype'], - [/{/, 'open'], - [/@reservedid/, 'keyword'], - [/\(/, 'opn', '@typcons'], - [/\|/, 'alternates', '@datacons'], - [/,/, 'comma3'], - - [/[a-z][\w]+(?=\s*?=\s*?\b@reservedid\b)/, 'binder', '@all'], - [/[a-z][\w]+(?=\s*?=\s*?\bundefined\b)/, 'binder', '@binder'], - [/[a-z][\w]+(?=\s*?=\s*?@datacons)/, 'bindings'], - [/[a-z][\w]+(?=\s*?::\s*@datatypekey)/, 'bindera', '@binder'], - [/[a-z][\w]+(?=\s*::)/, 'binder', '@binder'], - - [/[a-z][\w]+(?=\s*?::\s*@datatypekey,)/, 'binderb', '@binder'], - [/[a-z][\w]+(?=\s*?=\s*(\d)+,)/, 'binderc', '@binder'], - [/[a-z][\w]+(?=\s*?=\s*(\d)+)/, 'binderd', '@binder'], - [/[a-z][\w]+(?=\s*?=\s*"(\w)+.+?",)/, 'binders', '@binder'], - [/[a-z][\w]+(?=\s*?=\s*"(\w)+.+?")/, 'bindere', '@binder'], - - [/[a-z][\w]+(?=\s*[a-z]\w*)/, 'binder', '@typconss'], - [/::/, 'doublecolons', '@datacons'], - [/=/, 'Equalsto', '@datacons'], - {include: '@whitespace'}, - {include: '@comment'} -// {include:'@blockComment'} - ], - classname: [ - [/\binstance\b/, 'keyword', '@classname'], - [/\bclass\b(?=\s*@classname)/, 'keyword', '@classname'], - [/\bclass\b(?=\s*\()/, 'keyword', '@classname'], - [/\bdata\b(?=\s*?@typcons)/, 'keyword', '@typcons'], - [/\bnewtype\b(?=\s*@typcons)/, 'keyword', '@typcons'], - [/[a-z][\w]+(?=\s*?=)/, 'binderas', '@binder'], - [/[a-z][\w]+(?=\s*?::\s*?@datatypekey)/, 'binderas', '@binder'], - [/@datatypekey/, 'dtype'], - [/[A-Z][\w]*/, 'classname'], - [/@reservedid/, 'keyword', '@typcons'], - [/[a-z]\w*/, 'arguments'], - [/,/, 'commas'], - [/\(/, 'openbracket'], - [/\)/, 'closebracket'], - [/=>/, 'pipe', '@superclass'], - {include: '@whitespace'}, - {include: '@comment'} -// {include:'@blockComment'} - ], - binder: [ - [/\binstance\b/, 'keyword', '@classname'], - [/\bclass\b(?=\s*@classname)/, 'keyword', '@classname'], - [/\bclass\b(?=\s*\()/, 'keyword', '@classname'], - [/\bdata\b(?=\s*?@typcons)/, 'keyword', '@typcons'], - [/@reservedid/, 'keyword'], - [/[a-z][\w]+(?=\s*::)/, 'binder'], - [/[a-z][\w]+(?=\s*=)/, 'binder'], - [/::/, 'doublecolons', '@datacons'], - [/@datatypekey(?=\s*[a-z]\w*)/, 'dtypes', '@typcons'], - [/@datatypekey/, 'dtypess'], - [/\bnewtype\b(?=\s*@typcons)/, 'keyword', '@typcons'], - [/->/, 'pipe'], - [/\d+/, 'digit'], - [/{/, 'open'], - [/=/, 'Equalsto', '@datacons'], - - [/\(/, 'opn', '@typcons'], - [/\|/, 'alternates', '@datacons'], - [/,/, 'comma3'], - - [/[a-z][\w]*/, 'typvar', '@typconss'], - [/\bclass\b(?=\s*@classname)/, 'keyword', '@classname'], - [/\bclass\b(?=\s*\()/, 'keyword', '@classname'], - [/\binstance\b/, 'keyword', '@classname'], - [/\bundefined\b/, 'value'], - {include: '@whitespace'}, - {include: '@comment'} -// {include:'@blockComment'} - ], - superclass: [ - [/[A-Z][\w]+/, 'typeclass'], - [/@reservedid/, 'keyword', '@typcons'], - [/[a-z][\w]*/, 'typearguments'], - {include: '@whitespace'}, - {include: '@comment'} - //{include:'@blockComment'} - ], - argument: [ - [/[a-z][\w]*(?=\s*->)/, 'argument'], - [/->/, 'pipea', '@binder'], - {include: '@whitespace'}, - {include: '@comment'} -// {include:'@blockComment'} - ], - datatype: [ - [/\(/, 'openbracketd', '@pop'], - {include: '@comment'} - //{include:'@blockComment'} - ], - module_exports: [ - [/(@module_exports)/, 'storage.module.haskell'], - [/\(/, 'openbracket', '@target'], - [/\)/, 'closebracket', '@popall'], - [/,/, 'comma1'], - [/@invalid/, 'invalid'], - {include: '@whitespace'}, - {include: '@comment'} -// {include:'@blockcomment'} - ], - target: [ - [/(@target)/, 'target'], - [/,/, 'comma2'], - [/\)/, 'closebracket', '@pop'], - {include: '@comment'} -// {include:'@blockComment'} - ], - whitespace: [ - [/\t\r\n/, 'whitespace'], - [/\s*/, 'whitespace'] - - ], - comment: [ - [/--/, 'punctuation.comment.haskell'], - {include: '@whitespace'} - ], - Block_comment: [ - [/{-/, 'punctuation.comment.haskell'], - [/-}/, 'comment.block.haskell'], - {include: '@whitespace'} - ] - } - }; -} - monaco.languages.register({id: 'haskell'}); -// TODO: Currently not working. Here as a reminder -/*monaco.languages.setMonarchTokensProvider('haskell', definition());*/ \ No newline at end of file diff --git a/static/loadSave.js b/static/loadSave.js index 4ede3b89b..289bdacdf 100644 --- a/static/loadSave.js +++ b/static/loadSave.js @@ -56,7 +56,7 @@ function LoadSave() { } LoadSave.prototype.fetchBuiltins = function () { - return new Promise(_.bind(function (resolve, reject) { + return new Promise(_.bind(function (resolve) { $.getJSON('source/builtin/list', function (list) { resolve(list); }); @@ -163,7 +163,7 @@ LoadSave.prototype.onSaveToFile = function () { saveAs(new Blob( [this.editorText], {type: "text/plain;charset=utf-8"}), - "Compiler Explorer Code" + this.extension); + "Compiler Explorer Code" + this.extension); } catch (e) { new Alert().notify('Error while saving your code. Use the clipboard instead.', { group: "savelocalerror", diff --git a/static/main.js b/static/main.js index 4bcde0519..4721467cd 100644 --- a/static/main.js +++ b/static/main.js @@ -44,7 +44,7 @@ require("monaco-loader")().then(function () { var Alert = require('./alert'); var themer = require('./themes'); -//css + //css require("bootstrap/dist/css/bootstrap.min.css"); require("goldenlayout/src/css/goldenlayout-base.css"); require("selectize/dist/css/selectize.bootstrap2.css"); diff --git a/static/monaco-loader.js b/static/monaco-loader.js index df85a045c..557ac05e3 100644 --- a/static/monaco-loader.js +++ b/static/monaco-loader.js @@ -1,7 +1,6 @@ "use strict"; var Promise = require('es6-promise').Promise, - _loaded = false, _loadPromise = null; // Returns promise that will be fulfilled when monaco is available @@ -10,14 +9,13 @@ var waitForMonaco = function () { return _loadPromise; } - _loadPromise = new Promise(function (resolve, reject) { + _loadPromise = new Promise(function (resolve) { if (typeof(window.monaco) === 'object') { resolve(window.monaco); return window.monaco; } window.require(['vs/editor/editor.main'], function () { - _loaded = true; resolve(window.monaco); }); }); diff --git a/static/monaco.js b/static/monaco.js index 2685f412d..3cf56408f 100644 --- a/static/monaco.js +++ b/static/monaco.js @@ -23,6 +23,6 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. - +'use strict'; //until webpack can support monaco properly it exists on the window -module.exports = monaco; \ No newline at end of file +module.exports = monaco; diff --git a/static/opt-view.js b/static/opt-view.js index 5f9391cc4..beb5daa07 100644 --- a/static/opt-view.js +++ b/static/opt-view.js @@ -26,7 +26,6 @@ var FontScale = require('fontscale'); var monaco = require('monaco'); -var options = require('options'); var _ = require('underscore'); var $ = require('jquery'); diff --git a/static/pascal-mode.js b/static/pascal-mode.js index d39729109..4bd5578df 100644 --- a/static/pascal-mode.js +++ b/static/pascal-mode.js @@ -21,155 +21,152 @@ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. +'use strict'; -define(function (require) { - 'use strict'; - var jquery = require('jquery'); - var monaco = require('monaco'); +var monaco = require('monaco'); - function definition() { - // Object-Pascal language definition +function definition() { + // Object-Pascal language definition - return { - keywords: [ - 'unit', 'interface', 'implementation', 'uses', - 'function', 'procedure', 'const', 'begin', 'end', 'not', 'while', - 'as', 'for', 'with', - 'else', 'if', - 'break', 'except', 'on', - 'class', 'exec', 'in', 'throw', 'continue', 'finally', 'is', - 'for', 'try', 'then', 'do', - ':', '=', 'var', - 'strict', 'private', 'protected', 'public', 'published', - 'type' + return { + keywords: [ + 'unit', 'interface', 'implementation', 'uses', + 'function', 'procedure', 'const', 'begin', 'end', 'not', 'while', + 'as', 'for', 'with', + 'else', 'if', + 'break', 'except', 'on', + 'class', 'exec', 'in', 'throw', 'continue', 'finally', 'is', + 'for', 'try', 'then', 'do', + ':', '=', 'var', + 'strict', 'private', 'protected', 'public', 'published', + 'type' + ], + operators: [ + '+', '-', '*', '/', 'div', 'mod', + 'shl', 'shr', 'and', 'or', 'xor', 'not', + '<', '>', '<=', '>=', '==', '<>', + '+=', '-=', '*=', '/=' + ], + brackets: [ + ['(', ')', 'delimiter.parenthesis'], + ['[', ']', 'delimiter.square'] + ], + symbols: /[=>', '<=', '>=', '==', '<>', - '+=', '-=', '*=', '/=' + comment: [ + [/[^/*]+/, 'comment'], + [/\/\*/, 'comment', '@push'], // nested comment + ["\\*/", 'comment', '@pop'], + [/[/*]/, 'comment'] ], - brackets: [ - ['(', ')', 'delimiter.parenthesis'], - ['[', ']', 'delimiter.square'] + mstring: [ + {include: '@strcontent'}, + [/'''/, { + cases: { + '$#==$S2': {token: 'string.delim', bracket: '@close', next: '@pop'}, + '@default': {token: 'string'} + } + }], + [/["']/, 'string'], + [/./, 'string.invalid'] ], - symbols: /[=>>=', '>>>=' ], - symbols: /[=>](?!@symbols)/, '@brackets'], [/@symbols/, { cases: { @@ -86,11 +86,11 @@ function definition() { } }], - [/#!\[[^]*\]/, 'annotation'], + [/#!\[[^]*]/, 'annotation'], [/#!.*$/, 'annotation.invalid'], // numbers - [/\d*\.\d+([eE][\-+]?\d+)?[fFdD]?/, 'number.float'], + [/\d*\.\d+([eE][-+]?\d+)?[fFdD]?/, 'number.float'], [/0[xX][0-9a-fA-F_]*[0-9a-fA-F][Ll]?/, 'number.hex'], [/0[0-7_]*[0-7][Ll]?/, 'number.octal'], [/0[bB][0-1_]*[0-1][Ll]?/, 'number.binary'], @@ -116,11 +116,11 @@ function definition() { ], comment: [ - [/[^\/*]+/, 'comment'], + [/[^/*]+/, 'comment'], [/\/\*/, 'comment', '@push'], [/\/\*/, 'comment.invalid'], ["\\*/", 'comment', '@pop'], - [/[\/*]/, 'comment'] + [/[/*]/, 'comment'] ], string: [ diff --git a/static/sharing.js b/static/sharing.js index a1208bd58..3e43b0bf7 100644 --- a/static/sharing.js +++ b/static/sharing.js @@ -37,6 +37,7 @@ function configFromEmbedded(embeddedUrl) { try { params = url.unrisonify(embeddedUrl); } catch (e) { + // Ignore this, it's not a problem } if (params && params.source && params.compiler) { var filters = _.chain((params.filters || "").split(',')) diff --git a/static/themes.js b/static/themes.js index 56ed8c66c..46d9640de 100644 --- a/static/themes.js +++ b/static/themes.js @@ -25,7 +25,6 @@ "use strict"; var $ = require('jquery'); -var _ = require('underscore'); var themes = { default: { diff --git a/static/urlshorten-google.js b/static/urlshorten-google.js index b72023615..32d6dc7f2 100644 --- a/static/urlshorten-google.js +++ b/static/urlshorten-google.js @@ -54,12 +54,13 @@ function shortenURL(url, done) { } done(id); }, function () { - new Alert().notify("The URL could not be shortened. It probaly exceeds the Google URL Shortener length limits.", { - group: "urltoolong", - alertClass: "notification-error" - }); + new Alert(). + notify("The URL could not be shortened. It probably exceeds the Google URL Shortener length limits.", { + group: "urltoolong", + alertClass: "notification-error" + }); done(url); }); } -module.exports = shortenURL; \ No newline at end of file +module.exports = shortenURL; diff --git a/yarn.lock b/yarn.lock index b30298707..678929b76 100644 --- a/yarn.lock +++ b/yarn.lock @@ -29,7 +29,13 @@ acorn-globals@^3.0.0: dependencies: acorn "^4.0.4" -acorn@^3.1.0, acorn@~3.3.0: +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4, acorn@^3.1.0, acorn@~3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" @@ -41,6 +47,10 @@ acorn@^5.0.0: version "5.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.3.0.tgz#7446d39459c54fb49a80e6ee6478149b940ec822" +acorn@^5.4.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.4.1.tgz#fdc58d9d17f4a4e98d102ded826a9b9759125102" + ajv-keywords@^2.0.0, ajv-keywords@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" @@ -52,7 +62,7 @@ ajv@^4.9.1: co "^4.6.0" json-stable-stringify "^1.0.1" -ajv@^5.0.0, ajv@^5.1.5: +ajv@^5.0.0, ajv@^5.1.5, ajv@^5.2.3, ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" dependencies: @@ -77,6 +87,10 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" +ansi-escapes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" + ansi-html@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" @@ -93,7 +107,7 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.1.0: +ansi-styles@^3.1.0, ansi-styles@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" dependencies: @@ -205,7 +219,7 @@ array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" -arrify@^1.0.1: +arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -318,7 +332,7 @@ aws4@^1.2.1: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" -babel-code-frame@^6.26.0: +babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: @@ -590,6 +604,16 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + camel-case@3.0.x: version "3.0.0" resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" @@ -685,6 +709,14 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +chalk@^2.0.0, chalk@^2.1.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" + dependencies: + ansi-styles "^3.2.0" + escape-string-regexp "^1.0.5" + supports-color "^5.2.0" + chalk@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" @@ -699,6 +731,10 @@ character-parser@^2.1.1: dependencies: is-regex "^1.0.3" +chardet@^0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" + check-error@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" @@ -746,6 +782,10 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + clap@^1.0.9: version "1.2.3" resolved "https://registry.yarnpkg.com/clap/-/clap-1.2.3.tgz#4f36745b32008492557f46412d66d50cb99bce51" @@ -774,12 +814,15 @@ clean-css@^3.3.0: commander "2.8.x" source-map "0.4.x" -cli@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cli/-/cli-1.0.1.tgz#22817534f24bfa4950c34d532d48ecbc621b8c14" +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" dependencies: - exit "0.1.2" - glob "^7.1.1" + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" clipboard@^1.7.1: version "1.7.1" @@ -941,7 +984,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.5.0: +concat-stream@^1.5.0, concat-stream@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" dependencies: @@ -953,7 +996,7 @@ connect-history-api-fallback@^1.3.0: version "1.5.0" resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz#b06873934bc5e344fef611a196a6faae0aee015a" -console-browserify@1.1.x, console-browserify@^1.1.0: +console-browserify@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" dependencies: @@ -1059,7 +1102,7 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" -cross-spawn@^5.0.1: +cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" dependencies: @@ -1269,6 +1312,18 @@ defined@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + del@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5" @@ -1359,42 +1414,20 @@ dns-txt@^2.0.2: dependencies: buffer-indexof "^1.0.0" +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + dependencies: + esutils "^2.0.2" + doctypes@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9" -dom-serializer@0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" - dependencies: - domelementtype "~1.1.1" - entities "~1.1.1" - domain-browser@^1.1.1: version "1.1.7" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" -domelementtype@1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" - -domelementtype@~1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" - -domhandler@2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738" - dependencies: - domelementtype "1" - -domutils@1.5: - version "1.5.1" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" - dependencies: - dom-serializer "0" - domelementtype "1" - duplexify@^3.4.2, duplexify@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.3.tgz#8b5818800df92fd0125b27ab896491912858243e" @@ -1457,14 +1490,6 @@ enhanced-resolve@^3.4.0: object-assign "^4.0.1" tapable "^0.2.7" -entities@1.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-1.0.0.tgz#b2987aa3821347fcde642b24fdfc9e4fb712bf26" - -entities@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" - errno@^0.1.3, errno@^0.1.4: version "0.1.6" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.6.tgz#c386ce8a6283f14fc09563b71560908c9bf53026" @@ -1586,6 +1611,66 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + +eslint@^4.17.0: + version "4.17.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.17.0.tgz#dc24bb51ede48df629be7031c71d9dc0ee4f3ddf" + dependencies: + ajv "^5.3.0" + babel-code-frame "^6.22.0" + chalk "^2.1.0" + concat-stream "^1.6.0" + cross-spawn "^5.1.0" + debug "^3.1.0" + doctrine "^2.1.0" + eslint-scope "^3.7.1" + eslint-visitor-keys "^1.0.0" + espree "^3.5.2" + esquery "^1.0.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.0.1" + ignore "^3.3.3" + imurmurhash "^0.1.4" + inquirer "^3.0.6" + is-resolvable "^1.0.0" + js-yaml "^3.9.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" + strip-json-comments "~2.0.1" + table "^4.0.1" + text-table "~0.2.0" + +espree@^3.5.2: + version "3.5.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.3.tgz#931e0af64e7fbbed26b050a29daad1fc64799fa6" + dependencies: + acorn "^5.4.0" + acorn-jsx "^3.0.0" + esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -1602,6 +1687,12 @@ esprima@~3.1.0: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" + esrecurse@^4.1.0: version "4.2.0" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" @@ -1613,7 +1704,7 @@ estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" -estraverse@^4.1.0, estraverse@^4.1.1: +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -1665,10 +1756,6 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -exit@0.1.2, exit@0.1.x: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" @@ -1745,6 +1832,14 @@ extend@^3.0.0, extend@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" +external-editor@^2.0.4: + version "2.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" + dependencies: + chardet "^0.4.0" + iconv-lite "^0.4.17" + tmp "^0.0.33" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -1813,6 +1908,19 @@ faye-websocket@~0.11.0: dependencies: websocket-driver ">=0.5.1" +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + file-loader@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-1.1.6.tgz#7b9a8f2c58f00a77fddf49e940f7ac978a3ea0e8" @@ -1880,6 +1988,15 @@ find-up@^2.0.0, find-up@^2.1.0: dependencies: locate-path "^2.0.0" +flat-cache@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + flatten@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" @@ -2017,6 +2134,10 @@ function-bind@^1.0.2, function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -2093,7 +2214,7 @@ glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: +glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -2104,6 +2225,21 @@ glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" +globals@^11.0.1: + version "11.3.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.3.0.tgz#e04fdb7b9796d8adac9c8f64c14837b2313378b0" + +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + globby@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" @@ -2192,6 +2328,10 @@ has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -2318,16 +2458,6 @@ html-minifier@^3.5.8: relateurl "0.2.x" uglify-js "3.3.x" -htmlparser2@3.8.x: - version "3.8.3" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.8.3.tgz#996c28b191516a8be86501a7d79757e5c70c1068" - dependencies: - domelementtype "1" - domhandler "2.3" - domutils "1.5" - entities "1.0" - readable-stream "1.1" - http-deceiver@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" @@ -2377,7 +2507,7 @@ humanize@^0.0.9: version "0.0.9" resolved "https://registry.yarnpkg.com/humanize/-/humanize-0.0.9.tgz#1994ffaecdfe9c441ed2bdac7452b7bb4c9e41a4" -iconv-lite@0.4.19: +iconv-lite@0.4.19, iconv-lite@^0.4.17: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -2399,7 +2529,7 @@ iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" -ignore@^3.3.5: +ignore@^3.3.3, ignore@^3.3.5: version "3.3.7" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" @@ -2447,6 +2577,25 @@ ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" +inquirer@^3.0.6: + version "3.3.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^2.0.4" + figures "^2.0.0" + lodash "^4.3.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" + string-width "^2.1.0" + strip-ansi "^4.0.0" + through "^2.3.6" + internal-ip@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-1.2.0.tgz#ae9fbf93b984878785d50a8de1b356956058cf5c" @@ -2679,7 +2828,7 @@ is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" -is-promise@^2.0.0: +is-promise@^2.0.0, is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -2689,6 +2838,10 @@ is-regex@^1.0.3, is-regex@^1.0.4: dependencies: has "^1.0.1" +is-resolvable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2715,10 +2868,6 @@ is-wsl@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -2780,7 +2929,7 @@ js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@3.x: +js-yaml@3.x, js-yaml@^3.9.1: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: @@ -2802,19 +2951,6 @@ jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" -jshint@^2.9.5: - version "2.9.5" - resolved "https://registry.yarnpkg.com/jshint/-/jshint-2.9.5.tgz#1e7252915ce681b40827ee14248c46d34e9aa62c" - dependencies: - cli "~1.0.0" - console-browserify "1.1.x" - exit "0.1.x" - htmlparser2 "3.8.x" - lodash "3.7.x" - minimatch "~3.0.2" - shelljs "0.3.x" - strip-json-comments "1.0.x" - json-loader@^0.5.4: version "0.5.7" resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" @@ -2827,6 +2963,10 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" @@ -2921,7 +3061,7 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" -levn@~0.3.0: +levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" dependencies: @@ -3034,14 +3174,14 @@ lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" -lodash@3.7.x: - version "3.7.0" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.7.0.tgz#3678bd8ab995057c07ade836ed2ef087da811d45" - "lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.3.0, lodash@~4.17.2: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +lodash@^4.17.4: + version "4.17.5" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" + loglevel@^1.4.1: version "1.6.1" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa" @@ -3236,7 +3376,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.2: +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -3343,6 +3483,10 @@ multicast-dns@^6.0.1: dns-packet "^1.0.1" thunky "^0.1.0" +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + nan@^2.3.0: version "2.8.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" @@ -3363,6 +3507,10 @@ nanomatch@^1.2.5: snapdragon "^0.8.1" to-regex "^3.0.1" +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + ncname@1.0.x: version "1.0.0" resolved "https://registry.yarnpkg.com/ncname/-/ncname-1.0.0.tgz#5b57ad18b1ca092864ef62b0b1ed8194f383b71c" @@ -3564,6 +3712,12 @@ once@1.x, once@^1.3.0, once@^1.3.1, once@^1.3.3, once@^1.4.0: dependencies: wrappy "1" +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + dependencies: + mimic-fn "^1.0.0" + opn@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/opn/-/opn-5.2.0.tgz#71fdf934d6827d676cecbea1531f95d354641225" @@ -3577,7 +3731,7 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.1: +optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" dependencies: @@ -3616,7 +3770,7 @@ os-locale@^2.0.0: lcid "^1.0.0" mem "^1.1.0" -os-tmpdir@^1.0.0: +os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -3724,7 +3878,7 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-is-inside@^1.0.1: +path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" @@ -3798,6 +3952,10 @@ pkg-dir@^2.0.0: dependencies: find-up "^2.1.0" +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + portfinder@^1.0.9: version "1.0.13" resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.13.tgz#bb32ecd87c27104ae6ee44b5a3ccbf0ebb1aede9" @@ -4080,6 +4238,10 @@ process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" +progress@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" + promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" @@ -4389,15 +4551,6 @@ read-pkg@^2.0.0: string_decoder "~1.0.3" util-deprecate "~1.0.1" -readable-stream@1.1: - version "1.1.13" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.13.tgz#f6eef764f514c89e2b9e23146a75ba106756d23e" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - readdirp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" @@ -4534,6 +4687,13 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" +require-uncached@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + requirejs@*: version "2.3.5" resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" @@ -4548,6 +4708,10 @@ resolve-cwd@^2.0.0: dependencies: resolve-from "^3.0.0" +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" @@ -4566,6 +4730,13 @@ resolve@^1.1.6: dependencies: path-parse "^1.0.5" +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" @@ -4589,12 +4760,28 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^2.0.0" inherits "^2.0.1" +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + dependencies: + is-promise "^2.1.0" + run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" dependencies: aproba "^1.1.1" +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + dependencies: + rx-lite "*" + +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" + safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -4776,10 +4963,6 @@ shell-quote@1.6.x: array-reduce "~0.0.0" jsonify "~0.0.0" -shelljs@0.3.x: - version "0.3.0" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.3.0.tgz#3596e6307a781544f591f37da618360f31db57b1" - sifter@^0.5.1: version "0.5.3" resolved "https://registry.yarnpkg.com/sifter/-/sifter-0.5.3.tgz#5e6507fe8c114b2b28d90b6bf4e5b636e611e48b" @@ -4790,7 +4973,7 @@ sifter@^0.5.1: humanize "^0.0.9" optimist "^0.6.1" -signal-exit@^3.0.0: +signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -4807,6 +4990,12 @@ slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" +slice-ansi@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + dependencies: + is-fullwidth-code-point "^2.0.0" + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -5032,7 +5221,7 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.0.0: +string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" dependencies: @@ -5045,10 +5234,6 @@ string_decoder@^1.0.0, string_decoder@~1.0.3: dependencies: safe-buffer "~5.1.0" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -5085,10 +5270,6 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-json-comments@1.0.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" - strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -5147,6 +5328,12 @@ supports-color@^5.1.0: dependencies: has-flag "^2.0.0" +supports-color@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.2.0.tgz#b0d5333b1184dd3666cbe5aa0b45c5ac7ac17a4a" + dependencies: + has-flag "^3.0.0" + svgo@^0.7.0: version "0.7.2" resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5" @@ -5159,6 +5346,17 @@ svgo@^0.7.0: sax "~1.2.1" whet.extend "~0.9.9" +table@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" + dependencies: + ajv "^5.2.3" + ajv-keywords "^2.1.0" + chalk "^2.1.0" + lodash "^4.17.4" + slice-ansi "1.0.0" + string-width "^2.1.1" + tapable@^0.2.7: version "0.2.8" resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" @@ -5191,6 +5389,10 @@ temp@0.8.x: os-tmpdir "^1.0.0" rimraf "~2.2.6" +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + through2@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" @@ -5198,7 +5400,7 @@ through2@^2.0.0: readable-stream "^2.1.5" xtend "~4.0.1" -through@~2.3.6: +through@^2.3.6, through@~2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -5224,6 +5426,12 @@ tiny-emitter@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.0.2.tgz#82d27468aca5ade8e5fd1e6d22b57dd43ebdfb7c" +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + dependencies: + os-tmpdir "~1.0.2" + to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" @@ -5736,6 +5944,12 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + xml-char-classes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/xml-char-classes/-/xml-char-classes-1.0.0.tgz#64657848a20ffc5df583a42ad8a277b4512bbc4d"