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:
Adam Chalmers
2024-08-12 15:38:42 -05:00
committed by GitHub
parent d1e21d673e
commit 13986fcfd7
34 changed files with 473 additions and 475 deletions

View File

@ -1,6 +1,6 @@
import { toolTips } from 'lang/langHelpers'
import { Selection, Selections } from 'lib/selections'
import { PathToNode, Program, Value } from '../../lang/wasm'
import { PathToNode, Program, Expr } from '../../lang/wasm'
import {
getNodePathFromSourceRange,
getNodeFromPath,
@ -33,13 +33,13 @@ export function removeConstrainingValuesInfo({
getNodePathFromSourceRange(kclManager.ast, range)
)
const _nodes = paths.map((pathToNode) => {
const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode)
const tmp = getNodeFromPath<Expr>(kclManager.ast, pathToNode)
if (err(tmp)) return tmp
return tmp.node
})
const _err1 = _nodes.find(err)
if (err(_err1)) return _err1
const nodes = _nodes as Value[]
const nodes = _nodes as Expr[]
const updatedSelectionRanges = pathToNodes
? {