Rename kcl Value to Expr (#3360)
Rename kcl's Value to Expr As Jon pointed out, kcl's `Value` enum is actually an expression. "2+2" isn't a value, it's an expression, which can compute a value. So I renamed it `Expr`.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { parse, Value, recast, initPromise } from '../wasm'
|
||||
import { parse, Expr, recast, initPromise } from '../wasm'
|
||||
import {
|
||||
getConstraintType,
|
||||
getTransformInfos,
|
||||
@ -69,8 +69,8 @@ function getConstraintTypeFromSourceHelper(
|
||||
if (err(ast)) return ast
|
||||
|
||||
const args = (ast.body[0] as any).expression.arguments[0].elements as [
|
||||
Value,
|
||||
Value
|
||||
Expr,
|
||||
Expr
|
||||
]
|
||||
const fnName = (ast.body[0] as any).expression.callee.name as ToolTip
|
||||
return getConstraintType(args, fnName)
|
||||
@ -81,7 +81,7 @@ function getConstraintTypeFromSourceHelper2(
|
||||
const ast = parse(code)
|
||||
if (err(ast)) return ast
|
||||
|
||||
const arg = (ast.body[0] as any).expression.arguments[0] as Value
|
||||
const arg = (ast.body[0] as any).expression.arguments[0] as Expr
|
||||
const fnName = (ast.body[0] as any).expression.callee.name as ToolTip
|
||||
return getConstraintType(arg, fnName)
|
||||
}
|
||||
|
Reference in New Issue
Block a user