* ```abnf * ExprWithLabel = "#" IDENT ":" Expr * ```
(s: ITokenStream)
| 352 | * ``` |
| 353 | */ |
| 354 | function parseExprWithLabel(s: ITokenStream): Ast.If | Ast.Match | Ast.Block { |
| 355 | const label = parseLabel(s); |
| 356 | s.expect(TokenKind.Colon); |
| 357 | s.next(); |
| 358 | |
| 359 | const expr = parseExpr(s, false); |
| 360 | switch (expr.type) { |
| 361 | case 'if': |
| 362 | case 'match': |
| 363 | case 'block': { |
| 364 | expr.label = label; |
| 365 | return expr; |
| 366 | } |
| 367 | default: { |
| 368 | throw new AiScriptSyntaxError('cannot use label for expression other than eval / if / match', expr.loc.start); |
| 369 | } |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | /** |
| 374 | * ```abnf |
no test coverage detected