toString for each squiggleValue
This commit is contained in:
parent
2fc325beb6
commit
e2491bda88
|
@ -4,3 +4,7 @@ type squiggleValue = ForTS_SquiggleValue.squiggleValue
|
|||
@genType
|
||||
let getValues = (v: squiggleValue_Array): array<squiggleValue> =>
|
||||
ReducerInterface_InternalExpressionValue.arrayToValueArray(v)
|
||||
|
||||
@genType
|
||||
let toString = (v: squiggleValue_Array): string =>
|
||||
ReducerInterface_InternalExpressionValue.toStringArray(v)
|
||||
|
|
|
@ -1 +1,5 @@
|
|||
@genType type squiggleValue_Declaration = ReducerInterface_InternalExpressionValue.lambdaDeclaration //re-export
|
||||
|
||||
@genType
|
||||
let toString = (v: squiggleValue_Declaration): string =>
|
||||
ReducerInterface_InternalExpressionValue.toStringDeclaration(v)
|
||||
|
|
|
@ -1 +1,5 @@
|
|||
@genType type squiggleValue_Distribution = ForTS_Distribution.distribution
|
||||
|
||||
@genType
|
||||
let toString = (v: squiggleValue_Distribution): string =>
|
||||
ReducerInterface_InternalExpressionValue.toStringDistribution(v)
|
||||
|
|
|
@ -1 +1,5 @@
|
|||
@genType type squiggleValue_Lambda = ReducerInterface_InternalExpressionValue.lambdaValue //re-export
|
||||
|
||||
@genType
|
||||
let toString = (v: squiggleValue_Lambda): string =>
|
||||
ReducerInterface_InternalExpressionValue.toStringLambda(v)
|
||||
|
|
|
@ -4,3 +4,7 @@ type squiggleValue = ForTS_SquiggleValue.squiggleValue //use
|
|||
@genType
|
||||
let getKeyValuePairs = (v: squiggleValue_Module): array<(string, squiggleValue)> =>
|
||||
ReducerInterface_InternalExpressionValue.nameSpaceToKeyValuePairs(v)
|
||||
|
||||
@genType
|
||||
let toString = (v: squiggleValue_Module): string =>
|
||||
ReducerInterface_InternalExpressionValue.toStringNameSpace(v)
|
||||
|
|
|
@ -4,3 +4,6 @@ type squiggleValue = ForTS_SquiggleValue.squiggleValue //use
|
|||
@genType
|
||||
let getKeyValuePairs = (value: squiggleValue_Record): array<(string, squiggleValue)> =>
|
||||
ReducerInterface_InternalExpressionValue.recordToKeyValuePairs(value)
|
||||
|
||||
@genType
|
||||
let toString = (v: squiggleValue_Record) => ReducerInterface_InternalExpressionValue.toStringMap(v)
|
||||
|
|
|
@ -4,3 +4,7 @@ type squiggleValue = ForTS_SquiggleValue.squiggleValue //use
|
|||
@genType
|
||||
let getKeyValuePairs = (value: squiggleValue_Type): array<(string, squiggleValue)> =>
|
||||
ReducerInterface_InternalExpressionValue.recordToKeyValuePairs(value)
|
||||
|
||||
@genType
|
||||
let toString = (value: squiggleValue_Type): string =>
|
||||
ReducerInterface_InternalExpressionValue.toStringType(value)
|
||||
|
|
|
@ -41,7 +41,7 @@ type functionCall = (string, array<t>)
|
|||
|
||||
let rec toString = aValue =>
|
||||
switch aValue {
|
||||
| IEvArray(anArray) =>toStringArray(anArray)
|
||||
| IEvArray(anArray) => toStringArray(anArray)
|
||||
| IEvArrayString(anArray) => toStringArrayString(anArray)
|
||||
| IEvBindings(m) => toStringBindings(m)
|
||||
| IEvBool(aBool) => toStringBool(aBool)
|
||||
|
@ -59,27 +59,30 @@ let rec toString = aValue =>
|
|||
| IEvTypeIdentifier(id) => toStringTypeIdentifier(id)
|
||||
| IEvVoid => toStringVoid
|
||||
}
|
||||
and toStringArray = (anArray) => {let args = anArray->Js.Array2.map(each => toString(each))->Js.Array2.toString
|
||||
`[${args}]`}
|
||||
and toStringArrayString = (anArray) => {
|
||||
let args = anArray->Js.Array2.toString
|
||||
`[${args}]`
|
||||
}
|
||||
and toStringBindings = (m) => `@${m->toStringNameSpace}`
|
||||
and toStringBool = (aBool) => Js.String.make(aBool)
|
||||
and toStringCall = (fName) => `:${fName}`
|
||||
and toStringDate = (date) => DateTime.Date.toString(date)
|
||||
and toStringDeclaration = (d) => Declaration.toString(d, r => toString(IEvLambda(r)))
|
||||
and toStringDistribution = (dist) => GenericDist.toString(dist)
|
||||
and toStringLambda = (lambdaValue) => `lambda(${Js.Array2.toString(lambdaValue.parameters)}=>internal code)`
|
||||
and toStringFunction = (lambdaValue) => `function(${Js.Array2.toString(lambdaValue.parameters)})`
|
||||
and toStringNumber = (aNumber) => Js.String.make(aNumber)
|
||||
and toStringRecord = (aMap) => aMap->toStringMap
|
||||
and toStringString = (aString) => `'${aString}'`
|
||||
and toStringSymbol = (aString) => `:${aString}`
|
||||
and toStringTimeDuration = (t) => DateTime.Duration.toString(t)
|
||||
and toStringType = (aMap) => aMap->toStringMap
|
||||
and toStringTypeIdentifier = (id) => `#${id}`
|
||||
and toStringArray = anArray => {
|
||||
let args = anArray->Js.Array2.map(each => toString(each))->Js.Array2.toString
|
||||
`[${args}]`
|
||||
}
|
||||
and toStringArrayString = anArray => {
|
||||
let args = anArray->Js.Array2.toString
|
||||
`[${args}]`
|
||||
}
|
||||
and toStringBindings = m => `@${m->toStringNameSpace}`
|
||||
and toStringBool = aBool => Js.String.make(aBool)
|
||||
and toStringCall = fName => `:${fName}`
|
||||
and toStringDate = date => DateTime.Date.toString(date)
|
||||
and toStringDeclaration = d => Declaration.toString(d, r => toString(IEvLambda(r)))
|
||||
and toStringDistribution = dist => GenericDist.toString(dist)
|
||||
and toStringLambda = lambdaValue =>
|
||||
`lambda(${Js.Array2.toString(lambdaValue.parameters)}=>internal code)`
|
||||
and toStringFunction = lambdaValue => `function(${Js.Array2.toString(lambdaValue.parameters)})`
|
||||
and toStringNumber = aNumber => Js.String.make(aNumber)
|
||||
and toStringRecord = aMap => aMap->toStringMap
|
||||
and toStringString = aString => `'${aString}'`
|
||||
and toStringSymbol = aString => `:${aString}`
|
||||
and toStringTimeDuration = t => DateTime.Duration.toString(t)
|
||||
and toStringType = aMap => aMap->toStringMap
|
||||
and toStringTypeIdentifier = id => `#${id}`
|
||||
and toStringVoid = `()`
|
||||
|
||||
and toStringMap = aMap => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user