remove IEvArrayString, implement __result__, cleanups
This commit is contained in:
parent
065a7aeec0
commit
43635bd39b
|
@ -152,12 +152,6 @@ export const ExpressionViewer: React.FC<Props> = ({ value, width }) => {
|
||||||
// {() => value.value}
|
// {() => value.value}
|
||||||
// </VariableBox>
|
// </VariableBox>
|
||||||
// );
|
// );
|
||||||
case SqValueTag.ArrayString:
|
|
||||||
return (
|
|
||||||
<VariableBox value={value} heading="Array String">
|
|
||||||
{() => value.value.map((r) => `"${r}"`).join(", ")}
|
|
||||||
</VariableBox>
|
|
||||||
);
|
|
||||||
case SqValueTag.Date:
|
case SqValueTag.Date:
|
||||||
return (
|
return (
|
||||||
<VariableBox value={value} heading="Date">
|
<VariableBox value={value} heading="Date">
|
||||||
|
@ -242,24 +236,24 @@ export const ExpressionViewer: React.FC<Props> = ({ value, width }) => {
|
||||||
</VariableBox>
|
</VariableBox>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
case SqValueTag.Module: {
|
// case SqValueTag.Module: {
|
||||||
return (
|
// return (
|
||||||
<VariableList value={value} heading="Module">
|
// <VariableList value={value} heading="Module">
|
||||||
{(_) =>
|
// {(_) =>
|
||||||
value.value
|
// value.value
|
||||||
.entries()
|
// .entries()
|
||||||
.filter(([key, _]) => !key.match(/^(__result__)$/))
|
// .filter(([key, _]) => !key.match(/^(__result__)$/))
|
||||||
.map(([key, r]) => (
|
// .map(([key, r]) => (
|
||||||
<ExpressionViewer
|
// <ExpressionViewer
|
||||||
key={key}
|
// key={key}
|
||||||
value={r}
|
// value={r}
|
||||||
width={width !== undefined ? width - 20 : width}
|
// width={width !== undefined ? width - 20 : width}
|
||||||
/>
|
// />
|
||||||
))
|
// ))
|
||||||
}
|
// }
|
||||||
</VariableList>
|
// </VariableList>
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
case SqValueTag.Record:
|
case SqValueTag.Record:
|
||||||
const plot = makePlot(value.value);
|
const plot = makePlot(value.value);
|
||||||
if (plot) {
|
if (plot) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ open Reducer_TestHelpers
|
||||||
describe("Parse ternary operator", () => {
|
describe("Parse ternary operator", () => {
|
||||||
testParseToBe(
|
testParseToBe(
|
||||||
"true ? 'YES' : 'NO'",
|
"true ? 'YES' : 'NO'",
|
||||||
"Ok({(:$$_ternary_$$ true 'YES' 'NO')})",
|
"Ok(true ? ('YES') : ('NO'))",
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ describe("eval", () => {
|
||||||
testEvalToBe("(1+2)*3", "Ok(9)")
|
testEvalToBe("(1+2)*3", "Ok(9)")
|
||||||
testEvalToBe("2>1", "Ok(true)")
|
testEvalToBe("2>1", "Ok(true)")
|
||||||
testEvalToBe("concat('a ', 'b')", "Ok('a b')")
|
testEvalToBe("concat('a ', 'b')", "Ok('a b')")
|
||||||
|
testEvalToBe("concat([3,4], [5,6,7])", "Ok([3,4,5,6,7])")
|
||||||
testEvalToBe("log(10)", "Ok(2.302585092994046)")
|
testEvalToBe("log(10)", "Ok(2.302585092994046)")
|
||||||
testEvalToBe("cos(10)", "Ok(-0.8390715290764524)")
|
testEvalToBe("cos(10)", "Ok(-0.8390715290764524)")
|
||||||
// TODO more built ins
|
// TODO more built ins
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as RSRecord from "../rescript/ForTS/ForTS_SquiggleValue/ForTS_SquiggleValue_Record.gen";
|
import * as RSRecord from "../rescript/ForTS/ForTS_SquiggleValue/ForTS_SquiggleValue_Record.gen";
|
||||||
import { wrapValue } from "./SqValue";
|
import { SqRecordValue, wrapValue } from "./SqValue";
|
||||||
import { SqValueLocation } from "./SqValueLocation";
|
import { SqValueLocation } from "./SqValueLocation";
|
||||||
|
|
||||||
type T = RSRecord.squiggleValue_Record;
|
type T = RSRecord.squiggleValue_Record;
|
||||||
|
@ -16,4 +16,11 @@ export class SqRecord {
|
||||||
toString() {
|
toString() {
|
||||||
return RSRecord.toString(this._value);
|
return RSRecord.toString(this._value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
asValue() {
|
||||||
|
return new SqRecordValue(
|
||||||
|
RSRecord.toSquiggleValue(this._value),
|
||||||
|
this.location
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,14 +44,6 @@ export class SqArrayValue extends SqAbstractValue {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SqArrayStringValue extends SqAbstractValue {
|
|
||||||
tag = Tag.ArrayString as const;
|
|
||||||
|
|
||||||
get value() {
|
|
||||||
return this.valueMethod(RSValue.getArrayString);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class SqBoolValue extends SqAbstractValue {
|
export class SqBoolValue extends SqAbstractValue {
|
||||||
tag = Tag.Bool as const;
|
tag = Tag.Bool as const;
|
||||||
|
|
||||||
|
@ -150,7 +142,6 @@ export class SqVoidValue extends SqAbstractValue {
|
||||||
|
|
||||||
const tagToClass = {
|
const tagToClass = {
|
||||||
[Tag.Array]: SqArrayValue,
|
[Tag.Array]: SqArrayValue,
|
||||||
[Tag.ArrayString]: SqArrayStringValue,
|
|
||||||
[Tag.Bool]: SqBoolValue,
|
[Tag.Bool]: SqBoolValue,
|
||||||
[Tag.Date]: SqDateValue,
|
[Tag.Date]: SqDateValue,
|
||||||
[Tag.Declaration]: SqDeclarationValue,
|
[Tag.Declaration]: SqDeclarationValue,
|
||||||
|
@ -169,7 +160,6 @@ const tagToClass = {
|
||||||
// type SqValue = typeof tagToClass[keyof typeof tagToClass];
|
// type SqValue = typeof tagToClass[keyof typeof tagToClass];
|
||||||
export type SqValue =
|
export type SqValue =
|
||||||
| SqArrayValue
|
| SqArrayValue
|
||||||
| SqArrayStringValue
|
|
||||||
| SqBoolValue
|
| SqBoolValue
|
||||||
| SqDateValue
|
| SqDateValue
|
||||||
| SqDeclarationValue
|
| SqDeclarationValue
|
||||||
|
|
|
@ -13,9 +13,6 @@ type squiggleValue_Lambda = ForTS_SquiggleValue_Lambda.squiggleValue_Lambda //us
|
||||||
@module("./ForTS_SquiggleValue_tag") @scope("squiggleValueTag")
|
@module("./ForTS_SquiggleValue_tag") @scope("squiggleValueTag")
|
||||||
external svtArray_: string = "Array"
|
external svtArray_: string = "Array"
|
||||||
|
|
||||||
@module("./ForTS_SquiggleValue_tag") @scope("squiggleValueTag")
|
|
||||||
external svtArrayString_: string = "ArrayString"
|
|
||||||
|
|
||||||
@module("./ForTS_SquiggleValue_tag") @scope("squiggleValueTag")
|
@module("./ForTS_SquiggleValue_tag") @scope("squiggleValueTag")
|
||||||
external svtBool_: string = "Bool"
|
external svtBool_: string = "Bool"
|
||||||
|
|
||||||
|
@ -61,7 +58,6 @@ external castEnum: string => squiggleValueTag = "%identity"
|
||||||
let getTag = (variant: squiggleValue): squiggleValueTag =>
|
let getTag = (variant: squiggleValue): squiggleValueTag =>
|
||||||
switch variant {
|
switch variant {
|
||||||
| IEvArray(_) => svtArray_->castEnum
|
| IEvArray(_) => svtArray_->castEnum
|
||||||
| IEvArrayString(_) => svtArrayString_->castEnum
|
|
||||||
| IEvBool(_) => svtBool_->castEnum
|
| IEvBool(_) => svtBool_->castEnum
|
||||||
| IEvDate(_) => svtDate_->castEnum
|
| IEvDate(_) => svtDate_->castEnum
|
||||||
| IEvDeclaration(_) => svtDeclaration_->castEnum
|
| IEvDeclaration(_) => svtDeclaration_->castEnum
|
||||||
|
@ -94,13 +90,6 @@ let getArray = (variant: squiggleValue): option<squiggleValue_Array> =>
|
||||||
| _ => None
|
| _ => None
|
||||||
}
|
}
|
||||||
|
|
||||||
@genType
|
|
||||||
let getArrayString = (variant: squiggleValue): option<array<string>> =>
|
|
||||||
switch variant {
|
|
||||||
| IEvArrayString(value) => value->Some
|
|
||||||
| _ => None
|
|
||||||
}
|
|
||||||
|
|
||||||
@genType
|
@genType
|
||||||
let getBool = (variant: squiggleValue): option<bool> =>
|
let getBool = (variant: squiggleValue): option<bool> =>
|
||||||
switch variant {
|
switch variant {
|
||||||
|
|
|
@ -7,3 +7,6 @@ let getKeyValuePairs = (value: squiggleValue_Record): array<(string, squiggleVal
|
||||||
|
|
||||||
@genType
|
@genType
|
||||||
let toString = (v: squiggleValue_Record) => ReducerInterface_InternalExpressionValue.toStringMap(v)
|
let toString = (v: squiggleValue_Record) => ReducerInterface_InternalExpressionValue.toStringMap(v)
|
||||||
|
|
||||||
|
@genType
|
||||||
|
let toSquiggleValue = (v: squiggleValue_Record): squiggleValue => IEvRecord(v)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
export enum squiggleValueTag {
|
export enum squiggleValueTag {
|
||||||
Array = "Array",
|
Array = "Array",
|
||||||
ArrayString = "ArrayString",
|
|
||||||
Bool = "Bool",
|
Bool = "Bool",
|
||||||
Date = "Date",
|
Date = "Date",
|
||||||
Declaration = "Declaration",
|
Declaration = "Declaration",
|
||||||
|
|
|
@ -93,4 +93,57 @@ let library = [
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
makeFn(
|
||||||
|
"concat",
|
||||||
|
[FRTypeString, FRTypeString],
|
||||||
|
inputs => {
|
||||||
|
switch inputs {
|
||||||
|
| [IEvString(a), IEvString(b)] => {
|
||||||
|
let answer = Js.String2.concat(a, b)
|
||||||
|
answer->Reducer_T.IEvString->Ok
|
||||||
|
}
|
||||||
|
| _ => Error(impossibleError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
),
|
||||||
|
makeFn(
|
||||||
|
"concat",
|
||||||
|
[FRTypeArray(FRTypeAny), FRTypeArray(FRTypeAny)],
|
||||||
|
inputs => {
|
||||||
|
switch inputs {
|
||||||
|
| [IEvArray(originalA), IEvArray(b)] => {
|
||||||
|
let a = originalA->Js.Array2.copy
|
||||||
|
let _ = Js.Array2.pushMany(a, b)
|
||||||
|
a->Reducer_T.IEvArray->Ok
|
||||||
|
}
|
||||||
|
| _ => Error(impossibleError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
),
|
||||||
|
makeFn(
|
||||||
|
"inspect",
|
||||||
|
[FRTypeAny],
|
||||||
|
inputs => {
|
||||||
|
switch inputs {
|
||||||
|
| [value] => {
|
||||||
|
Js.log(value->ReducerInterface_InternalExpressionValue.toString)
|
||||||
|
value->Ok
|
||||||
|
}
|
||||||
|
| _ => Error(impossibleError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
),
|
||||||
|
makeFn(
|
||||||
|
"inspect",
|
||||||
|
[FRTypeAny, FRTypeString],
|
||||||
|
inputs => {
|
||||||
|
switch inputs {
|
||||||
|
| [value, IEvString(label)] => {
|
||||||
|
Js.log(`${label}: ${value->ReducerInterface_InternalExpressionValue.toString}`)
|
||||||
|
value->Ok
|
||||||
|
}
|
||||||
|
| _ => Error(impossibleError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -34,15 +34,15 @@ let callInternal = (
|
||||||
| call => call->IEV.toStringFunctionCall->MathJs.Eval.eval
|
| call => call->IEV.toStringFunctionCall->MathJs.Eval.eval
|
||||||
}
|
}
|
||||||
|
|
||||||
let doAddArray = (originalA, b) => {
|
// let doAddArray = (originalA, b) => {
|
||||||
let a = originalA->Js.Array2.copy
|
// let a = originalA->Js.Array2.copy
|
||||||
let _ = Js.Array2.pushMany(a, b)
|
// let _ = Js.Array2.pushMany(a, b)
|
||||||
a->Reducer_T.IEvArray->Ok
|
// a->Reducer_T.IEvArray->Ok
|
||||||
}
|
// }
|
||||||
let doAddString = (a, b) => {
|
// let doAddString = (a, b) => {
|
||||||
let answer = Js.String2.concat(a, b)
|
// let answer = Js.String2.concat(a, b)
|
||||||
answer->Reducer_T.IEvString->Ok
|
// answer->Reducer_T.IEvString->Ok
|
||||||
}
|
// }
|
||||||
|
|
||||||
let inspect = (value: Reducer_T.value) => {
|
let inspect = (value: Reducer_T.value) => {
|
||||||
Js.log(value->IEV.toString)
|
Js.log(value->IEV.toString)
|
||||||
|
@ -107,10 +107,10 @@ let callInternal = (
|
||||||
// | ("$_typeTuple_$", [IEvArray(elems)]) => TypeBuilder.typeTuple(elems)
|
// | ("$_typeTuple_$", [IEvArray(elems)]) => TypeBuilder.typeTuple(elems)
|
||||||
// | ("$_typeArray_$", [elem]) => TypeBuilder.typeArray(elem)
|
// | ("$_typeArray_$", [elem]) => TypeBuilder.typeArray(elem)
|
||||||
// | ("$_typeRecord_$", [IEvRecord(propertyMap)]) => TypeBuilder.typeRecord(propertyMap)
|
// | ("$_typeRecord_$", [IEvRecord(propertyMap)]) => TypeBuilder.typeRecord(propertyMap)
|
||||||
| ("concat", [IEvArray(aValueArray), IEvArray(bValueArray)]) =>
|
// | ("concat", [IEvArray(aValueArray), IEvArray(bValueArray)]) =>
|
||||||
doAddArray(aValueArray, bValueArray)
|
// doAddArray(aValueArray, bValueArray)
|
||||||
| ("concat", [IEvString(aValueString), IEvString(bValueString)]) =>
|
// | ("concat", [IEvString(aValueString), IEvString(bValueString)]) =>
|
||||||
doAddString(aValueString, bValueString)
|
// doAddString(aValueString, bValueString)
|
||||||
| ("inspect", [value, IEvString(label)]) => inspectLabel(value, label)
|
| ("inspect", [value, IEvString(label)]) => inspectLabel(value, label)
|
||||||
| ("inspect", [value]) => inspect(value)
|
| ("inspect", [value]) => inspect(value)
|
||||||
| (_, [IEvBool(_)])
|
| (_, [IEvBool(_)])
|
||||||
|
|
|
@ -6,8 +6,6 @@ type expression = Reducer_T.expression
|
||||||
|
|
||||||
let eArray = (anArray: array<T.expression>) => anArray->T.EArray
|
let eArray = (anArray: array<T.expression>) => anArray->T.EArray
|
||||||
|
|
||||||
let eArrayString = anArray => anArray->T.IEvArrayString->T.EValue
|
|
||||||
|
|
||||||
let eBool = aBool => aBool->T.IEvBool->T.EValue
|
let eBool = aBool => aBool->T.IEvBool->T.EValue
|
||||||
|
|
||||||
let eCall = (fn: expression, args: array<expression>): expression => T.ECall(fn, args)
|
let eCall = (fn: expression, args: array<expression>): expression => T.ECall(fn, args)
|
||||||
|
|
|
@ -11,11 +11,7 @@ let set = (namespace: t, id: string, value): t => {
|
||||||
|
|
||||||
let mergeFrom = (from: t, to: t): t => {
|
let mergeFrom = (from: t, to: t): t => {
|
||||||
to->Belt.Map.String.reduce(from, (namespace, key, value) => {
|
to->Belt.Map.String.reduce(from, (namespace, key, value) => {
|
||||||
if key != "__result__" {
|
|
||||||
namespace->set(key, value)
|
namespace->set(key, value)
|
||||||
} else {
|
|
||||||
namespace
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ type environment = GenericDist.env
|
||||||
@genType.opaque
|
@genType.opaque
|
||||||
type rec value =
|
type rec value =
|
||||||
| IEvArray(arrayValue)
|
| IEvArray(arrayValue)
|
||||||
| IEvArrayString(array<string>)
|
|
||||||
| IEvBool(bool)
|
| IEvBool(bool)
|
||||||
| IEvDate(Js.Date.t)
|
| IEvDate(Js.Date.t)
|
||||||
| IEvDeclaration(lambdaDeclaration)
|
| IEvDeclaration(lambdaDeclaration)
|
||||||
|
|
|
@ -17,7 +17,6 @@ type functionCall = (string, array<t>)
|
||||||
let rec toString = (aValue: T.value) =>
|
let rec toString = (aValue: T.value) =>
|
||||||
switch aValue {
|
switch aValue {
|
||||||
| IEvArray(anArray) => toStringArray(anArray)
|
| IEvArray(anArray) => toStringArray(anArray)
|
||||||
| IEvArrayString(anArray) => toStringArrayString(anArray)
|
|
||||||
| IEvBool(aBool) => toStringBool(aBool)
|
| IEvBool(aBool) => toStringBool(aBool)
|
||||||
| IEvDate(date) => toStringDate(date)
|
| IEvDate(date) => toStringDate(date)
|
||||||
| IEvDeclaration(d) => toStringDeclaration(d)
|
| IEvDeclaration(d) => toStringDeclaration(d)
|
||||||
|
@ -35,10 +34,6 @@ and toStringArray = anArray => {
|
||||||
let args = anArray->Js.Array2.map(each => toString(each))->Js.Array2.toString
|
let args = anArray->Js.Array2.map(each => toString(each))->Js.Array2.toString
|
||||||
`[${args}]`
|
`[${args}]`
|
||||||
}
|
}
|
||||||
and toStringArrayString = anArray => {
|
|
||||||
let args = anArray->Js.Array2.toString
|
|
||||||
`[${args}]`
|
|
||||||
}
|
|
||||||
and toStringBool = aBool => Js.String.make(aBool)
|
and toStringBool = aBool => Js.String.make(aBool)
|
||||||
and toStringCall = fName => `:${fName}`
|
and toStringCall = fName => `:${fName}`
|
||||||
and toStringDate = date => DateTime.Date.toString(date)
|
and toStringDate = date => DateTime.Date.toString(date)
|
||||||
|
@ -69,7 +64,6 @@ and toStringMap = aMap => {
|
||||||
let toStringWithType = (aValue: T.value) =>
|
let toStringWithType = (aValue: T.value) =>
|
||||||
switch aValue {
|
switch aValue {
|
||||||
| IEvArray(_) => `Array::${toString(aValue)}`
|
| IEvArray(_) => `Array::${toString(aValue)}`
|
||||||
| IEvArrayString(_) => `ArrayString::${toString(aValue)}`
|
|
||||||
| IEvBool(_) => `Bool::${toString(aValue)}`
|
| IEvBool(_) => `Bool::${toString(aValue)}`
|
||||||
| IEvDate(_) => `Date::${toString(aValue)}`
|
| IEvDate(_) => `Date::${toString(aValue)}`
|
||||||
| IEvDeclaration(_) => `Declaration::${toString(aValue)}`
|
| IEvDeclaration(_) => `Declaration::${toString(aValue)}`
|
||||||
|
@ -116,7 +110,6 @@ let toStringResultRecord = x =>
|
||||||
|
|
||||||
type internalExpressionValueType =
|
type internalExpressionValueType =
|
||||||
| EvtArray
|
| EvtArray
|
||||||
| EvtArrayString
|
|
||||||
| EvtBool
|
| EvtBool
|
||||||
| EvtDate
|
| EvtDate
|
||||||
| EvtDeclaration
|
| EvtDeclaration
|
||||||
|
@ -137,7 +130,6 @@ type functionDefinitionSignature =
|
||||||
let valueToValueType = (value: T.value) =>
|
let valueToValueType = (value: T.value) =>
|
||||||
switch value {
|
switch value {
|
||||||
| IEvArray(_) => EvtArray
|
| IEvArray(_) => EvtArray
|
||||||
| IEvArrayString(_) => EvtArrayString
|
|
||||||
| IEvBool(_) => EvtBool
|
| IEvBool(_) => EvtBool
|
||||||
| IEvDate(_) => EvtDate
|
| IEvDate(_) => EvtDate
|
||||||
| IEvDeclaration(_) => EvtDeclaration
|
| IEvDeclaration(_) => EvtDeclaration
|
||||||
|
@ -160,7 +152,6 @@ let functionCallToCallSignature = (functionCall: functionCall): functionCallSign
|
||||||
let valueTypeToString = (valueType: internalExpressionValueType): string =>
|
let valueTypeToString = (valueType: internalExpressionValueType): string =>
|
||||||
switch valueType {
|
switch valueType {
|
||||||
| EvtArray => `Array`
|
| EvtArray => `Array`
|
||||||
| EvtArrayString => `ArrayString`
|
|
||||||
| EvtBool => `Bool`
|
| EvtBool => `Bool`
|
||||||
// | EvtCall => `Call`
|
// | EvtCall => `Call`
|
||||||
| EvtDate => `Date`
|
| EvtDate => `Date`
|
||||||
|
|
|
@ -22,7 +22,7 @@ let internalStdLib: Reducer_T.namespace = {
|
||||||
}
|
}
|
||||||
| [IEvRecord(dict), IEvString(sIndex)] => switch Belt.Map.String.get(dict, sIndex) {
|
| [IEvRecord(dict), IEvString(sIndex)] => switch Belt.Map.String.get(dict, sIndex) {
|
||||||
| Some(value) => value
|
| Some(value) => value
|
||||||
| None => RERecordPropertyNotFound("Record index not found", sIndex)->ErrorException->raise
|
| None => RERecordPropertyNotFound("Record property not found", sIndex)->ErrorException->raise
|
||||||
}
|
}
|
||||||
| _ => REOther("Trying to access key on wrong value")->ErrorException->raise
|
| _ => REOther("Trying to access key on wrong value")->ErrorException->raise
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,15 +161,25 @@ let getContinuationsBefore = (project: t, sourceId: string): array<Reducer_T.nam
|
||||||
}
|
}
|
||||||
|
|
||||||
let linkDependencies = (project: t, sourceId: string): Reducer_T.namespace => {
|
let linkDependencies = (project: t, sourceId: string): Reducer_T.namespace => {
|
||||||
let nameSpace = Reducer_Namespace.mergeMany(
|
let pastChain = project->getPastChain(sourceId)
|
||||||
Belt.Array.concat(
|
let namespace = Reducer_Namespace.mergeMany(
|
||||||
|
Belt.Array.concatMany([
|
||||||
[project->getStdLib],
|
[project->getStdLib],
|
||||||
project->getContinuationsBefore(sourceId)
|
pastChain->Belt.Array.map(project->getBindings),
|
||||||
)
|
pastChain->Belt.Array.map(
|
||||||
|
id => Reducer_Namespace.fromArray([
|
||||||
|
("__result__",
|
||||||
|
switch project->getResult(id) {
|
||||||
|
| Ok(result) => result
|
||||||
|
| Error(error) => error->Reducer_ErrorValue.ErrorException->raise
|
||||||
|
})
|
||||||
|
])
|
||||||
|
),
|
||||||
|
])
|
||||||
)
|
)
|
||||||
|
|
||||||
let includesAsVariables = project->getIncludesAsVariables(sourceId)
|
let includesAsVariables = project->getIncludesAsVariables(sourceId)
|
||||||
Belt.Array.reduce(includesAsVariables, nameSpace, (acc, (variable, includeFile)) =>
|
Belt.Array.reduce(includesAsVariables, namespace, (acc, (variable, includeFile)) =>
|
||||||
acc->Reducer_Namespace.set(
|
acc->Reducer_Namespace.set(
|
||||||
variable,
|
variable,
|
||||||
project->getBindings(includeFile)->Reducer_Namespace.toRecord
|
project->getBindings(includeFile)->Reducer_Namespace.toRecord
|
||||||
|
|
Loading…
Reference in New Issue
Block a user