PR#226, add missing variants to switch statements

Code is passing unit tests however there were missing variands. Fixed
This commit is contained in:
Umur Ozkul 2022-04-14 02:40:59 +02:00
parent 9123b1a416
commit daf2a27182

View File

@ -119,7 +119,8 @@ let rec reduceExpression = (expression: t, bindings: T.bindings): result<express
let rec seekMacros = (expression: t, bindings: T.bindings): result<t, 'e> => let rec seekMacros = (expression: t, bindings: T.bindings): result<t, 'e> =>
switch expression { switch expression {
| T.EValue(value) => expression->Ok | T.EValue(_value) => expression->Ok
| T.EBindings(_value) => expression->Ok
| T.EList(list) => { | T.EList(list) => {
let racc: result<list<t>, 'e> = list->Belt.List.reduceReverse(Ok(list{}), ( let racc: result<list<t>, 'e> = list->Belt.List.reduceReverse(Ok(list{}), (
racc, racc,
@ -155,6 +156,7 @@ let rec reduceExpression = (expression: t, bindings: T.bindings): result<express
) )
racc->Result.flatMap(acc => acc->reduceValueList) racc->Result.flatMap(acc => acc->reduceValueList)
} }
| _ => RETodo("Error: Bindings cannot be reduced to values")->Error
} }
let rExpandedExpression: result<t, 'e> = expression->seekMacros(bindings) let rExpandedExpression: result<t, 'e> = expression->seekMacros(bindings)