repariert
This commit is contained in:
parent
7cdfe72c79
commit
845ccce476
|
|
@ -4,76 +4,3 @@
|
|||
*/
|
||||
type char = string;
|
||||
|
||||
|
||||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
declare var require : (path : string)=>any;
|
||||
|
||||
|
||||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
declare var process : any;
|
||||
|
||||
|
||||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
declare class Buffer
|
||||
{
|
||||
public toString() : string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
declare class Promise<type_result, type_reason>
|
||||
{
|
||||
|
||||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
public constructor
|
||||
(
|
||||
executor : (resolve : (result ?: type_result)=>void, reject ?: (reason ?: type_reason)=>void)=>void
|
||||
)
|
||||
;
|
||||
|
||||
|
||||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
public then<type_result_, type_reason_>
|
||||
(
|
||||
onFulfilled : (result : type_result)=>any,
|
||||
onRejected ?: (reason : type_reason)=>any
|
||||
)
|
||||
: Promise<type_result_, type_reason_>
|
||||
;
|
||||
|
||||
|
||||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
public catch<type_result_, type_reason_>
|
||||
(
|
||||
onRejected : (reason : type_reason)=>any
|
||||
)
|
||||
: Promise<type_result_, type_reason_>
|
||||
;
|
||||
|
||||
|
||||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
public static resolve<type_result, type_reason>
|
||||
(
|
||||
result : type_result
|
||||
)
|
||||
: Promise<type_result, type_reason>
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
|
||||
///<reference path="../../lang/build/logic-decl.d.ts"/>
|
||||
///<reference path="../../plankton/base/build/logic-decl.d.ts"/>
|
||||
///<reference path="../../plankton/call/build/logic-decl.d.ts"/>
|
||||
///<reference path="../../plankton/lang/build/logic-decl.d.ts"/>
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -11,11 +13,11 @@ type type_myreader = lib_lang.class_reader<char, lib_lang.type_terminal_default,
|
|||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
var generate_reader : (path : string)=>Promise<type_myreader, Error> =
|
||||
path => Promise.resolve<string, Error>(path)
|
||||
var generate_reader : (path : string)=>lib_call.type_promise<type_myreader, Error> =
|
||||
path => lib_call.promise_resolve(path)
|
||||
.then<Buffer, Error>
|
||||
(
|
||||
path => new Promise<Buffer, Error>
|
||||
path => lib_call.promise_make<Buffer, Error>
|
||||
(
|
||||
(resolve, reject) =>
|
||||
{
|
||||
|
|
@ -45,7 +47,7 @@ var generate_reader : (path : string)=>Promise<type_myreader, Error> =
|
|||
)
|
||||
.then<any, Error>
|
||||
(
|
||||
buffer => new Promise<any, Error>
|
||||
buffer => lib_call.promise_make<any, Error>
|
||||
(
|
||||
(resolve, reject) =>
|
||||
{
|
||||
|
|
@ -55,7 +57,7 @@ var generate_reader : (path : string)=>Promise<type_myreader, Error> =
|
|||
)
|
||||
.then<type_myreader, Error>
|
||||
(
|
||||
data => new Promise<type_myreader, Error>
|
||||
data => lib_call.promise_make<type_myreader, Error>
|
||||
(
|
||||
(resolve, reject) =>
|
||||
{
|
||||
|
|
@ -69,11 +71,11 @@ var generate_reader : (path : string)=>Promise<type_myreader, Error> =
|
|||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
var transform_arguments : (args : Array<string>)=>Promise<{path ?: string; input ?: Array<char>;}, Error> =
|
||||
args => Promise.resolve<{path ?: string; input ?: Array<char>;}, Error>({})
|
||||
.then<{path ?: string; input ?: Array<char>;}, Error>
|
||||
var transform_arguments : (args : Array<string>)=>lib_call.type_promise<{path ?: string; input ?: Array<char>;}, Error> =
|
||||
args => lib_call.promise_resolve<{path ?: string; input ?: Array<char>;}, Error>({})
|
||||
.then<{path ?: string; input ?: Array<char>;}/*, Error*/>
|
||||
(
|
||||
parameters => new Promise<{path ?: string; input ?: Array<char>;}, Error>
|
||||
parameters => lib_call.promise_make<{path ?: string; input ?: Array<char>;}, Error>
|
||||
(
|
||||
(resolve, reject) =>
|
||||
{
|
||||
|
|
@ -90,9 +92,9 @@ var transform_arguments : (args : Array<string>)=>Promise<{path ?: string; input
|
|||
}
|
||||
)
|
||||
)
|
||||
.then<{path ?: string; input ?: Array<char>;}, Error>
|
||||
.then<{path ?: string; input ?: Array<char>;}/*, Error*/>
|
||||
(
|
||||
parameters => new Promise<{path ?: string; input ?: Array<char>;}, Error>
|
||||
parameters => lib_call.promise_make<{path ?: string; input ?: Array<char>;}, Error>
|
||||
(
|
||||
(resolve, reject) =>
|
||||
{
|
||||
|
|
@ -116,18 +118,18 @@ var transform_arguments : (args : Array<string>)=>Promise<{path ?: string; input
|
|||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
var main : (args : Array<string>)=>Promise<void, Error> =
|
||||
args => Promise.resolve<void, Error>(undefined)
|
||||
.then<{path ?: string; input ?: Array<char>;}, Error>
|
||||
var main : (args : Array<string>)=>lib_call.type_promise<void, Error> =
|
||||
args => lib_call.promise_resolve<void, Error>(undefined)
|
||||
.then<{path ?: string; input ?: Array<char>;}/*, Error*/>
|
||||
(
|
||||
_ => transform_arguments(args)
|
||||
)
|
||||
.then<{parameters : {path ?: string; input ?: Array<char>;}; reader : type_myreader;}, Error>
|
||||
.then<{parameters : {path ?: string; input ?: Array<char>;}; reader : type_myreader;}/*, Error*/>
|
||||
(
|
||||
parameters => generate_reader(parameters.path)
|
||||
.then<{parameters : {path ?: string; input ?: Array<char>;}; reader : type_myreader;}, Error>
|
||||
(
|
||||
reader => new Promise<{parameters : {path ?: string; input ?: Array<char>;}; reader : type_myreader;}, Error>
|
||||
reader => lib_call.promise_make<{parameters : {path ?: string; input ?: Array<char>;}; reader : type_myreader;}, Error>
|
||||
(
|
||||
(resolve_, reject_) =>
|
||||
{
|
||||
|
|
@ -136,9 +138,9 @@ var main : (args : Array<string>)=>Promise<void, Error> =
|
|||
)
|
||||
)
|
||||
)
|
||||
.then<lib_lang.type_tree<lib_lang.type_terminal_default>, Error>
|
||||
.then<lib_lang.type_tree<lib_lang.type_terminal_default>/*, Error*/>
|
||||
(
|
||||
vars => new Promise<lib_lang.type_tree<lib_lang.type_terminal_default>, Error>
|
||||
vars => lib_call.promise_make<lib_lang.type_tree<lib_lang.type_terminal_default>, Error>
|
||||
(
|
||||
(resolve, reject) =>
|
||||
{
|
||||
|
|
@ -156,9 +158,9 @@ var main : (args : Array<string>)=>Promise<void, Error> =
|
|||
}
|
||||
)
|
||||
)
|
||||
.then<void, Error>
|
||||
.then<void/*, Error*/>
|
||||
(
|
||||
result => new Promise<void, Error>
|
||||
result => lib_call.promise_make<void, Error>
|
||||
(
|
||||
(resolve, reject) =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,26 +2,30 @@
|
|||
"name": "type2",
|
||||
"version": "0.0.1",
|
||||
"dependencies": [
|
||||
"../plankton/lang/project.json"
|
||||
"../plankton/lang/lang.prj.json"
|
||||
],
|
||||
"roottask": {
|
||||
"name": "link",
|
||||
"type": "schwamm-apply",
|
||||
"type": "schwamm",
|
||||
"parameters": {
|
||||
"path": "build/schwamm.json",
|
||||
"outputs": {
|
||||
"logic-impl": "build/type2.js"
|
||||
"includes": [
|
||||
"build/type2.swm.json"
|
||||
],
|
||||
"output": {
|
||||
"dump": {
|
||||
"logic-impl": "build/type2.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sub": [
|
||||
{
|
||||
"name": "build",
|
||||
"type": "schwamm-create",
|
||||
"type": "schwamm",
|
||||
"parameters": {
|
||||
"includes": [
|
||||
"../plankton/lang/build/schwamm.json"
|
||||
"../plankton/lang/build/lang.swm.json"
|
||||
],
|
||||
"adhoc": {
|
||||
"inputs": {
|
||||
"logic-decl": [
|
||||
"temp/unlinked-logic-decl.d.ts"
|
||||
],
|
||||
|
|
@ -29,13 +33,16 @@
|
|||
"temp/unlinked-logic-impl.js"
|
||||
]
|
||||
},
|
||||
"output": "build/schwamm.json"
|
||||
"output": {
|
||||
"save": "build/type2.swm.json"
|
||||
}
|
||||
},
|
||||
"sub": [
|
||||
{
|
||||
"name": "logic",
|
||||
"type": "typescript",
|
||||
"parameters": {
|
||||
"target": "ES6",
|
||||
"allowUnreachableCode": true,
|
||||
"inputs": [
|
||||
"source/base.ts",
|
||||
Loading…
Reference in a new issue