From 710756bc50c34dd4c5cf614c23324c3a0b8de743 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Thu, 9 Jun 2022 15:27:37 +0200 Subject: [PATCH] EvModule defined --- .../ReducerInterface/ReducerInterface_ExpressionValue.res | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExpressionValue.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExpressionValue.res index 628dfc8e..61928683 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExpressionValue.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExpressionValue.res @@ -24,6 +24,7 @@ type rec expressionValue = | EvTimeDuration(float) | EvDeclaration(lambdaDeclaration) | EvTypeIdentifier(string) + | EvModule(record) and record = Js.Dict.t and externalBindings = record and lambdaValue = { @@ -60,6 +61,7 @@ let rec toString = aValue => | EvTimeDuration(t) => DateTime.Duration.toString(t) | EvDeclaration(d) => Declaration.toString(d, r => toString(EvLambda(r))) | EvTypeIdentifier(id) => `#${id}` + | EvModule(m) => `@${m->toStringRecord}` } and toStringRecord = aRecord => { let pairs = @@ -86,6 +88,7 @@ let toStringWithType = aValue => | EvTimeDuration(_) => `Date::${toString(aValue)}` | EvDeclaration(_) => `Declaration::${toString(aValue)}` | EvTypeIdentifier(_) => `TypeIdentifier::${toString(aValue)}` + | EvModule(_) => `Module::${toString(aValue)}` } let argsToString = (args: array): string => { @@ -133,6 +136,7 @@ type expressionValueType = | EvtTimeDuration | EvtDeclaration | EvtTypeIdentifier + | EvtModule type functionCallSignature = CallSignature(string, array) type functionDefinitionSignature = @@ -154,6 +158,7 @@ let valueToValueType = value => | EvTimeDuration(_) => EvtTimeDuration | EvDeclaration(_) => EvtDeclaration | EvTypeIdentifier(_) => EvtTypeIdentifier + | EvModule(_) => EvtModule } let functionCallToCallSignature = (functionCall: functionCall): functionCallSignature => { @@ -177,6 +182,7 @@ let valueTypeToString = (valueType: expressionValueType): string => | EvtTimeDuration => `Duration` | EvtDeclaration => `Declaration` | EvtTypeIdentifier => `TypeIdentifier` + | EvtModule => `Module` } let functionCallSignatureToString = (functionCallSignature: functionCallSignature): string => {