import { ExpressionAstExpression , ExpressionAstArgument } from './types' ; const { parse : parseRaw } = require ( '@osd/interpreter/common' ) ; export function parse < E extends string , S extends 'expression' | 'argument' > ( expression , startRule ) { try { return parseRaw ( String ( expression ) , { startRule } ) ; } catch ( e ) { throw new Error ( `Unable to parse expression: ${ e . message }` ) ; } }