VisitBStr visits a parse tree produced by MangleParser#BStr.
(ctx *gen.BStrContext)
| 515 | |
| 516 | // VisitBStr visits a parse tree produced by MangleParser#BStr. |
| 517 | func (p Parser) VisitBStr(ctx *gen.BStrContext) any { |
| 518 | text := ctx.BYTESTRING().GetText() |
| 519 | text = text[2 : len(text)-1] |
| 520 | text, err := ast.Unescape(text, true /* isBytes */) |
| 521 | if err != nil { |
| 522 | p.errors.Add(err.Error(), ctx.GetStart().GetLine(), ctx.GetStart().GetColumn()) |
| 523 | return ast.Bytes([]byte("<BAD>")) |
| 524 | } |
| 525 | return ast.Bytes([]byte(text)) |
| 526 | } |
| 527 | |
| 528 | // VisitAppl visits a parse tree produced by MangleParser#Appl. |
| 529 | func (p Parser) VisitAppl(ctx *gen.ApplContext) any { |