(parse, text, options)
| 99 | } |
| 100 | |
| 101 | function parseWithOptions(parse, text, options) { |
| 102 | const ast = parse(text, options); |
| 103 | const error = ast.errors.find( |
| 104 | (error) => !allowedReasonCodes.has(error.reasonCode), |
| 105 | ); |
| 106 | if (error) { |
| 107 | throw error; |
| 108 | } |
| 109 | return ast; |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | @param {{isExpression: boolean, optionsCombinations: ParserOptions[]}} param0 |