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:
@ -3,7 +3,7 @@ import { kclManager, engineCommandManager } from 'lib/singletons'
|
||||
import { useKclContext } from 'lang/KclProvider'
|
||||
import { findUniqueName } from 'lang/modifyAst'
|
||||
import { PrevVariable, findAllPreviousVariables } from 'lang/queryAst'
|
||||
import { ProgramMemory, Value, parse } from 'lang/wasm'
|
||||
import { ProgramMemory, Expr, parse } from 'lang/wasm'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { executeAst } from 'lang/langHelpers'
|
||||
import { err, trap } from 'lib/trap'
|
||||
@ -24,7 +24,7 @@ export function useCalculateKclExpression({
|
||||
initialVariableName?: string
|
||||
}): {
|
||||
inputRef: React.RefObject<HTMLInputElement>
|
||||
valueNode: Value | null
|
||||
valueNode: Expr | null
|
||||
calcResult: string
|
||||
prevVariables: PrevVariable<unknown>[]
|
||||
newVariableName: string
|
||||
@ -45,7 +45,7 @@ export function useCalculateKclExpression({
|
||||
insertIndex: 0,
|
||||
bodyPath: [],
|
||||
})
|
||||
const [valueNode, setValueNode] = useState<Value | null>(null)
|
||||
const [valueNode, setValueNode] = useState<Expr | null>(null)
|
||||
const [calcResult, setCalcResult] = useState('NAN')
|
||||
const [newVariableName, setNewVariableName] = useState('')
|
||||
const [isNewVariableNameUnique, setIsNewVariableNameUnique] = useState(true)
|
||||
|
Reference in New Issue
Block a user