Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiriVulpes committed Dec 10, 2024
1 parent dc3cae8 commit 3e674c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/chc/read/consume/expression/consumeExpression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { ChiriType } from "../../../type/ChiriType"
import type { Operator } from "../../../type/ChiriTypeManager"
import type { ChiriLiteralFunctionReference } from "../../../type/typeFunction"
import type { ChiriFunctionReference } from "../../../type/typeFunction"
import typeInt from "../../../type/typeInt"
import typeList from "../../../type/typeList"
import typeRecord from "../../../type/typeRecord"
Expand Down Expand Up @@ -103,7 +103,7 @@ export type ChiriExpressionOperand =
| ChiriUnaryExpression
| ChiriLiteralValue
| ChiriVariableReference
| ChiriLiteralFunctionReference
| ChiriFunctionReference
| ChiriBaseText
| ChiriFunctionCall
| ChiriPipe
Expand Down
14 changes: 6 additions & 8 deletions src/chc/type/typeFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import TypeDefinition from "./TypeDefinition"

export type ChiriLiteralRecordKeyValueTuple = [key: ChiriLiteralString | ChiriWordInterpolated, value: ChiriExpressionOperand]

export interface ChiriLiteralFunctionReference {
type: "literal"
subType: "function"
export interface ChiriFunctionReference {
type: "function"
valueType: ChiriType
value: ChiriWord
name: ChiriWord
position: ChiriPosition
}

Expand All @@ -22,7 +21,7 @@ export default TypeDefinition({
type: TYPE_FUNCTION,
stringable: true,
generics: true,
consumeOptionalConstructor: (reader): ChiriLiteralFunctionReference | undefined => {
consumeOptionalConstructor: (reader): ChiriFunctionReference | undefined => {
const i = reader.i
const name = consumeWordOptional(reader)
if (!name || !reader.getFunctionOptional(name.value) || reader.getVariableOptional(name.value)) {
Expand All @@ -31,10 +30,9 @@ export default TypeDefinition({
}

return {
type: "literal",
subType: "function",
type: "function",
valueType: TYPE_FUNCTION,
value: name,
name: name,
position: name.position,
}
},
Expand Down
3 changes: 3 additions & 0 deletions src/chc/util/resolveExpression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ function resolveExpression (compiler: ChiriCompiler, expression?: ChiriExpressio
case "get":
return compiler.getVariable(expression.name.value, expression.name.position)

case "function":
return compiler.getFunction(expression.name.value, expression.name.position) as any

case "function-call":
return compiler.callFunction(expression)

Expand Down

0 comments on commit 3e674c4

Please sign in to comment.