(expression: ComputedProjectionMathIrExpression)
| 342 | const relationAlias = relationPath |
| 343 | const relationSource = dottedToAccess(`f.${relationPath}`) |
| 344 | const compileExpr = (expression: ComputedProjectionMathIrExpression): string => { |
| 345 | switch (expression._tag) { |
| 346 | case "field": |
| 347 | return dottedToAccess(`${relationAlias}.${expression.field}`) |
| 348 | case "mul": |
| 349 | return `(${compileExpr(expression.left)} * ${compileExpr(expression.right)})` |
| 350 | default: |
| 351 | return assertUnreachable(expression) |
| 352 | } |
| 353 | } |
| 354 | const factorExpr = (unitExpr: string, toBase: string, factors: Readonly<Record<string, number>>) => { |
| 355 | const entries = Object.entries(factors).filter(([, factor]) => Number.isFinite(factor)) |
| 356 | return entries.reduceRight<string>( |
no test coverage detected
searching dependent graphs…