fixed - PR#333 kill W in evaluatePartialWBindings
renamed to evaluatePartialUsingExternalBindings
This commit is contained in:
parent
2c7e6c750b
commit
875f0519ac
|
@ -24,7 +24,7 @@ let expectEvalPartialBindingsToBe = (
|
|||
bindings: Reducer.externalBindings,
|
||||
answer: string,
|
||||
) =>
|
||||
Reducer.evaluatePartialWBindings(expr, bindings)
|
||||
Reducer.evaluatePartialUsingExternalBindings(expr, bindings)
|
||||
->ExpressionValue.toStringResultRecord
|
||||
->expect
|
||||
->toBe(answer)
|
||||
|
|
|
@ -9,7 +9,7 @@ type expressionValue = Reducer_Expression.expressionValue
|
|||
type externalBindings = Expression.externalBindings
|
||||
let evaluate = Expression.eval
|
||||
let evaluateUsingExternalBindings = Expression.evalUsingExternalBindings
|
||||
let evaluatePartialWBindings = Expression.evalPartialWBindings
|
||||
let evaluatePartialUsingExternalBindings = Expression.evalPartialUsingExternalBindings
|
||||
let parse = Expression.parse
|
||||
let parseOuter = Expression.parseOuter
|
||||
let parsePartial = Expression.parsePartial
|
||||
|
|
|
@ -17,7 +17,7 @@ let evaluateUsingExternalBindings: (
|
|||
externalBindings,
|
||||
) => result<expressionValue, Reducer_ErrorValue.errorValue>
|
||||
@genType
|
||||
let evaluatePartialWBindings: (
|
||||
let evaluatePartialUsingExternalBindings: (
|
||||
string,
|
||||
externalBindings,
|
||||
) => result<externalBindings, Reducer_ErrorValue.errorValue>
|
||||
|
|
|
@ -124,7 +124,7 @@ let evalUsingExternalBindingsExpression_ = (aExpression, bindings): result<expre
|
|||
When bindings are used, the code is a partial code as if it is cut from a larger code.
|
||||
Therefore all statements are assignments.
|
||||
*/
|
||||
let evalPartialWBindings_ = (codeText: string, bindings: T.bindings) => {
|
||||
let evalPartialUsingExternalBindings_ = (codeText: string, bindings: T.bindings) => {
|
||||
parsePartial(codeText)->Result.flatMap(expression =>
|
||||
expression->evalUsingExternalBindingsExpression_(bindings)
|
||||
)
|
||||
|
@ -169,12 +169,12 @@ let evalUsingExternalBindings = (code: string, externalBindings: externalBinding
|
|||
Evaluates code with external bindings. External bindings are a record of expression values.
|
||||
The code is a partial code as if it is cut from a larger code. Therefore all statments are assignments.
|
||||
*/
|
||||
let evalPartialWBindings = (code: string, externalBindings: externalBindings): result<
|
||||
let evalPartialUsingExternalBindings = (code: string, externalBindings: externalBindings): result<
|
||||
externalBindings,
|
||||
'e,
|
||||
> => {
|
||||
let bindings = externalBindings->externalBindingsToBindings
|
||||
let answer = evalPartialWBindings_(code, bindings)
|
||||
let answer = evalPartialUsingExternalBindings_(code, bindings)
|
||||
answer->Result.flatMap(answer =>
|
||||
switch answer {
|
||||
| EvRecord(aRecord) => Ok(aRecord)
|
||||
|
|
Loading…
Reference in New Issue
Block a user