Download pool/shard000/JavaScript/0000115_pegjs-coffee-plugin.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard000/JavaScript/0000115_pegjs-coffee-plugin.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard000/JavaScript/0000115_pegjs-coffee-plugin.js
-
curl -L -o 0000115_pegjs-coffee-plugin.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard000/JavaScript/0000115_pegjs-coffee-plugin.js
1.13 kB
| // Generated by CoffeeScript 2.0.0-beta9-dev | |
| var CoffeeScript, compile, eachCode; | |
| CoffeeScript = require('./module'); | |
| eachCode = require('pegjs-each-code'); | |
| compile = function (csCode, options) { | |
| var csAST, jsAST; | |
| if (null == options) | |
| options = {}; | |
| csAST = CoffeeScript.parse('-> ' + csCode.trimRight()); | |
| if (csAST.body.statements.length > 1) | |
| throw new Error('inconsistent base indentation'); | |
| jsAST = CoffeeScript.compile(csAST, { | |
| bare: true, | |
| inScope: options.inScope | |
| }); | |
| jsAST.leadingComments = []; | |
| jsAST.body = jsAST.body[0].expression.body.body.concat(jsAST.body.slice(1)); | |
| return CoffeeScript.js(jsAST); | |
| }; | |
| exports.use = function (config) { | |
| return config.passes.transform.unshift(function (ast) { | |
| ast.initializer.code = CoffeeScript.cs2js(ast.initializer.code, { bare: true }); | |
| return eachCode(ast, function (node, labels, ruleName) { | |
| var error; | |
| try { | |
| return node.code = compile(node.code, { inScope: labels }); | |
| } catch (e$) { | |
| error = e$; | |
| throw new Error("In the '" + ruleName + "' rule:\n" + error.message + ''); | |
| } | |
| }); | |
| }); | |
| }; | |