[upd] plankton
This commit is contained in:
parent
40f6550246
commit
fd2aaea5fa
5
lib/plankton/plankton.d.ts
vendored
5
lib/plankton/plankton.d.ts
vendored
|
|
@ -938,6 +938,9 @@ declare namespace lib_plankton.file {
|
|||
* @author fenris
|
||||
*/
|
||||
function write_buffer(path: string, content: Buffer, options?: {}): Promise<void>;
|
||||
/**
|
||||
*/
|
||||
function delete_(path: string): Promise<void>;
|
||||
}
|
||||
declare namespace lib_plankton.prog {
|
||||
/**
|
||||
|
|
@ -1275,7 +1278,7 @@ declare namespace lib_plankton.prog {
|
|||
render_program: ((program: struct_program) => string);
|
||||
};
|
||||
}
|
||||
declare namespace lib_plankton.prog {
|
||||
declare namespace lib_plankton.prog.typescript {
|
||||
/**
|
||||
*/
|
||||
function render_type(type: struct_type, options?: {
|
||||
|
|
|
|||
|
|
@ -2766,7 +2766,7 @@ var lib_plankton;
|
|||
return (new Promise(function (resolve, reject) {
|
||||
nm_fs.readFile(path, {
|
||||
"encoding": "utf8",
|
||||
"flag": "r"
|
||||
"flag": "r",
|
||||
}, function (error, content) {
|
||||
if (error == null) {
|
||||
resolve(content);
|
||||
|
|
@ -2785,7 +2785,7 @@ var lib_plankton;
|
|||
var nm_fs = require("fs");
|
||||
return (new Promise(function (resolve, reject) {
|
||||
nm_fs.readFile(path, {
|
||||
"flag": "r"
|
||||
"flag": "r",
|
||||
}, function (error, content) {
|
||||
if (error == null) {
|
||||
resolve(content);
|
||||
|
|
@ -2822,13 +2822,13 @@ var lib_plankton;
|
|||
function write(path, content, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
options = Object.assign({
|
||||
"encoding": "utf-8"
|
||||
"encoding": "utf-8",
|
||||
}, options);
|
||||
var nm_fs = require("fs");
|
||||
return (new Promise(function (resolve, reject) {
|
||||
nm_fs.writeFile(path, content, {
|
||||
"encoding": options.encoding,
|
||||
"flag": "w"
|
||||
"flag": "w",
|
||||
}, function (error) {
|
||||
if (error == null) {
|
||||
resolve(undefined);
|
||||
|
|
@ -2849,7 +2849,7 @@ var lib_plankton;
|
|||
var nm_fs = require("fs");
|
||||
return (new Promise(function (resolve, reject) {
|
||||
nm_fs.writeFile(path, content, {
|
||||
"flag": "w"
|
||||
"flag": "w",
|
||||
}, function (error) {
|
||||
if (error == null) {
|
||||
resolve(undefined);
|
||||
|
|
@ -2861,6 +2861,17 @@ var lib_plankton;
|
|||
}));
|
||||
}
|
||||
file.write_buffer = write_buffer;
|
||||
/**
|
||||
*/
|
||||
function delete_(path) {
|
||||
var nm_fs = require("fs");
|
||||
return (new Promise(function (resolve, reject) {
|
||||
nm_fs.unlink(path, function () {
|
||||
resolve(undefined);
|
||||
});
|
||||
}));
|
||||
}
|
||||
file.delete_ = delete_;
|
||||
})(file = lib_plankton.file || (lib_plankton.file = {}));
|
||||
})(lib_plankton || (lib_plankton = {}));
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
|
|
@ -4256,6 +4267,8 @@ var lib_plankton;
|
|||
(function (lib_plankton) {
|
||||
var prog;
|
||||
(function (prog) {
|
||||
var typescript;
|
||||
(function (typescript) {
|
||||
/**
|
||||
*/
|
||||
function indentation(active, level) {
|
||||
|
|
@ -4269,45 +4282,45 @@ var lib_plankton;
|
|||
if (options === void 0) { options = {}; }
|
||||
options = Object.assign({
|
||||
"indent": true,
|
||||
"level": 0
|
||||
"level": 0,
|
||||
}, options);
|
||||
if (type instanceof prog.struct_type_literal) {
|
||||
var type_literal = type;
|
||||
return lib_plankton.string.coin("{{indentation}}{{value}}", {
|
||||
"indentation": indentation(options.indent, options.level),
|
||||
"value": render_expression(type_literal.value, {
|
||||
"level": (options.level + 1)
|
||||
})
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
});
|
||||
}
|
||||
else if (type instanceof prog.struct_type_any) {
|
||||
var type_any = type;
|
||||
return lib_plankton.string.coin("{{indentation}}any", {
|
||||
"indentation": indentation(options.indent, options.level)
|
||||
"indentation": indentation(options.indent, options.level),
|
||||
});
|
||||
}
|
||||
else if (type instanceof prog.struct_type_void) {
|
||||
var type_void = type;
|
||||
return lib_plankton.string.coin("{{indentation}}void", {
|
||||
"indentation": indentation(options.indent, options.level)
|
||||
"indentation": indentation(options.indent, options.level),
|
||||
});
|
||||
}
|
||||
else if (type instanceof prog.struct_type_boolean) {
|
||||
var type_boolean = type;
|
||||
return lib_plankton.string.coin("{{indentation}}boolean", {
|
||||
"indentation": indentation(options.indent, options.level)
|
||||
"indentation": indentation(options.indent, options.level),
|
||||
});
|
||||
}
|
||||
else if (type instanceof prog.struct_type_integer) {
|
||||
var type_integer = type;
|
||||
return lib_plankton.string.coin("{{indentation}}number", {
|
||||
"indentation": indentation(options.indent, options.level)
|
||||
"indentation": indentation(options.indent, options.level),
|
||||
});
|
||||
}
|
||||
else if (type instanceof prog.struct_type_string) {
|
||||
var type_string = type;
|
||||
return lib_plankton.string.coin("{{indentation}}string", {
|
||||
"indentation": indentation(options.indent, options.level)
|
||||
"indentation": indentation(options.indent, options.level),
|
||||
});
|
||||
}
|
||||
else if (type instanceof prog.struct_type_list) {
|
||||
|
|
@ -4335,10 +4348,10 @@ var lib_plankton;
|
|||
"assignment": (field.mandatory ? ":" : "?:"),
|
||||
"type": render_type(field.type, {
|
||||
"indent": false,
|
||||
"level": (options.level + 1)
|
||||
})
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
}); })
|
||||
.join(";\n"))
|
||||
.join(";\n")),
|
||||
});
|
||||
}
|
||||
else if (type instanceof prog.struct_type_function) {
|
||||
|
|
@ -4348,12 +4361,12 @@ var lib_plankton;
|
|||
"indentation2": indentation(true, options.level),
|
||||
"arguments": (type_function.arguments
|
||||
.map(function (argument) { return render_type(argument, {
|
||||
"level": (options.level + 1)
|
||||
"level": (options.level + 1),
|
||||
}); })
|
||||
.join(", ")),
|
||||
"target": render_type(type_function.target, {
|
||||
"level": (options.level + 1)
|
||||
})
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
});
|
||||
}
|
||||
else if (type instanceof prog.struct_type_construction) {
|
||||
|
|
@ -4367,10 +4380,10 @@ var lib_plankton;
|
|||
"indentation": indentation(true, options.level),
|
||||
"arguments": (type_construction.arguments
|
||||
.map(function (argument) { return render_type(argument, {
|
||||
"level": (options.level + 1)
|
||||
"level": (options.level + 1),
|
||||
}); })
|
||||
.join(",\n"))
|
||||
}))
|
||||
.join(",\n")),
|
||||
})),
|
||||
});
|
||||
}
|
||||
else if (type instanceof prog.struct_type_union) {
|
||||
|
|
@ -4380,11 +4393,11 @@ var lib_plankton;
|
|||
"indentation2": indentation(true, options.level),
|
||||
"indentation3": indentation(true, options.level + 1),
|
||||
"left": render_type(type_union.left, {
|
||||
"level": (options.level + 1)
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
"right": render_type(type_union.right, {
|
||||
"level": (options.level + 1)
|
||||
})
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
});
|
||||
}
|
||||
else if (type instanceof prog.struct_type_intersection) {
|
||||
|
|
@ -4393,38 +4406,38 @@ var lib_plankton;
|
|||
"indentation1": indentation(options.indent, options.level),
|
||||
"indentation2": indentation(true, options.level + 1),
|
||||
"left": render_type(type_intersection.left, {
|
||||
"level": (options.level + 1)
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
"right": render_type(type_intersection.right, {
|
||||
"level": (options.level + 1)
|
||||
})
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
});
|
||||
}
|
||||
else {
|
||||
throw (new Error("unhandled type kind: " + String(type)));
|
||||
}
|
||||
}
|
||||
prog.render_type = render_type;
|
||||
typescript.render_type = render_type;
|
||||
/**
|
||||
*/
|
||||
function render_expression(expression, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
options = Object.assign({
|
||||
"indent": false,
|
||||
"level": 0
|
||||
"level": 0,
|
||||
}, options);
|
||||
if (expression instanceof prog.struct_expression_variable) {
|
||||
var expression_variable = expression;
|
||||
return lib_plankton.string.coin("{{indentation}}{{name}}", {
|
||||
"indentation": indentation(options.indent, options.level),
|
||||
"name": expression.name
|
||||
"name": expression.name,
|
||||
});
|
||||
}
|
||||
else if (expression instanceof prog.struct_expression_literal) {
|
||||
var expression_literal = expression;
|
||||
return lib_plankton.string.coin("{{indentation}}{{value}}", {
|
||||
"indentation": indentation(options.indent, options.level),
|
||||
"value": JSON.stringify(expression_literal.value)
|
||||
"value": JSON.stringify(expression_literal.value),
|
||||
});
|
||||
}
|
||||
else if (expression instanceof prog.struct_expression_list) {
|
||||
|
|
@ -4437,10 +4450,10 @@ var lib_plankton;
|
|||
"indentation": indentation(true, options.level + 1),
|
||||
"value": render_expression(element, {
|
||||
"indent": false,
|
||||
"level": (options.level + 1)
|
||||
})
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
}); })
|
||||
.join(",\n"))
|
||||
.join(",\n")),
|
||||
});
|
||||
}
|
||||
else if (expression instanceof prog.struct_expression_dict) {
|
||||
|
|
@ -4454,10 +4467,10 @@ var lib_plankton;
|
|||
"key": field.key,
|
||||
"value": render_expression(field.value, {
|
||||
"indent": false,
|
||||
"level": (options.level + 1)
|
||||
})
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
}); })
|
||||
.join(",\n"))
|
||||
.join(",\n")),
|
||||
});
|
||||
}
|
||||
else if (expression instanceof prog.struct_expression_abstraction) {
|
||||
|
|
@ -4475,7 +4488,7 @@ var lib_plankton;
|
|||
? ""
|
||||
: lib_plankton.string.coin(" : {{type}}", {
|
||||
"type": render_type(argument.type)
|
||||
}))
|
||||
})),
|
||||
}); })
|
||||
.join(", ")),
|
||||
"macro_output_type": ((expression_abstraction.output_type === null)
|
||||
|
|
@ -4483,14 +4496,14 @@ var lib_plankton;
|
|||
: lib_plankton.string.coin(" : {{type}}", {
|
||||
"type": render_type(expression_abstraction.output_type, {
|
||||
"indent": false,
|
||||
"level": (options.level + 1)
|
||||
"level": (options.level + 1),
|
||||
})
|
||||
})),
|
||||
"body": (expression_abstraction.body
|
||||
.map(function (statement) { return render_statement(statement, {
|
||||
"level": (options.level + 1)
|
||||
"level": (options.level + 1),
|
||||
}); })
|
||||
.join(""))
|
||||
.join("")),
|
||||
});
|
||||
}
|
||||
else if (expression instanceof prog.struct_expression_function_application) {
|
||||
|
|
@ -4500,16 +4513,16 @@ var lib_plankton;
|
|||
"indentation2": indentation(true, options.level),
|
||||
"name": render_expression(expression_function_application.head, {
|
||||
"indent": false,
|
||||
"level": (options.level + 0)
|
||||
"level": (options.level + 0),
|
||||
}),
|
||||
"arguments": (expression_function_application.arguments
|
||||
.map(function (argument) { return lib_plankton.string.coin("{{argument}}", {
|
||||
"argument": render_expression(argument, {
|
||||
"indent": true,
|
||||
"level": (options.level + 1)
|
||||
})
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
}); })
|
||||
.join(",\n"))
|
||||
.join(",\n")),
|
||||
});
|
||||
}
|
||||
else if (expression instanceof prog.struct_expression_projection) {
|
||||
|
|
@ -4517,7 +4530,7 @@ var lib_plankton;
|
|||
return lib_plankton.string.coin("{{indentation}}{{source}}[{{index}}]", {
|
||||
"indentation": indentation(options.indent, options.level),
|
||||
"source": render_expression(expression_projection.source),
|
||||
"index": render_expression(expression_projection.index)
|
||||
"index": render_expression(expression_projection.index),
|
||||
});
|
||||
}
|
||||
else if (expression instanceof prog.struct_expression_fieldaccess) {
|
||||
|
|
@ -4525,9 +4538,9 @@ var lib_plankton;
|
|||
return lib_plankton.string.coin("{{indentation}}{{structure}}.{{fieldname}}", {
|
||||
"indentation": indentation(options.indent, options.level),
|
||||
"structure": render_expression(expression_fieldaccess.structure, {
|
||||
"level": (options.level + 1)
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
"fieldname": expression_fieldaccess.fieldname
|
||||
"fieldname": expression_fieldaccess.fieldname,
|
||||
});
|
||||
}
|
||||
else if (expression instanceof prog.struct_expression_operation_comparison) {
|
||||
|
|
@ -4536,12 +4549,12 @@ var lib_plankton;
|
|||
"indentation": indentation(options.indent, options.level),
|
||||
"left": render_expression(expression_operation_comparison.left, {
|
||||
"indent": false,
|
||||
"level": (options.level + 0)
|
||||
"level": (options.level + 0),
|
||||
}),
|
||||
"right": render_expression(expression_operation_comparison.right, {
|
||||
"indent": false,
|
||||
"level": (options.level + 0)
|
||||
})
|
||||
"level": (options.level + 0),
|
||||
}),
|
||||
});
|
||||
}
|
||||
else if (expression instanceof prog.struct_expression_await) {
|
||||
|
|
@ -4550,8 +4563,8 @@ var lib_plankton;
|
|||
"indentation": indentation(options.indent, options.level),
|
||||
"target": render_expression(expression_await.target, {
|
||||
"indent": false,
|
||||
"level": (options.level + 0)
|
||||
})
|
||||
"level": (options.level + 0),
|
||||
}),
|
||||
});
|
||||
}
|
||||
else if (expression instanceof prog.struct_expression_cast) {
|
||||
|
|
@ -4560,26 +4573,26 @@ var lib_plankton;
|
|||
"indentation": indentation(options.indent, options.level),
|
||||
"expression": render_expression(expression_cast.expression, {
|
||||
"indent": false,
|
||||
"level": (options.level + 0)
|
||||
"level": (options.level + 0),
|
||||
}),
|
||||
"type": render_type(expression_cast.type, {
|
||||
"indent": false,
|
||||
"level": (options.level + 0)
|
||||
})
|
||||
"level": (options.level + 0),
|
||||
}),
|
||||
});
|
||||
}
|
||||
else {
|
||||
throw (new Error("unhandled expression: " + String(expression)));
|
||||
}
|
||||
}
|
||||
prog.render_expression = render_expression;
|
||||
typescript.render_expression = render_expression;
|
||||
/**
|
||||
*/
|
||||
function render_statement(statement, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
options = Object.assign({
|
||||
"indent": true,
|
||||
"level": 0
|
||||
"level": 0,
|
||||
}, options);
|
||||
if (statement instanceof prog.struct_statement_comment) {
|
||||
var statement_comment = statement;
|
||||
|
|
@ -4589,17 +4602,17 @@ var lib_plankton;
|
|||
"lines": (statement_comment.lines
|
||||
.map(function (line) { return lib_plankton.string.coin("{{indentation}} * {{line}}\n", {
|
||||
"indentation": indentation(options.indent, options.level),
|
||||
"line": line
|
||||
"line": line,
|
||||
}); })
|
||||
.join(""))
|
||||
.join("")),
|
||||
})
|
||||
: lib_plankton.string.coin("{{lines}}", {
|
||||
"lines": (statement_comment.lines
|
||||
.map(function (line) { return lib_plankton.string.coin("{{indentation}}// {{line}}\n", {
|
||||
"indentation": indentation(options.indent, options.level),
|
||||
"line": line
|
||||
"line": line,
|
||||
}); })
|
||||
.join(""))
|
||||
.join("")),
|
||||
}));
|
||||
}
|
||||
else if (statement instanceof prog.struct_statement_block) {
|
||||
|
|
@ -4608,9 +4621,9 @@ var lib_plankton;
|
|||
"indentation": indentation(options.indent, options.level),
|
||||
"statements": (statement_block.statements
|
||||
.map(function (statement) { return render_statement(statement, {
|
||||
"level": (options.level + 1)
|
||||
"level": (options.level + 1),
|
||||
}); })
|
||||
.join(""))
|
||||
.join("")),
|
||||
});
|
||||
}
|
||||
else if (statement instanceof prog.struct_statement_type_definition) {
|
||||
|
|
@ -4620,8 +4633,8 @@ var lib_plankton;
|
|||
"name": statement_type_definition.name,
|
||||
"type": render_type(statement_type_definition.type, {
|
||||
"indent": false,
|
||||
"level": (options.level + 0)
|
||||
})
|
||||
"level": (options.level + 0),
|
||||
}),
|
||||
});
|
||||
}
|
||||
else if (statement instanceof prog.struct_statement_declaration) {
|
||||
|
|
@ -4637,17 +4650,17 @@ var lib_plankton;
|
|||
: lib_plankton.string.coin(" : {{type}}", {
|
||||
"type": render_type(statement_declaration.type, {
|
||||
"indent": false,
|
||||
"level": (options.level + 0)
|
||||
})
|
||||
"level": (options.level + 0),
|
||||
}),
|
||||
})),
|
||||
"macro_value": ((statement_declaration.value === null)
|
||||
? ""
|
||||
: lib_plankton.string.coin(" = {{value}}", {
|
||||
"value": render_expression(statement_declaration.value, {
|
||||
"indent": false,
|
||||
"level": (options.level + 0)
|
||||
})
|
||||
}))
|
||||
"level": (options.level + 0),
|
||||
}),
|
||||
})),
|
||||
});
|
||||
}
|
||||
else if (statement instanceof prog.struct_statement_assignment) {
|
||||
|
|
@ -4657,8 +4670,8 @@ var lib_plankton;
|
|||
"name": statement_assignment.name,
|
||||
"value": render_expression(statement_assignment.value, {
|
||||
"indent": false,
|
||||
"level": (options.level + 1)
|
||||
})
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
});
|
||||
}
|
||||
else if (statement instanceof prog.struct_statement_procedure_call) {
|
||||
|
|
@ -4668,16 +4681,16 @@ var lib_plankton;
|
|||
"indentation2": indentation(true, options.level),
|
||||
"name": render_expression(statement_procedure_call.head, {
|
||||
"indent": false,
|
||||
"level": (options.level + 0)
|
||||
"level": (options.level + 0),
|
||||
}),
|
||||
"arguments": (statement_procedure_call.arguments
|
||||
.map(function (argument) { return lib_plankton.string.coin("{{argument}}", {
|
||||
"argument": render_expression(argument, {
|
||||
"indent": true,
|
||||
"level": (options.level + 1)
|
||||
})
|
||||
"level": (options.level + 1),
|
||||
}),
|
||||
}); })
|
||||
.join(",\n"))
|
||||
.join(",\n")),
|
||||
});
|
||||
}
|
||||
else if (statement instanceof prog.struct_statement_function_definition) {
|
||||
|
|
@ -4698,9 +4711,9 @@ var lib_plankton;
|
|||
: lib_plankton.string.coin(" : {{type}}", {
|
||||
"type": render_type(argument.type, {
|
||||
"indent": false,
|
||||
"level": (options.level + 2)
|
||||
"level": (options.level + 2),
|
||||
})
|
||||
}))
|
||||
})),
|
||||
}); })
|
||||
.join(",\n")),
|
||||
"macro_output_type": ((statement_function_definition.output_type === null)
|
||||
|
|
@ -4708,15 +4721,15 @@ var lib_plankton;
|
|||
: lib_plankton.string.coin(" : {{type}}", {
|
||||
"type": render_type(statement_function_definition.output_type, {
|
||||
"indent": false,
|
||||
"level": (options.level + 0)
|
||||
"level": (options.level + 0),
|
||||
})
|
||||
})),
|
||||
"body": (statement_function_definition.body
|
||||
.map(function (statement) { return render_statement(statement, {
|
||||
"indent": true,
|
||||
"level": (options.level + 1)
|
||||
"level": (options.level + 1),
|
||||
}); })
|
||||
.join(""))
|
||||
.join("")),
|
||||
});
|
||||
}
|
||||
else if (statement instanceof prog.struct_statement_return) {
|
||||
|
|
@ -4725,26 +4738,26 @@ var lib_plankton;
|
|||
"indentation": indentation(options.indent, options.level),
|
||||
"expression": render_expression(statement_return.expression, {
|
||||
"indent": false,
|
||||
"level": (options.level + 0)
|
||||
})
|
||||
"level": (options.level + 0),
|
||||
}),
|
||||
});
|
||||
}
|
||||
else {
|
||||
throw (new Error("unhandled statement: " + (statement.constructor.name)));
|
||||
}
|
||||
}
|
||||
prog.render_statement = render_statement;
|
||||
typescript.render_statement = render_statement;
|
||||
/**
|
||||
*/
|
||||
function render_program(program) {
|
||||
return (program.statements
|
||||
.map(function (statement) { return render_statement(statement, {
|
||||
"indent": true,
|
||||
"level": 0
|
||||
"level": 0,
|
||||
}); })
|
||||
.join("\n"));
|
||||
}
|
||||
prog.render_program = render_program;
|
||||
typescript.render_program = render_program;
|
||||
/**
|
||||
*/
|
||||
function output_typescript() {
|
||||
|
|
@ -4752,10 +4765,11 @@ var lib_plankton;
|
|||
"render_expression": render_expression,
|
||||
"render_type": render_type,
|
||||
"render_statement": render_statement,
|
||||
"render_program": render_program
|
||||
"render_program": render_program,
|
||||
};
|
||||
}
|
||||
prog.output_typescript = output_typescript;
|
||||
typescript.output_typescript = output_typescript;
|
||||
})(typescript = prog.typescript || (prog.typescript = {}));
|
||||
})(prog = lib_plankton.prog || (lib_plankton.prog = {}));
|
||||
})(lib_plankton || (lib_plankton = {}));
|
||||
/*
|
||||
|
|
@ -4881,8 +4895,8 @@ var lib_plankton;
|
|||
"info": info,
|
||||
"hidden": hidden,
|
||||
"parameters": {
|
||||
"index": index
|
||||
}
|
||||
"index": index,
|
||||
},
|
||||
}));
|
||||
};
|
||||
/**
|
||||
|
|
@ -4900,8 +4914,8 @@ var lib_plankton;
|
|||
"hidden": hidden,
|
||||
"parameters": {
|
||||
"indicators_short": indicators_short,
|
||||
"indicators_long": indicators_long
|
||||
}
|
||||
"indicators_long": indicators_long,
|
||||
},
|
||||
}));
|
||||
};
|
||||
/**
|
||||
|
|
@ -5147,17 +5161,17 @@ var lib_plankton;
|
|||
"symbols": {
|
||||
"delimiter": " ",
|
||||
"prefix": "--",
|
||||
"assignment": "="
|
||||
}
|
||||
"assignment": "=",
|
||||
},
|
||||
},
|
||||
"url": {
|
||||
"symbols": {
|
||||
"delimiter": "&",
|
||||
"prefix": "",
|
||||
"assignment": "="
|
||||
}
|
||||
"assignment": "=",
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
/**
|
||||
* @author fenris
|
||||
|
|
@ -5234,14 +5248,14 @@ var lib_plankton;
|
|||
"pattern_from": pattern_from,
|
||||
"pattern_to": pattern_to,
|
||||
"input": input,
|
||||
"result": result
|
||||
"result": result,
|
||||
});
|
||||
input = result;
|
||||
}
|
||||
}
|
||||
}
|
||||
lib_plankton.log.debug("lib_args:read:current_input", {
|
||||
"input": input
|
||||
"input": input,
|
||||
});
|
||||
}
|
||||
// parsing
|
||||
|
|
@ -5252,18 +5266,18 @@ var lib_plankton;
|
|||
var index_expected_1 = 0;
|
||||
parts.forEach(function (part) {
|
||||
lib_plankton.log.debug("lib_args:read:analyzing", {
|
||||
"part": part
|
||||
"part": part,
|
||||
});
|
||||
var found = [
|
||||
function () {
|
||||
lib_plankton.log.debug("lib_args:read:probing_as_volatile", {
|
||||
"part": part
|
||||
"part": part,
|
||||
});
|
||||
for (var _i = 0, _a = Object.entries(_this.filter(args.enum_kind.volatile)); _i < _a.length; _i++) {
|
||||
var _b = _a[_i], name = _b[0], argument = _b[1];
|
||||
lib_plankton.log.debug("lib_args:read:probing_as_volatile:trying", {
|
||||
"part": part,
|
||||
"argument": argument.toString()
|
||||
"argument": argument.toString(),
|
||||
});
|
||||
var pattern = "";
|
||||
{
|
||||
|
|
@ -5282,12 +5296,12 @@ var lib_plankton;
|
|||
pattern += pattern_back;
|
||||
}
|
||||
lib_plankton.log.debug("lib_args:read:probing_as_volatile:pattern", {
|
||||
"pattern": pattern
|
||||
"pattern": pattern,
|
||||
});
|
||||
var regexp = new RegExp(pattern);
|
||||
var matching = regexp.exec(part);
|
||||
lib_plankton.log.debug("lib_args:read:probing_as_volatile:matching", {
|
||||
"matching": matching
|
||||
"matching": matching,
|
||||
});
|
||||
if (matching == null) {
|
||||
// do nothing
|
||||
|
|
@ -5301,7 +5315,7 @@ var lib_plankton;
|
|||
},
|
||||
function () {
|
||||
lib_plankton.log.debug("lib_args:read:probing_as_positional", {
|
||||
"part": part
|
||||
"part": part,
|
||||
});
|
||||
var positional = _this.filter(args.enum_kind.positional);
|
||||
for (var _i = 0, _a = Object.entries(positional); _i < _a.length; _i++) {
|
||||
|
|
@ -5312,7 +5326,7 @@ var lib_plankton;
|
|||
else {
|
||||
lib_plankton.log.debug("lib_args:read:probing_as_positional:trying", {
|
||||
"part": part,
|
||||
"argument": argument.toString()
|
||||
"argument": argument.toString(),
|
||||
});
|
||||
var pattern = "";
|
||||
{
|
||||
|
|
@ -5321,12 +5335,12 @@ var lib_plankton;
|
|||
pattern += pattern_back;
|
||||
}
|
||||
lib_plankton.log.debug("lib_args:read:probing_as_positional:pattern", {
|
||||
"pattern": pattern
|
||||
"pattern": pattern,
|
||||
});
|
||||
var regexp = new RegExp(pattern);
|
||||
var matching = regexp.exec(part);
|
||||
lib_plankton.log.debug("lib_args:read:probing_as_positional:matching", {
|
||||
"matching": matching
|
||||
"matching": matching,
|
||||
});
|
||||
if (matching == null) {
|
||||
return false;
|
||||
|
|
@ -5343,7 +5357,7 @@ var lib_plankton;
|
|||
].some(function (x) { return x(); });
|
||||
if (!found) {
|
||||
lib_plankton.log.warning("lib_args:read:could_not_parse", {
|
||||
"part": part
|
||||
"part": part,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue