Skip to content

Commit 1c4ef05

Browse files
committed
Drop isUnelaborated, use isExpression instead
These represented the same concept. I'll clean up the separate tracking of unelaboratedness in the next commit.
1 parent 166cfca commit 1c4ef05

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/language/semantics.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ export {
6767
applyKeyPathToSemanticGraph,
6868
containsAnyUnelaboratedNodes,
6969
isSemanticGraph,
70-
isUnelaborated,
7170
matchSemanticGraph,
7271
serialize,
7372
stringifySemanticGraphForEndUser,

src/language/semantics/semantic-graph.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type {
88
import type { Atom, Molecule } from '../parsing.js'
99
import type { Canonicalized } from '../parsing/syntax-tree.js'
1010
import { inlinePlz, unparse } from '../unparsing.js'
11+
import { isExpression } from './expression.js'
1112
import { serializeFunctionNode, type FunctionNode } from './function-node.js'
1213
import { stringifyKeyPathForEndUser, type KeyPath } from './key-path.js'
1314
import {
@@ -49,15 +50,10 @@ export const applyKeyPathToSemanticGraph = (
4950
}
5051
}
5152

52-
export const isUnelaborated = (node: SemanticGraph | Molecule): boolean =>
53-
typeof node !== 'string' &&
54-
unelaboratedKey in node &&
55-
node[unelaboratedKey] === true
56-
5753
export const containsAnyUnelaboratedNodes = (
5854
node: SemanticGraph | Molecule,
5955
): boolean => {
60-
if (isUnelaborated(node)) {
56+
if (isExpression(node)) {
6157
return true
6258
} else if (typeof node === 'object') {
6359
for (const propertyValue of Object.values(node)) {
@@ -113,7 +109,7 @@ export const updateValueAtKeyPathInSemanticGraph = (
113109
operation,
114110
),
115111
updatedNode =>
116-
(isUnelaborated(node)
112+
(isExpression(node)
117113
? makeUnelaboratedObjectNode
118114
: makeObjectNode)({
119115
...node,

0 commit comments

Comments
 (0)