Prelude of builtin functions #7

Merged
defunkt merged 45 commits from prelude into main 2025-10-29 20:15:37 +00:00
Showing only changes of commit c51030b3bd - Show all commits

View File

@ -1,5 +1,4 @@
import { Tree, TreeCursor } from '@lezer/common'
import { assertNever } from '#utils/utils'
import { type Value, fromValue } from 'reefvm'
export const treeToString = (tree: Tree, input: string): string => {
@ -35,6 +34,5 @@ export const treeToString = (tree: Tree, input: string): string => {
}
export const VMResultToValue = (result: Value): unknown => {
if (result.type === 'function') return Function
else return fromValue(result)
return result.type === 'function' ? Function : fromValue(result)
}