Skip to content

Commit

Permalink
ISS-1 sapiologie/hyperformula placeholder function and test
Browse files Browse the repository at this point in the history
  • Loading branch information
selimyoussry committed Jun 15, 2024
1 parent f0f9545 commit 43b3afa
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/interpreter/plugin/Xlookup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @license
* Copyright (c) 2024 Handsoncode. All rights reserved.
*/

import { ProcedureAst } from '../../parser'
import { InterpreterState } from '../InterpreterState'
import { InterpreterValue } from '../InterpreterValue'
import { FunctionPlugin, FunctionPluginTypecheck } from './FunctionPlugin'


export class XlookupPlugin extends FunctionPlugin implements FunctionPluginTypecheck<XlookupPlugin> {
public static implementedFunctions = {
XLOOKUP: {
method: 'xlookup',
parameters: [
// TODO @selim - add arguments
],
repeatLastArgs: 2,
}
}

public xlookup(ast: ProcedureAst, state: InterpreterState): InterpreterValue {
// TODO @selim - implement
return 2
}
}
1 change: 1 addition & 0 deletions src/interpreter/plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ export {StatisticalPlugin} from './StatisticalPlugin'
export {MathPlugin} from './MathPlugin'
export {ComplexPlugin} from './ComplexPlugin'
export {StatisticalAggregationPlugin} from './StatisticalAggregationPlugin'
export {XlookupPlugin} from './Xlookup'
6 changes: 6 additions & 0 deletions test/interpreter/function-xlookup.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
describe('Function XLOOKUP', () => {
// TODO @selim - implement me
it('wrong number of arguments', () => {
expect(true).toEqual(true)
})
})

0 comments on commit 43b3afa

Please sign in to comment.