File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ import either , { type Either } from '@matt.kantor/either'
2+ import type { ElaborationError } from '../../../errors.js'
3+ import {
4+ type Expression ,
5+ type ExpressionContext ,
6+ type KeywordHandler ,
7+ type SemanticGraph ,
8+ } from '../../../semantics.js'
9+
10+ export const ifKeywordHandler : KeywordHandler = (
11+ _expression : Expression ,
12+ _context : ExpressionContext ,
13+ ) : Either < ElaborationError , SemanticGraph > =>
14+ either . makeLeft ( { kind : 'bug' , message : 'not implemented' } )
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { type KeywordHandlers } from '../../semantics.js'
22import { applyKeywordHandler } from './keyword-handlers/apply-handler.js'
33import { checkKeywordHandler } from './keyword-handlers/check-handler.js'
44import { functionKeywordHandler } from './keyword-handlers/function-handler.js'
5+ import { ifKeywordHandler } from './keyword-handlers/if-handler.js'
56import { indexKeywordHandler } from './keyword-handlers/index-handler.js'
67import { lookupKeywordHandler } from './keyword-handlers/lookup-handler.js'
78import { panicKeywordHandler } from './keyword-handlers/panic-handler.js'
@@ -24,6 +25,11 @@ export const keywordHandlers: KeywordHandlers = {
2425 */
2526 '@function' : functionKeywordHandler ,
2627
28+ /**
29+ * Conditionally evaluates one of two expressions based on a boolean value.
30+ */
31+ '@if' : ifKeywordHandler ,
32+
2733 /**
2834 * Returns the value of a property within an object.
2935 */
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ export const isKeyword = (input: string) =>
22 input === '@apply' ||
33 input === '@check' ||
44 input === '@function' ||
5+ input === '@if' ||
56 input === '@index' ||
67 input === '@lookup' ||
78 input === '@panic' ||
You can’t perform that action at this time.
0 commit comments