MCPcopy Index your code
hub / github.com/google/mangle / VisitBStr

Method VisitBStr

parse/parse.go:517–526  ·  view source on GitHub ↗

VisitBStr visits a parse tree produced by MangleParser#BStr.

(ctx *gen.BStrContext)

Source from the content-addressed store, hash-verified

515
516// VisitBStr visits a parse tree produced by MangleParser#BStr.
517func (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.
529func (p Parser) VisitAppl(ctx *gen.ApplContext) any {

Callers 1

VisitMethod · 0.95

Calls 5

UnescapeFunction · 0.92
BytesFunction · 0.92
BYTESTRINGMethod · 0.80
ErrorMethod · 0.80
AddMethod · 0.65

Tested by

no test coverage detected