All Downloads are FREE. Search and download functionalities are using the official Maven repository.

static.js.PromptoWorker.55cde9f6.worker.js.map Maven / Gradle / Ivy

There is a newer version: 0.0.74
Show newest version
{"version":3,"sources":["../webpack/bootstrap","components/player/PromptoWorker.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","globals","self","Honey","importScripts","prompto","parse","content","dialect","klass","parser","resetRepl","message","replContext","librariesContext","newLocalContext","toStdOut","intrinsic","dispatch","translate","data","context","clone","decls","from","register","Dialect","to","writer","utils","CodeWriter","toDialect","translated","toString","execute","console","log","text","postMessage","inResponseTo","id","keepHandlerAlive","error","toStdErr","testName","forEach","decl","declaration","TestMethodDeclaration","memstore","MemStore","Cursor","store","$DataStore","instance","runtime","Interpreter","interpretTest","interpret","e","stack","deleteRepl","getRegistered","unregister","MethodDeclarationMap","declarations","instances","values","showRepl","items","getAll","push","length","repl","input","removeErrorListeners","addErrorListener","problem","ProblemRaiser","thing","parse_repl_input","Declaration","onmessage","event","handler","verb","response","Context","newGlobalsContext","url","success","xhr","XMLHttpRequest","onerror","target","status","onload","responseText","open","setRequestHeader","send","loadText","code","strings","raw","unregisterMethodDeclaration","String","slice","freeze","defineProperties"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,E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EAAOI,OAAOF,IAAV,IClNuCD,EDkNvC,qFCjNDC,IACHA,EAAMD,EAAQI,MAAM,IDgNhB,EC7MChI,OAAOiI,OAAOjI,OAAOkI,iBAAiBN,EAAS,CACpDC,IAAK,CACHtH,MAAOP,OAAOiI,OAAOJ,SD4MH,MACd/E,SAASxB,EAAQa","file":"static/js/PromptoWorker.55cde9f6.worker.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","// eslint-disable-next-line\nconst globals = self;\n// setup nodejs compatible require paths\nglobals.Honey = {'requirePath': ['..']}; // walk up to js folder\nglobals.importScripts(\"/js/lib/require.js\", \"/js/lib/prompto.core.bundle.js\");\n\nconst prompto = globals.prompto;\nglobals.intrinsic = prompto.intrinsic; // required by native libraries\n\nfunction loadText(url, success) {\n    var xhr = new XMLHttpRequest();\n    xhr.onerror = function(e) {\n        console.log(\"Error \" + e.target.status + \" occurred while receiving the document.\");\n        return null;\n    };\n    xhr.onload = function(e) {\n        success(xhr.responseText);\n    };\n    xhr.open('GET', url);\n    if(url[0]!==\"/\" && url[0]!==\".\")\n        xhr.setRequestHeader(\"Access-Control-Allow-Origin\", \"*\");\n    xhr.send(null);\n}\n\n// parse prompto code\nfunction parse(content, dialect) {\n    const klass = prompto.parser[dialect + \"CleverParser\"];\n    const parser = new klass(content);\n    return parser.parse();\n}\n\n// translate code to dialect\nfunction translate(message) {\n    // parse incoming code\n    var data = message.data;\n    var context = globals.librariesContext.clone();\n    var decls = parse(data.content, data.from);\n    decls.register(context);\n    // translate it\n    var dialect = prompto.parser.Dialect[data.to];\n    var writer = new prompto.utils.CodeWriter(dialect, context);\n    decls.toDialect(writer);\n    return {\n        translated: writer.toString()\n    };\n}\n\n\n// execute code in dialect\nfunction execute(message) {\n    // manage output\n    console.log = function(text) {\n        postMessage({\n            inResponseTo: message.id,\n            keepHandlerAlive: true,\n            data: {\n                toStdOut: text\n            }\n        });\n    };\n    console.error = function(text) {\n        postMessage({\n            inResponseTo: message.id,\n            keepHandlerAlive: true,\n            data: {\n                toStdErr: text\n            }\n        });\n    };\n    // parse incoming code\n    const data = message.data;\n    const context = globals.librariesContext.clone();\n    console.log(\"Running sample...\\n\")\n    const decls = parse(data.content, data.dialect);\n    decls.register(context);\n    let testName = null;\n    decls.forEach(decl => {\n        if(decl instanceof prompto.declaration.TestMethodDeclaration)\n            testName = decl.name;\n    });\n    // wire cursor, required by iterator\n    prompto.memstore.MemStore.Cursor = prompto.intrinsic.Cursor;\n    // run \"main\" method, using fresh store\n    try {\n        prompto.store.$DataStore.instance = new prompto.memstore.MemStore();\n        if(testName)\n            prompto.runtime.Interpreter.interpretTest(context, testName);\n        else\n            prompto.runtime.Interpreter.interpret(context, \"main\", \"\");\n        // done\n        return {\n            toStdOut: \"Success!\\n\"\n        };\n    } catch (e) {\n        return {\n            toStdErr: e.stack + \"\\n\"\n        };\n\n    }\n}\n\nfunction repl(message) {\n    const klass = prompto.parser[message.data.dialect + \"CleverParser\"];\n    const parser = new klass(message.data.input);\n    parser.removeErrorListeners();\n    parser.addErrorListener(new prompto.problem.ProblemRaiser());\n    try {\n        const thing = parser.parse_repl_input();\n        if (thing instanceof prompto.declaration.Declaration) {\n            thing.register(globals.replContext);\n            return {toStdOut: \"Registered \" + thing.name};\n        } else if (thing.interpret) {\n            const value = thing.interpret(globals.replContext);\n            if (value)\n                return {toStdOut: value.toString()};\n            else\n                return {toStdOut: \"\"};\n        } else {\n            return {toStdErr: \"Unsupported:\" + message.data.input};\n        }\n    } catch(error) {\n        return {\n            toStdErr: error.message\n        };\n    }\n}\n\nfunction deleteRepl(message) {\n    const name = message.data.name;\n    const decl = globals.replContext.getRegistered(name);\n    if(!decl)\n        return { toStdErr: \"Not found: \" + name };\n    else {\n        if(decl.unregister) {\n            if(decl instanceof prompto.runtime.MethodDeclarationMap)\n                delete globals.replContext.declarations[name];\n            else\n                decl.unregister(globals.replContext);\n            return { toStdOut: \"Deleted declaration \" + name };\n        } else {\n            delete globals.replContext.instances[name];\n            delete globals.replContext.values[name];\n            return { toStdOut: \"Deleted variable \" + name };\n        }\n    }\n}\n\nfunction resetRepl(message) {\n    globals.replContext = globals.librariesContext.newLocalContext();\n    return { toStdOut: \"\" };\n}\n\nfunction showRepl(message) {\n    const items = [];\n    var dialect = prompto.parser.Dialect[message.data.dialect];\n    for(var name in globals.replContext.declarations) {\n        const decl = globals.replContext.declarations[name];\n        const decls = decl instanceof prompto.runtime.MethodDeclarationMap ?\n            decl.getAll() :\n            [ decl ];\n        decls.forEach(d => {\n            const writer = new prompto.utils.CodeWriter(dialect, globals.replContext);\n            d.toDialect(writer);\n            items.push(writer.toString());\n        });\n    }\n    for(name in globals.replContext.values) {\n        const value = globals.replContext.values[name];\n        items.push(name + \": \" + value.toString());\n    }\n    if(items.length > 0)\n        return { items: items };\n    else\n        return { toStdOut: \"\", items: [] };\n}\n\n\nconst dispatch = {\n    translate : translate,\n    execute : execute,\n    deleteRepl: deleteRepl,\n    resetRepl: resetRepl,\n    showRepl: showRepl,\n    repl: repl\n};\n\n// manage events\nonmessage = function(event) {\n    var message = event.data;\n    var handler = dispatch[message.verb];\n    var data = handler(message);\n    var response = {\n        inResponseTo : message.id,\n        data : data\n    };\n    postMessage(response);\n};\n\n\n// create global context with pre-loaded libraries\nglobals.librariesContext = prompto.runtime.Context.newGlobalsContext();\nresetRepl();\n\nloadText(\"/prompto/prompto.pec\", code => {\n    let decls = parse(code, \"E\");\n    decls.register(globals.librariesContext);\n    // remove the original \"print\" method\n    const decl = { name: \"print\" };\n    globals.librariesContext.unregisterMethodDeclaration(decl, \"any\");\n    // replace \"print\" with a custom \"print\" method\n    code = String.raw`native method print ( any value ) { JavaScript: console.log(value.toString()); }`;\n    decls = parse(code, \"O\");\n    decls.register(globals.librariesContext);\n});\n\n\n\n","export default function _taggedTemplateLiteral(strings, raw) {\n  if (!raw) {\n    raw = strings.slice(0);\n  }\n\n  return Object.freeze(Object.defineProperties(strings, {\n    raw: {\n      value: Object.freeze(raw)\n    }\n  }));\n}"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy