( s: string, start: number )
| 329 | |
| 330 | function primary( |
| 331 | s: string, |
| 332 | start: number |
| 333 | ): [index: number, result: Expression | null] { |
| 334 | // Attribute references, subscriptions, slices, and calls are not supported; |
| 335 | // only atoms are recognized here. |
| 336 | |
| 337 | // eslint-disable-next-line prefer-const |
| 338 | let [i, e] = atom(s, start); |
| 339 | if (e) return [i, e]; |
| 340 | |
| 341 | // subscription, slice, call attribute reference (x[i], x[a:b], x(a), x.a) |
| 342 | if (e !== null && s[i] === '(') { |
| 343 | if (symbol(e)) { |
| 344 | let args: Expression[]; |
| 345 | [i, args] = expressionList(s, i); |
| 346 | if (s[i] === ')') { |
| 347 | return [i, [symbol(e), ...args] as Expression]; |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | return [start, null]; |
| 353 | } |
| 354 | |
| 355 | function expression( |
| 356 | s: string, |
no test coverage detected