UNPKG

castelog

Version:

Programación JavaScript en castellano.

885 lines (856 loc) 6.59 MB
/* * Generated by PEG.js 0.10.0. * * http://pegjs.org/ */ (function(root, factory) { if (typeof define === "function" && define.amd) { define([], factory); } else if (typeof module === "object" && module.exports) { module.exports = factory(); } else { root.Castelog_parser = factory(); } })(this, function() { "use strict"; function peg$subclass(child, parent) { function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); } function peg$SyntaxError(message, expected, found, location) { this.message = message; this.expected = expected; this.found = found; this.location = location; this.name = "SyntaxError"; if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, peg$SyntaxError); } } peg$subclass(peg$SyntaxError, Error); peg$SyntaxError.buildMessage = function(expected, found) { var DESCRIBE_EXPECTATION_FNS = { literal: function(expectation) { return "\"" + literalEscape(expectation.text) + "\""; }, "class": function(expectation) { var escapedParts = "", i; for (i = 0; i < expectation.parts.length; i++) { escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]); } return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; }, any: function(expectation) { return "any character"; }, end: function(expectation) { return "end of input"; }, other: function(expectation) { return expectation.description; } }; function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } function literalEscape(s) { return s .replace(/\\/g, '\\\\') .replace(/"/g, '\\"') .replace(/\0/g, '\\0') .replace(/\t/g, '\\t') .replace(/\n/g, '\\n') .replace(/\r/g, '\\r') .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); } function classEscape(s) { return s .replace(/\\/g, '\\\\') .replace(/\]/g, '\\]') .replace(/\^/g, '\\^') .replace(/-/g, '\\-') .replace(/\0/g, '\\0') .replace(/\t/g, '\\t') .replace(/\n/g, '\\n') .replace(/\r/g, '\\r') .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); } function describeExpectation(expectation) { return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); } function describeExpected(expected) { var descriptions = new Array(expected.length), i, j; for (i = 0; i < expected.length; i++) { descriptions[i] = describeExpectation(expected[i]); } descriptions.sort(); if (descriptions.length > 0) { for (i = 1, j = 1; i < descriptions.length; i++) { if (descriptions[i - 1] !== descriptions[i]) { descriptions[j] = descriptions[i]; j++; } } descriptions.length = j; } switch (descriptions.length) { case 1: return descriptions[0]; case 2: return descriptions[0] + " or " + descriptions[1]; default: return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1]; } } function describeFound(found) { return found ? "\"" + literalEscape(found) + "\"" : "end of input"; } return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; }; function peg$parse(input, options) { options = options !== void 0 ? options : {}; var peg$FAILED = {}, peg$startRuleFunctions = { Escript_de_castelog: peg$parseEscript_de_castelog }, peg$startRuleFunction = peg$parseEscript_de_castelog, peg$c0 = function(prescripts, script) { return prescripts + "\n" + wrapScriptCode(script) }, peg$c1 = function(sentencia) { return sentencia }, peg$c2 = function(generativa) { return generativa }, peg$c3 = function(principal, entorno, secundarios, compilable, empaquetable, html5) { return (principal ? principal : "") + (entorno ? entorno : "") + (secundarios ? secundarios.join("") : "") + (compilable ? compilable : "") + (empaquetable ? empaquetable : "") + (html5 ? html5 : "") }, peg$c4 = ".", peg$c5 = peg$literalExpectation(".", false), peg$c6 = "oksentencia", peg$c7 = peg$literalExpectation("oksentencia", false), peg$c8 = peg$anyExpectation(), peg$c9 = peg$otherExpectation("espacio"), peg$c10 = " ", peg$c11 = peg$literalExpectation(" ", false), peg$c12 = "\t", peg$c13 = peg$literalExpectation("\t", false), peg$c14 = peg$otherExpectation("salto"), peg$c15 = "\r\n", peg$c16 = peg$literalExpectation("\r\n", false), peg$c17 = "\r", peg$c18 = peg$literalExpectation("\r", false), peg$c19 = "\n", peg$c20 = peg$literalExpectation("\n", false), peg$c21 = function(comentario) { return comentario }, peg$c22 = "#", peg$c23 = peg$literalExpectation("#", false), peg$c24 = function() { return }, peg$c25 = "@POR-", peg$c26 = peg$literalExpectation("@POR-", false), peg$c27 = "[*", peg$c28 = peg$literalExpectation("[*", false), peg$c29 = "*]", peg$c30 = peg$literalExpectation("*]", false), peg$c31 = function() { return text() }, peg$c32 = function(sentencias) { return sentencias }, peg$c33 = function() { return JSON.stringify(text().replace(/^[\n\t ]*\{|\}[\n\t ]*$/g, "")) }, peg$c34 = function(script) { return JSON.stringify(script) }, peg$c35 = peg$otherExpectation("bloque unilinea"), peg$c36 = ":", peg$c37 = peg$literalExpectation(":", false), peg$c38 = ";", peg$c39 = peg$literalExpectation(";", false), peg$c40 = function(bloque, despues) { return bloque + ( despues ? ("\n" + despues) : "" ) }, peg$c41 = function(bloque) { return bloque }, peg$c42 = function(sentencias) { return sentencias.join("\n") }, peg$c43 = "despu\xE9s", peg$c44 = peg$literalExpectation("despu\xE9s", false), peg$c45 = "Este script funcion\xF3 con", peg$c46 = peg$literalExpectation("Este script funcion\xF3 con", false), peg$c47 = "este script funcion\xF3 con", peg$c48 = peg$literalExpectation("este script funcion\xF3 con", false), peg$c49 = function(entorno) { return createExecutedWithCommand(entorno) }, peg$c50 = "Ejecutable por", peg$c51 = peg$literalExpectation("Ejecutable por", false), peg$c52 = "ejecutable por", peg$c53 = peg$literalExpectation("ejecutable por", false), peg$c54 = function(ejec) { return createShebang(ejec) }, peg$c55 = "Ejecutable ", peg$c56 = peg$literalExpectation("Ejecutable ", false), peg$c57 = "ejecutable ", peg$c58 = peg$literalExpectation("ejecutable ", false), peg$c59 = /^[0-9]/, peg$c60 = peg$classExpectation([["0", "9"]], false, false), peg$c61 = " por", peg$c62 = peg$literalExpectation(" por", false), peg$c63 = function(id, ejec) { return createExecutableComment(id, ejec) }, peg$c64 = "Ejecutable como documento HTML5", peg$c65 = peg$literalExpectation("Ejecutable como documento HTML5", false), peg$c66 = "ejecutable como documento html5", peg$c67 = peg$literalExpectation("ejecutable como documento html5", false), peg$c68 = function(autor, nombre, version, contenido) { return `\n// [castelog:html5izable] ACTIVADO con: ${JSON.stringify({ autor, nombre, version, contenido })}\n` }, peg$c69 = "con autor", peg$c70 = peg$literalExpectation("con autor", false), peg$c71 = function(etiqueta) { return etiqueta }, peg$c72 = "con nombre", peg$c73 = peg$literalExpectation("con nombre", false), peg$c74 = "con versi\xF3n", peg$c75 = peg$literalExpectation("con versi\xF3n", false), peg$c76 = function(head, body) { return { head, body }}, peg$c77 = /^[A-Za-z0-9_\-.]/, peg$c78 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_", "-", "."], false, false), peg$c79 = "Empaquetable con", peg$c80 = peg$literalExpectation("Empaquetable con", false), peg$c81 = "empaquetable con", peg$c82 = peg$literalExpectation("empaquetable con", false), peg$c83 = function(lista) { return lista }, peg$c84 = "Compilable con", peg$c85 = peg$literalExpectation("Compilable con", false), peg$c86 = "compilable con", peg$c87 = peg$literalExpectation("compilable con", false), peg$c88 = function(empaquetables) { return empaquetables.map(f => `\n// [castelog:empaquetables] ${ JSON.stringify(f) }\n`).join("") }, peg$c89 = " ./", peg$c90 = peg$literalExpectation(" ./", false), peg$c91 = " @/", peg$c92 = peg$literalExpectation(" @/", false), peg$c93 = function() { return text().trim() }, peg$c94 = function(compilables) { return compilables.map(f => `// [castelog:compilables] ${ JSON.stringify(f) }\n`).join("") }, peg$c95 = function(etiqueta, si, perosi, ysino) { return (etiqueta ? etiqueta : "") + si + perosi.join("") + (ysino ? ysino : "") }, peg$c96 = function(condicion, bloque) { return "if(" + condicion + ") {\n" + bloque + "\n}" }, peg$c97 = function(condicion, bloque) { return "\nelse if(" + condicion + ") {\n" + bloque + "\n}" }, peg$c98 = function(bloque) { return "\nelse {\n" + bloque + "\n}" }, peg$c99 = function(etiqueta, condicion, bloque) { return (etiqueta ? etiqueta : "") + "while(" + condicion + ") {\n" + bloque + "\n}" }, peg$c100 = function(etiqueta, condicion, bloque) { return (etiqueta ? etiqueta : "") + "while(!(" + condicion + ")) {\n" + bloque + "\n}" }, peg$c101 = "Hasta", peg$c102 = peg$literalExpectation("Hasta", false), peg$c103 = "hasta", peg$c104 = peg$literalExpectation("hasta", false), peg$c105 = "que", peg$c106 = peg$literalExpectation("que", false), peg$c107 = function() {}, peg$c108 = function(creaciones) { return creaciones; }, peg$c109 = function(creacion_1, creacion_n) { return [creacion_1].concat(creacion_n ? creacion_n : []).join("\n") }, peg$c110 = function(tipo, nombre, valor) { return (tipo === "variable" ? "let " : "const ") + nombre + " = " + valor + ";" }, peg$c111 = function(creacion) { return creacion }, peg$c112 = "variables", peg$c113 = peg$literalExpectation("variables", false), peg$c114 = "constantes", peg$c115 = peg$literalExpectation("constantes", false), peg$c116 = function(tipo, desacoplados, generativa) { return (tipo ? (tipo[1] === "variables") ? "let" : "const" : "const") + " " + desacoplados + " = " + generativa + ";" }, peg$c117 = "a partir de", peg$c118 = peg$literalExpectation("a partir de", false), peg$c119 = function(item, items) { return "[ " + item + (items ? items : "") + " ]" }, peg$c120 = function(item, defecto) { return item + (defecto ? defecto : '') }, peg$c121 = function(items) { return items.join("") }, peg$c122 = function(item, defecto) { return ", " + item + (defecto ? defecto : '') }, peg$c123 = function(item, items) { return "{ " + item + (items ? items : "") + "\n}" }, peg$c124 = function(item, como, defecto) { return item + (como ? ": " + como : "") + (defecto ? defecto : ''); }, peg$c125 = function(items) { return ", " + items.join(", ") }, peg$c126 = function(item, como, defecto) { return item + (como ? ": " + como : "") + (defecto ? defecto : '') }, peg$c127 = "como", peg$c128 = peg$literalExpectation("como", false), peg$c129 = "Desacoplo", peg$c130 = peg$literalExpectation("Desacoplo", false), peg$c131 = "desacoplo", peg$c132 = peg$literalExpectation("desacoplo", false), peg$c133 = function(valor) { return "return" + (valor ? " " + valor[1] : "") + ";" }, peg$c134 = function(nombre, valor) { return nombre + " = " + valor + ";" }, peg$c135 = function(llamada) { return llamada + ";" }, peg$c136 = function(comprobacion, lanzando) { return 'if(!(' + comprobacion + ')) throw ' + (lanzando ? lanzando : getErrorToCode(text(), location())) + ';' }, peg$c137 = function(bloque, error) { return fromBlockAndCatchToCode(bloque, error, true) }, peg$c138 = "Ejecuto", peg$c139 = peg$literalExpectation("Ejecuto", false), peg$c140 = "ejecuto", peg$c141 = peg$literalExpectation("ejecuto", false), peg$c142 = function(asincronamente, generativa) { return `${ asincronamente ? "await " : "" }${generativa};` }, peg$c143 = "desde directorio", peg$c144 = peg$literalExpectation("desde directorio", false), peg$c145 = "con", peg$c146 = peg$literalExpectation("con", false), peg$c147 = function(asincronamente, desde, generativa) { return `${ asincronamente ? "await " : "" }Castelog.metodos.un_proyecto_npm(${generativa}, ${desde ? desde[1] : 'undefined'}, ${asincronamente ? "true" : "false"});` }, peg$c148 = "Inicio", peg$c149 = peg$literalExpectation("Inicio", false), peg$c150 = "inicio", peg$c151 = peg$literalExpectation("inicio", false), peg$c152 = "proyecto NPM", peg$c153 = peg$literalExpectation("proyecto NPM", false), peg$c154 = "proyecto npm", peg$c155 = peg$literalExpectation("proyecto npm", false), peg$c156 = function(asincronamente) { return asincronamente }, peg$c157 = "Defino", peg$c158 = peg$literalExpectation("Defino", false), peg$c159 = "defino", peg$c160 = peg$literalExpectation("defino", false), peg$c161 = " constante", peg$c162 = peg$literalExpectation(" constante", false), peg$c163 = " variable", peg$c164 = peg$literalExpectation(" variable", false), peg$c165 = function(asincronamente, tipo, nombre, generativa) { return `${(tipo && (tipo === ' variable')) ? 'let' : 'const'} ${nombre} = ${asincronamente ? '(await ' : ''}${generativa}${asincronamente ? ')' : ''};` }, peg$c166 = "Redefino", peg$c167 = peg$literalExpectation("Redefino", false), peg$c168 = "redefino", peg$c169 = peg$literalExpectation("redefino", false), peg$c170 = function(asincronamente, nombre, generativa) { return `${nombre} = ${asincronamente ? '(await ' : ''}${generativa}${asincronamente ? ')' : ''};` }, peg$c171 = "Elimino", peg$c172 = peg$literalExpectation("Elimino", false), peg$c173 = "elimino", peg$c174 = peg$literalExpectation("elimino", false), peg$c175 = "directorio", peg$c176 = peg$literalExpectation("directorio", false), peg$c177 = function(asincronamente, recursivamente, directorio) { return `${asincronamente ? "await require('fs').promises.rmdir" : "require('fs').rmdirSync"}(${directorio}, { recursive: ${recursivamente ? "true" : "false"} });` }, peg$c178 = "recursivamente", peg$c179 = peg$literalExpectation("recursivamente", false), peg$c180 = "Genero", peg$c181 = peg$literalExpectation("Genero", false), peg$c182 = "genero", peg$c183 = peg$literalExpectation("genero", false), peg$c184 = function(asincronamente, recursivamente, directorio) { return `${asincronamente ? "await require('fs').promises.mkdir" : "require('fs').mkdirSync"}(${directorio});` }, peg$c185 = "fichero", peg$c186 = peg$literalExpectation("fichero", false), peg$c187 = function(asincronamente, fichero) { return `${asincronamente ? "await require('fs').promises.unlink" : "require('fs').unlinkSync"}(${fichero});` }, peg$c188 = function(asincronamente, fichero, codificacion, contenido) { return `${asincronamente ? "await require('fs').promises.writeFile" : "require('fs').writeFileSync"}(${fichero}, ${contenido}, ${codificacion});` }, peg$c189 = "Importo API nativa", peg$c190 = peg$literalExpectation("Importo API nativa", false), peg$c191 = "Importo api nativa", peg$c192 = peg$literalExpectation("Importo api nativa", false), peg$c193 = "importo api nativa", peg$c194 = peg$literalExpectation("importo api nativa", false), peg$c195 = function() { return lib_source_code + "\n"; }, peg$c196 = "Importo jQuery", peg$c197 = peg$literalExpectation("Importo jQuery", false), peg$c198 = "importo jquery", peg$c199 = peg$literalExpectation("importo jquery", false), peg$c200 = "importo jQuery", peg$c201 = peg$literalExpectation("importo jQuery", false), peg$c202 = function() { return jquery_source_code + "\n"; }, peg$c203 = "Importo m\xF3dulo universal est\xE1ndar", peg$c204 = peg$literalExpectation("Importo m\xF3dulo universal est\xE1ndar", false), peg$c205 = "importo m\xF3dulo universal est\xE1ndar", peg$c206 = peg$literalExpectation("importo m\xF3dulo universal est\xE1ndar", false), peg$c207 = function(llamado, creando, errores) { return `${creando ? creando : ""}Castelog.metodos.una_importacion_de_modulo_universal_estandar(${llamado}, ${errores});`}, peg$c208 = function(tipo, nombre, ruta, cacheado, creando, errores) { return generate_import_module_expression(tipo, nombre, ruta, cacheado, creando, errores) }, peg$c209 = function(ruta) { return ruta }, peg$c210 = "asignando", peg$c211 = peg$literalExpectation("asignando", false), peg$c212 = function(ref) { return ref + ' = ' }, peg$c213 = "creando", peg$c214 = peg$literalExpectation("creando", false), peg$c215 = "constante", peg$c216 = peg$literalExpectation("constante", false), peg$c217 = "variable", peg$c218 = peg$literalExpectation("variable", false), peg$c219 = function(tp, ref) { return ( tp ? tp[1] === 'variable' ? 'let ' : 'const ' : '' ) + ref + ' = '}, peg$c220 = "a", peg$c221 = peg$literalExpectation("a", false), peg$c222 = function(id) { return id }, peg$c223 = "de nombre", peg$c224 = peg$literalExpectation("de nombre", false), peg$c225 = "Exporto m\xF3dulo universal est\xE1ndar", peg$c226 = peg$literalExpectation("Exporto m\xF3dulo universal est\xE1ndar", false), peg$c227 = "exporto m\xF3dulo universal est\xE1ndar", peg$c228 = peg$literalExpectation("exporto m\xF3dulo universal est\xE1ndar", false), peg$c229 = function(llamado, a_partir_de) { return `Castelog.metodos.una_exportacion_de_modulo_universal_estandar(${llamado}, ${a_partir_de}, (typeof __dirname !== 'undefined') ? __dirname : undefined, (typeof process !== 'undefined') ? process.cwd() : undefined);`}, peg$c230 = function(tipo, valor, cacheado) { return generate_export_module_expression(valor, tipo, cacheado) }, peg$c231 = function(con, bloque) { return (con ? con : "error") + ' => {\n' + bloque + '}'; }, peg$c232 = function(con, bloque, finalmente) { return 'catch(' + (con ? con[1] : "error") + ') {\n' + bloque + '}' + (finalmente ? (' finally {' + finalmente[1] + '}') : ''); }, peg$c233 = function(generativa) { return "throw " + generativa + ";" }, peg$c234 = function(generativa) { return "console.log('[DEBUG]', " + generativa + ");" }, peg$c235 = function(con) { return "super" + (con ? con : "()") }, peg$c236 = "Derivo", peg$c237 = peg$literalExpectation("Derivo", false), peg$c238 = "derivo", peg$c239 = peg$literalExpectation("derivo", false), peg$c240 = "Ignoro que", peg$c241 = peg$literalExpectation("Ignoro que", false), peg$c242 = "ignoro que", peg$c243 = peg$literalExpectation("ignoro que", false), peg$c244 = function(bloque) { return "/////////////////////////\n// Ignorado por Castelog:\n// " + bloque.replace(/\n/g, "\n// ") + "\n" }, peg$c245 = function(generativa) { return "console.log(" + generativa + ");" }, peg$c246 = ":>", peg$c247 = peg$literalExpectation(":>", false), peg$c248 = "<:", peg$c249 = peg$literalExpectation("<:", false), peg$c250 = function(contenido) { return '\n$plantilla += (' + reduce_plantilla(contenido) + ')((typeof config === "object") ? config : {}, (typeof settings === "object") ? settings : {})'; }, peg$c251 = function(sentido, referencia, variacion) { return referencia + sentido + (variacion ? variacion[1] : "1") + ";" }, peg$c252 = "proceso", peg$c253 = peg$literalExpectation("proceso", false), peg$c254 = function(sentido, referencia) { return sentido + (referencia ? (" " + referencia[1]) : "") + ";" }, peg$c255 = "donde", peg$c256 = peg$literalExpectation("donde", false), peg$c257 = function(etiqueta) { return etiqueta + ":\n"}, peg$c258 = function(etiqueta, desde, hasta, usando, bloque) { return fromLoopDataToCode(etiqueta, desde, hasta, usando, bloque) }, peg$c259 = "Apendizo", peg$c260 = peg$literalExpectation("Apendizo", false), peg$c261 = "apendizo", peg$c262 = peg$literalExpectation("apendizo", false), peg$c263 = "Prependizo", peg$c264 = peg$literalExpectation("Prependizo", false), peg$c265 = "prependizo", peg$c266 = peg$literalExpectation("prependizo", false), peg$c267 = "en", peg$c268 = peg$literalExpectation("en", false), peg$c269 = function(movimiento, item, lista) { return `${lista}.${(movimiento.toLowerCase() === "apendizo") ? "push" : (movimiento.toLowerCase() === "prependizo") ? "unshift" : "concat" }(${item})` }, peg$c270 = "En proceso", peg$c271 = peg$literalExpectation("En proceso", false), peg$c272 = "en proceso", peg$c273 = peg$literalExpectation("en proceso", false), peg$c274 = function(nombre, bloque) { return `${nombre ? nombre + ":" : "" } {\n${bloque}}\n` }, peg$c275 = function(asincronamente, directorio) { return `${asincronamente ? 'await ' : ''}Castelog.metodos.un_reseteo_de_directorio(${directorio}, ${asincronamente ? 'true' : 'false'})` }, peg$c276 = "Reseteo directorio", peg$c277 = peg$literalExpectation("Reseteo directorio", false), peg$c278 = "reseteo directorio", peg$c279 = peg$literalExpectation("reseteo directorio", false), peg$c280 = function() { return false }, peg$c281 = "Reseteo", peg$c282 = peg$literalExpectation("Reseteo", false), peg$c283 = "reseteo", peg$c284 = peg$literalExpectation("reseteo", false), peg$c285 = function() { return true }, peg$c286 = "Sirvo ficheros est\xE1ticos", peg$c287 = peg$literalExpectation("Sirvo ficheros est\xE1ticos", false), peg$c288 = "sirvo ficheros est\xE1ticos", peg$c289 = peg$literalExpectation("sirvo ficheros est\xE1ticos", false), peg$c290 = function(con, errores, ficherosNoEncontrados, otrosCasos) { return `Castelog.metodos.un_servicio_de_ficheros_estaticos(${con ? con : "undefined"}, ${errores ? errores : "undefined"}, ${ficherosNoEncontrados ? ficherosNoEncontrados : "undefined"}, ${otrosCasos ? otrosCasos : "undefined"})` }, peg$c291 = "en otros casos", peg$c292 = peg$literalExpectation("en otros casos", false), peg$c293 = function(asincronamente, bloque) { return `${asincronamente ? "async " : ""}() => {\n${bloque}\n}` }, peg$c294 = "en ficheros no encontrados", peg$c295 = peg$literalExpectation("en ficheros no encontrados", false), peg$c296 = "no hago nada", peg$c297 = peg$literalExpectation("no hago nada", false), peg$c298 = "No hago nada", peg$c299 = peg$literalExpectation("No hago nada", false), peg$c300 = function() { return JSON.stringify("Sentencia de no hacer nada") + ";" }, peg$c301 = function(seccion) { return seccion }, peg$c302 = "@SECCI\xD3N", peg$c303 = peg$literalExpectation("@SECCI\xD3N", false), peg$c304 = "@secci\xF3n", peg$c305 = peg$literalExpectation("@secci\xF3n", false), peg$c306 = "@Secci\xF3n", peg$c307 = peg$literalExpectation("@Secci\xF3n", false), peg$c308 = function(titulo) { return "\n// [castelog:seccionable] Esto es una sección del documento: " + titulo + "" }, peg$c309 = function(documentacion) { return documentacion }, peg$c310 = "@DOCUMENTACI\xD3N", peg$c311 = peg$literalExpectation("@DOCUMENTACI\xD3N", false), peg$c312 = "@documentaci\xF3n", peg$c313 = peg$literalExpectation("@documentaci\xF3n", false), peg$c314 = "@Documentaci\xF3n", peg$c315 = peg$literalExpectation("@Documentaci\xF3n", false), peg$c316 = function(contenido) { return "\n// [castelog:documentable] Esto es documentación del documento: \n" + contenido + "" }, peg$c317 = function(contenido) { return "/**\n * " + (contenido || []).join("\n * ") + "\n */" }, peg$c318 = function(linea) { return linea }, peg$c319 = "\xB7 Sobre ", peg$c320 = peg$literalExpectation("\xB7 Sobre ", false), peg$c321 = "\xB7 sobre ", peg$c322 = peg$literalExpectation("\xB7 sobre ", false), peg$c323 = function(contenido) { return "@" + contenido }, peg$c324 = "\xB7 ", peg$c325 = peg$literalExpectation("\xB7 ", false), peg$c326 = function(contenido) { return contenido }, peg$c327 = "Elimino propiedad", peg$c328 = peg$literalExpectation("Elimino propiedad", false), peg$c329 = "elimino propiedad", peg$c330 = peg$literalExpectation("elimino propiedad", false), peg$c331 = function(prop) { return `delete ${prop};`}, peg$c332 = "Itero como objeto", peg$c333 = peg$literalExpectation("Itero como objeto", false), peg$c334 = "itero como objeto", peg$c335 = peg$literalExpectation("itero como objeto", false), peg$c336 = "Itero como lista", peg$c337 = peg$literalExpectation("Itero como lista", false), peg$c338 = "itero como lista", peg$c339 = peg$literalExpectation("itero como lista", false), peg$c340 = function(etiqueta, tipo, generativa, usando, donde) { return `${ etiqueta ? etiqueta : ''}for(${usando.replace(/ = $/g, "")} ${tipo.toLowerCase() === "itero como objeto" ? "in" : "of" } ${generativa}) {\n${donde}}\n`; }, peg$c341 = "usando", peg$c342 = peg$literalExpectation("usando", false), peg$c343 = function(creando) { return creando }, peg$c344 = "Conecto", peg$c345 = peg$literalExpectation("Conecto", false), peg$c346 = "conecto", peg$c347 = peg$literalExpectation("conecto", false), peg$c348 = "un sistema rest", peg$c349 = peg$literalExpectation("un sistema rest", false), peg$c350 = "un sistema REST", peg$c351 = peg$literalExpectation("un sistema REST", false), peg$c352 = "tipo", peg$c353 = peg$literalExpectation("tipo", false), peg$c354 = "configurado con", peg$c355 = peg$literalExpectation("configurado con", false), peg$c356 = "con server configurado con", peg$c357 = peg$literalExpectation("con server configurado con", false), peg$c358 = function(asincronamente, objetivo, tipo, configuraciones, configuracionesServer, donde, error, creando) { return (creando ? creando : "") + (asincronamente ? "await " : "") + `Castelog.metodos.un_sistema_rest(${configuraciones ? configuraciones[1] : "{}"}, ${configuracionesServer ? configuracionesServer[1] : "{}"}, ${donde ? ("async (RestAPI) => {\n" + donde[1] + "\n}") : "null"}, ${tipo ? tipo[1] : JSON.stringify("default")}, ${error});` }, peg$c359 = "configurada con", peg$c360 = peg$literalExpectation("configurada con", false), peg$c361 = function(asincronamente, objetivo, tipo, configuraciones, creando, error) { return (creando ? creando : "") + (asincronamente ? "await " : "") + `Castelog.metodos.una_conexion_de_base_de_datos(${configuraciones ? configuraciones[1] : "{}"}, ${tipo ? tipo[1] : JSON.stringify("simplestdb")}, ${error}, ${objetivo});` }, peg$c362 = "Selecciono", peg$c363 = peg$literalExpectation("Selecciono", false), peg$c364 = "selecciono", peg$c365 = peg$literalExpectation("selecciono", false), peg$c366 = function(asincronamente, seleccion, creando) { return (creando ? creando : "") + (asincronamente ? "await " : "") + seleccion + ";" }, peg$c367 = "Inserto", peg$c368 = peg$literalExpectation("Inserto", false), peg$c369 = "inserto", peg$c370 = peg$literalExpectation("inserto", false), peg$c371 = function(asincronamente, insercion, creando) { return (creando ? creando : "") + (asincronamente ? "await " : "") + insercion + ";" }, peg$c372 = "Actualizo", peg$c373 = peg$literalExpectation("Actualizo", false), peg$c374 = "actualizo", peg$c375 = peg$literalExpectation("actualizo", false), peg$c376 = function(asincronamente, actualizacion) { return (asincronamente ? "await " : "") + actualizacion + ";" }, peg$c377 = function(asincronamente, eliminacion) { return (asincronamente ? "await " : "") + eliminacion + ";" }, peg$c378 = function(seleccion) { return seleccion }, peg$c379 = "a un \xEDtem", peg$c380 = peg$literalExpectation("a un \xEDtem", false), peg$c381 = "a varios \xEDtems", peg$c382 = peg$literalExpectation("a varios \xEDtems", false), peg$c383 = "al \xFAltimo \xEDtem", peg$c384 = peg$literalExpectation("al \xFAltimo \xEDtem", false), peg$c385 = "al primer \xEDtem", peg$c386 = peg$literalExpectation("al primer \xEDtem", false), peg$c387 = function(objetivo, modelo, filtrando, ordenando, agrupando, paginando, bd, adaptador) { return `Castelog.metodos.una_seleccion_de_base_de_datos(${modelo}, ${filtrando}, ${ordenando}, ${agrupando}, ${paginando}, ${bd}, ${adaptador ? adaptador : "undefined"}, ${JSON.stringify(objetivo)})` }, peg$c388 = "filtrando por", peg$c389 = peg$literalExpectation("filtrando por", false), peg$c390 = "ordenando por", peg$c391 = peg$literalExpectation("ordenando por", false), peg$c392 = "agrupando por", peg$c393 = peg$literalExpectation("agrupando por", false), peg$c394 = "paginando por", peg$c395 = peg$literalExpectation("paginando por", false), peg$c396 = "en base de datos", peg$c397 = peg$literalExpectation("en base de datos", false), peg$c398 = "usando adaptador", peg$c399 = peg$literalExpectation("usando adaptador", false), peg$c400 = function(insercion) { return insercion }, peg$c401 = "de", peg$c402 = peg$literalExpectation("de", false), peg$c403 = "en modelo", peg$c404 = peg$literalExpectation("en modelo", false), peg$c405 = "a tabla", peg$c406 = peg$literalExpectation("a tabla", false), peg$c407 = "a columna", peg$c408 = peg$literalExpectation("a columna", false), peg$c409 = "a base de datos", peg$c410 = peg$literalExpectation("a base de datos", false), peg$c411 = "a script de base de datos", peg$c412 = peg$literalExpectation("a script de base de datos", false), peg$c413 = function(objetivo, modelo, valor, bd, adaptador) { return `Castelog.metodos.una_insercion_de_base_de_datos(${modelo}, ${valor}, ${bd}, ${adaptador ? adaptador : "undefined"}, ${JSON.stringify(objetivo)})` }, peg$c414 = function(actualizacion) { return actualizacion }, peg$c415 = function(objetivo, modelo, registro, valor, bd, adaptador) { return `Castelog.metodos.una_actualizacion_de_base_de_datos(${modelo}, ${registro}, ${valor}, ${bd}, ${adaptador ? adaptador : "undefined"}, ${JSON.stringify(objetivo)})` }, peg$c416 = "con registro", peg$c417 = peg$literalExpectation("con registro", false), peg$c418 = function(eliminacion) { return eliminacion }, peg$c419 = function(objetivo, modelo, registro, bd, adaptador) { return `Castelog.metodos.una_eliminacion_de_base_de_datos(${modelo}, ${registro}, ${bd}, ${adaptador ? adaptador : "undefined"}, ${JSON.stringify(objetivo)})` }, peg$c420 = "una base de datos", peg$c421 = peg$literalExpectation("una base de datos", false), peg$c422 = function() { return "undefined" }, peg$c423 = "una pool de bases de datos", peg$c424 = peg$literalExpectation("una pool de bases de datos", false), peg$c425 = function() { return JSON.stringify("pool") }, peg$c426 = "una selecci\xF3n", peg$c427 = peg$literalExpectation("una selecci\xF3n", false), peg$c428 = "una inserci\xF3n", peg$c429 = peg$literalExpectation("una inserci\xF3n", false), peg$c430 = "una actualizaci\xF3n", peg$c431 = peg$literalExpectation("una actualizaci\xF3n", false), peg$c432 = "una eliminaci\xF3n", peg$c433 = peg$literalExpectation("una eliminaci\xF3n", false), peg$c434 = "Cacheo", peg$c435 = peg$literalExpectation("Cacheo", false), peg$c436 = "cacheo", peg$c437 = peg$literalExpectation("cacheo", false), peg$c438 = function(cacheo, creando) { return (creando ? creando : "") + cacheo }, peg$c439 = "Leo fichero", peg$c440 = peg$literalExpectation("Leo fichero", false), peg$c441 = "leo fichero", peg$c442 = peg$literalExpectation("leo fichero", false), peg$c443 = function(lectura, creando) { return (creando ? creando : "") + lectura }, peg$c444 = "Escribo fichero", peg$c445 = peg$literalExpectation("Escribo fichero", false), peg$c446 = "escribo fichero", peg$c447 = peg$literalExpectation("escribo fichero", false), peg$c448 = function(escritura) { return escritura }, peg$c449 = "Notifico", peg$c450 = peg$literalExpectation("Notifico", false), peg$c451 = "notifico", peg$c452 = peg$literalExpectation("notifico", false), peg$c453 = function(asincronamente, mensaje) { return `${ asincronamente ? " await " : "" }Castelog.metodos.una_notificacion(${mensaje})` }, peg$c454 = "Pregunto", peg$c455 = peg$literalExpectation("Pregunto", false), peg$c456 = "pregunto", peg$c457 = peg$literalExpectation("pregunto", false), peg$c458 = function(asincronamente, pregunta, creando) { return (creando ? creando : "") + ( asincronamente ? " await " : "" ) + pregunta }, peg$c459 = "hasta que", peg$c460 = peg$literalExpectation("hasta que", false), peg$c461 = function(bloque) { return `(resultado => ${bloque})` }, peg$c462 = "por defecto", peg$c463 = peg$literalExpectation("por defecto", false), peg$c464 = function(generativa) { return `${generativa}` }, peg$c465 = "Confirmo", peg$c466 = peg$literalExpectation("Confirmo", false), peg$c467 = "confirmo", peg$c468 = peg$literalExpectation("confirmo", false), peg$c469 = function(asincronamente, mensaje, creando) { return (creando ? creando : "") + ( asincronamente ? " await " : "" ) + `Castelog.metodos.una_confirmacion(${mensaje})` }, peg$c470 = "con mensaje", peg$c471 = peg$literalExpectation("con mensaje", false), peg$c472 = /^[A-Za-z_$]/, peg$c473 = peg$classExpectation([["A", "Z"], ["a", "z"], "_", "$"], false, false), peg$c474 = /^[A-Za-z0-9_$]/, peg$c475 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_", "$"], false, false), peg$c476 = "\xAB", peg$c477 = peg$literalExpectation("\xAB", false), peg$c478 = "\xBB", peg$c479 = peg$literalExpectation("\xBB", false), peg$c480 = function() { return fromComplexIdToSimple(text()) }, peg$c481 = function(variable_1, variable_n) { return [variable_1].concat(variable_n).join("") }, peg$c482 = function(id) { return "." + id }, peg$c483 = function(id) { return "[ " + id + " ]" }, peg$c484 = function(acc, params) { return acc + (params || "") }, peg$c485 = "Creo", peg$c486 = peg$literalExpectation("Creo", false), peg$c487 = "creo", peg$c488 = peg$literalExpectation("creo", false), peg$c489 = "Si", peg$c490 = peg$literalExpectation("Si", false), peg$c491 = "si", peg$c492 = peg$literalExpectation("si", false), peg$c493 = "Pero si", peg$c494 = peg$literalExpectation("Pero si", false), peg$c495 = "pero si", peg$c496 = peg$literalExpectation("pero si", false), peg$c497 = "Y si no", peg$c498 = peg$literalExpectation("Y si no", false), peg$c499 = "y si no", peg$c500 = peg$literalExpectation("y si no", false), peg$c501 = "Aunque si no", peg$c502 = peg$literalExpectation("Aunque si no", false), peg$c503 = "aunque si no", peg$c504 = peg$literalExpectation("aunque si no", false), peg$c505 = "Mientras", peg$c506 = peg$literalExpectation("Mientras", false), peg$c507 = "mientras", peg$c508 = peg$literalExpectation("mientras", false), peg$c509 = "=", peg$c510 = peg$literalExpectation("=", false), peg$c511 = "Retorno", peg$c512 = peg$literalExpectation("Retorno", false), peg$c513 = "retorno", peg$c514 = peg$literalExpectation("retorno", false), peg$c515 = "Asigno", peg$c516 = peg$literalExpectation("Asigno", false), peg$c517 = "asigno", peg$c518 = peg$literalExpectation("asigno", false), peg$c519 = "Hago", peg$c520 = peg$literalExpectation("Hago", false), peg$c521 = "hago", peg$c522 = peg$literalExpectation("hago", false), peg$c523 = "as\xEDncrona", peg$c524 = peg$literalExpectation("as\xEDncrona", false), peg$c525 = "~", peg$c526 = peg$literalExpectation("~", false), peg$c527 = "Imprimo", peg$c528 = peg$literalExpectation("Imprimo", false), peg$c529 = "imprimo", peg$c530 = peg$literalExpectation("imprimo", false), peg$c531 = "Debugo", peg$c532 = peg$literalExpectation("Debugo", false), peg$c533 = "debugo", peg$c534 = peg$literalExpectation("debugo", false), peg$c535 = "Compruebo", peg$c536 = peg$literalExpectation("Compruebo", false), peg$c537 = "compruebo", peg$c538 = peg$literalExpectation("compruebo", false), peg$c539 = "lanzando", peg$c540 = peg$literalExpectation("lanzando", false), peg$c541 = "Intento", peg$c542 = peg$literalExpectation("Intento", false), peg$c543 = "intento", peg$c544 = peg$literalExpectation("intento", false), peg$c545 = "Un intento", peg$c546 = peg$literalExpectation("Un intento", false), peg$c547 = "un intento", peg$c548 = peg$literalExpectation("un intento", false), peg$c549 = "En errores", peg$c550 = peg$literalExpectation("En errores", false), peg$c551 = "en errores", peg$c552 = peg$literalExpectation("en errores", false), peg$c553 = "Finalmente", peg$c554 = peg$literalExpectation("Finalmente", false), peg$c555 = "finalmente", peg$c556 = peg$literalExpectation("finalmente", false), peg$c557 = "cuando", peg$c558 = peg$literalExpectation("cuando", false), peg$c559 = "si no", peg$c560 = peg$literalExpectation("si no", false), peg$c561 = "entonces", peg$c562 = peg$literalExpectation("entonces", false), peg$c563 = "Lanzo", peg$c564 = peg$literalExpectation("Lanzo", false), peg$c565 = "lanzo", peg$c566 = peg$literalExpectation("lanzo", false), peg$c567 = "Exporto m\xF3dulo", peg$c568 = peg$literalExpectation("Exporto m\xF3dulo", false), peg$c569 = "exporto m\xF3dulo", peg$c570 = peg$literalExpectation("exporto m\xF3dulo", false), peg$c571 = "un nuevo", peg$c572 = peg$literalExpectation("un nuevo", false), peg$c573 = "una nueva", peg$c574 = peg$literalExpectation("una nueva", false), peg$c575 = "una clase", peg$c576 = peg$literalExpectation("una clase", false), peg$c577 = "una promesa", peg$c578 = peg$literalExpectation("una promesa", false), peg$c579 = "un hecho", peg$c580 = peg$literalExpectation("un hecho", false), peg$c581 = "una espera", peg$c582 = peg$literalExpectation("una espera", false), peg$c583 = "M\xE9todo est\xE1tico", peg$c584 = peg$literalExpectation("M\xE9todo est\xE1tico", false), peg$c585 = "m\xE9todo est\xE1tico", peg$c586 = peg$literalExpectation("m\xE9todo est\xE1tico", false), peg$c587 = "M\xE9todo", peg$c588 = peg$literalExpectation("M\xE9todo", false), peg$c589 = "m\xE9todo", peg$c590 = peg$literalExpectation("m\xE9todo", false), peg$c591 = "Propiedad est\xE1tica", peg$c592 = peg$literalExpectation("Propiedad est\xE1tica", false), peg$c593 = "propiedad est\xE1tica", peg$c594 = peg$literalExpectation("propiedad est\xE1tica", false), peg$c595 = "Propiedad", peg$c596 = peg$literalExpectation("Propiedad", false), peg$c597 = "propiedad", peg$c598 = peg$literalExpectation("propiedad", false), peg$c599 = "as\xEDncrono", peg$c600 = peg$literalExpectation("as\xEDncrono", false), peg$c601 = "que extiende", peg$c602 = peg$literalExpectation("que extiende", false), peg$c603 = "Contin\xFAo", peg$c604 = peg$literalExpectation("Contin\xFAo", false), peg$c605 = "contin\xFAo", peg$c606 = peg$literalExpectation("contin\xFAo", false), peg$c607 = function() { return "continue" }, peg$c608 = "Interrumpo", peg$c609 = peg$literalExpectation("Interrumpo", false), peg$c610 = "interrumpo", peg$c611 = peg$literalExpectation("interrumpo", false), peg$c612 = function() { return "break" }, peg$c613 = "Decremento", peg$c614 = peg$literalExpectation("Decremento", false), peg$c615 = "decremento", peg$c616 = peg$literalExpectation("decremento", false), peg$c617 = function() { return " -= " }, peg$c618 = "Incremento", peg$c619 = peg$literalExpectation("Incremento", false), peg$c620 = "incremento", peg$c621 = peg$literalExpectation("incremento", false), peg$c622 = function() { return " += " }, peg$c623 = "Desde", peg$c624 = peg$literalExpectation("Desde", false), peg$c625 = "desde", peg$c626 = peg$literalExpectation("desde", false), peg$c627 = "as\xEDncronamente", peg$c628 = peg$literalExpectation("as\xEDncronamente", false), peg$c629 = "de ruta", peg$c630 = peg$literalExpectation("de ruta", false), peg$c631 = "Importo", peg$c632 = peg$literalExpectation("Importo", false), peg$c633 = "importo", peg$c634 = peg$literalExpectation("importo", false), peg$c635 = "Exporto", peg$c636 = peg$literalExpectation("Exporto", false), peg$c637 = "exporto", peg$c638 = peg$literalExpectation("exporto", false), peg$c639 = "m\xF3dulo es6", peg$c640 = peg$literalExpectation("m\xF3dulo es6", false), peg$c641 = "m\xF3dulo es5 fresco", peg$c642 = peg$literalExpectation("m\xF3dulo es5 fresco", false), peg$c643 = "m\xF3dulo es5", peg$c644 = peg$literalExpectation("m\xF3dulo es5", false), peg$c645 = "m\xF3dulo nativo", peg$c646 = peg$literalExpectation("m\xF3dulo nativo", false), peg$c647 = "m\xF3dulo universal est\xE1ndar", peg$c648 = peg$literalExpectation("m\xF3dulo universal est\xE1ndar", false), peg$c649 = "script tag", peg$c650 = peg$literalExpectation("script tag", false), peg$c651 = "style tag", peg$c652 = peg$literalExpectation("style tag", false), peg$c653 = "cacheado en", peg$c654 = peg$literalExpectation("cacheado en", false), peg$c655 = "un ", peg$c656 = peg$literalExpectation("un ", false), peg$c657 = " importado", peg$c658 = peg$literalExpectation(" importado", false), peg$c659 = function(tipo) { return tipo }, peg$c660 = " exportado", peg$c661 = peg$literalExpectation(" exportado", false), peg$c662 = function(operacion) { return operacion }, peg$c663 = function(prependices, generativa, apendices) { return reduceGenerative(prependices, generativa, apendices) }, peg$c664 = function(generativa) { return "( " + generativa + " )" }, peg$c665 = function() { return `Castelog.metodos.un_numero_textual(${JSON.stringify(text().trim().replace(/^inicionúmero/g,"").replace(/oknúmero$/g,""))})` }, peg$c666 = "'", peg$c667 = peg$literalExpectation("'", false), peg$c668 = /^[^']/, peg$c669 = peg$classExpectation(["'"], true, false), peg$c670 = "\"", peg$c671 = peg$literalExpectation("\"", false), peg$c672 = /^[^"]/, peg$c673 = peg$classExpectation(["\""], true, false), peg$c674 = "`", peg$c675 = peg$literalExpectation("`", false), peg$c676 = /^[^`]/, peg$c677 = peg$classExpectation(["`"], true, false), peg$c678 = function(contenido) { return JSON.stringify(contenido.trim()) }, peg$c679 = "un objeto", peg$c680 = peg$literalExpectation("un objeto", false), peg$c681 = function(items) { return "{ " + (items ? items : "") + "\n}" }, peg$c682 = "una lista", peg$c683 = peg$literalExpectation("una lista", false), peg$c684 = function(generativa) { return generativa ? generativa : "[ ]" }, peg$c685 = function(items) { return "[ " + (items ? items : "") + " ]" }, peg$c686 = "una pregunta", peg$c687 = peg$literalExpectation("una pregunta", false), peg$c688 = function(pregunta) { return pregunta; }, peg$c689 = "silenciosamente", peg$c690 = peg$literalExpectation("silenciosamente", false), peg$c691 = function(mensaje, defecto, hasta, silenciosa) { return `Castelog.metodos.una_pregunta(${ mensaje }, ${ defecto }, ${silenciosa ? "true" : "false"}, ${ hasta })`}, peg$c692 = "un valor aleatorio de", peg$c693 = peg$literalExpectation("un valor aleatorio de", false), peg$c694 = function(lista) { return `Castelog.metodos.un_valor_aleatorio(${lista})` }, peg$c695 = "un texto aleatorio de", peg$c696 = peg$literalExpectation("un texto aleatorio de", false), peg$c697 = "caracteres", peg$c698 = peg$literalExpectation("caracteres", false), peg$c699 = "basado en", peg$c700 = peg$literalExpectation("basado en", false), peg$c701 = function(longitud, base) { return `Castelog.metodos.un_texto_aleatorio(${longitud}, ${base ? base[1] : "undefined"})` }, peg$c702 = "es mayor o igual que", peg$c703 = peg$literalExpectation("es mayor o igual que", false), peg$c704 = function() { return ">=" }, peg$c705 = "es menor o igual que", peg$c706 = peg$literalExpectation("es menor o igual que", false), peg$c707 = function() { return "<=" }, peg$c708 = "es mayor que", peg$c709 = peg$literalExpectation("es mayor que", false), peg$c710 = function() { return ">" }, peg$c711 = "es menor que", peg$c712 = peg$literalExpectation("es menor que", false), peg$c713 = function() { return "<" }, peg$c714 = "es igual que", peg$c715 = peg$literalExpectation("es igual que", false), peg$c716 = function() { return "=" }, peg$c717 = "es diferente de", peg$c718 = peg$literalExpectation("es diferente de", false), peg$c719 = function() { return "!=" }, peg$c720 = "es nulo", peg$c721 = peg$literalExpectation("es nulo", false), peg$c722 = function() { return "=null" }, peg$c723 = "contiene", peg$c724 = peg$literalExpectation("contiene", false), peg$c725 = function() { return "has" }, peg$c726 = "est\xE1 contenido en", peg$c727 = peg$literalExpectation("est\xE1 contenido en", false), peg$c728 = function() { return "in" }, peg$c729 = "no es mayor o igual que", peg$c730 = peg$literalExpectation("no es mayor o igual que", false), peg$c731 = "no es menor o igual que", peg$c732 = peg$literalExpectation("no es menor o igual que", false),