@cryptoeconomicslab/ovm-transpiler
Advanced tools
Comparing version 0.2.9 to 0.2.10
@@ -25,3 +25,3 @@ /** | ||
originalPredicateName: string; | ||
connective: LogicalConnective; | ||
connective: LogicalConnective | LogicalConnectiveStrings; | ||
inputDefs: string[]; | ||
@@ -38,3 +38,3 @@ inputs: (AtomicProposition | Placeholder)[]; | ||
export declare type Placeholder = string; | ||
export declare type PredicateCall = AtomicPredicateCall | InputPredicateCall | VariablePredicateCall; | ||
export declare type PredicateCall = AtomicPredicateCall | InputPredicateCall | VariablePredicateCall | CompiledPredicateCall; | ||
/** | ||
@@ -61,2 +61,10 @@ * e.g. IsValidSignature() | ||
/** | ||
* For predicates dynamic linking | ||
* e.g. Confsig() user defined predicate | ||
*/ | ||
export interface CompiledPredicateCall { | ||
type: 'CompiledPredicateCall'; | ||
source: string; | ||
} | ||
/** | ||
* CompiledInput indicates which value to pass to PredicateCall as input of predicate | ||
@@ -63,0 +71,0 @@ * For example, parentProperty.inputs[0].inputs[1] is NormalInput and inputIndex is 0 and children is [1]. |
@@ -132,6 +132,15 @@ "use strict"; | ||
else if (utils.isUpperCase(name[0])) { | ||
return { | ||
type: 'AtomicPredicateCall', | ||
source: name | ||
}; | ||
if (utils.isCompiledPredicate(name)) { | ||
// This is for calling user defined predicate dybamically | ||
return { | ||
type: 'CompiledPredicateCall', | ||
source: name | ||
}; | ||
} | ||
else { | ||
return { | ||
type: 'AtomicPredicateCall', | ||
source: name | ||
}; | ||
} | ||
} | ||
@@ -281,3 +290,3 @@ else { | ||
if (typeof i != 'string' && i.type == 'AtomicProposition') { | ||
if (i.predicate.type == 'AtomicPredicateCall' && !i.isCompiled) { | ||
if (i.predicate.type == 'CompiledPredicateCall' && !i.isCompiled) { | ||
const predicateName = i.predicate.source; | ||
@@ -284,0 +293,0 @@ if (utils.isCompiledPredicate(predicateName) && |
{ | ||
"name": "@cryptoeconomicslab/ovm-transpiler", | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"description": "OVM transpiler", | ||
@@ -57,3 +57,3 @@ "author": { | ||
}, | ||
"gitHead": "6c4fde9fe77937c121d42749d36b7ea91fab8939" | ||
"gitHead": "39908d8c2553da665928805e5ef16e2c145a90fe" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
123048
1892