You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: mapping_parser.go
    path of file: ./repos/benthos/internal/bloblang/parser
    
    the code of the file until where you have to start completion: package parser

import (
	"errors"
	"fmt"
	"strings"

	"github.com/Jeffail/gabs/v2"

	"github.com/benthosdev/benthos/v4/internal/bloblang/mapping"
	"github.com/benthosdev/benthos/v4/internal/bloblang/query"
)

// ParseMapping parses a bloblang mapping and returns an executor to run it, or
// an error if the parsing fails.
//
// The filepath is optional and used for relative file imports and error
// messages.
func ParseMapping(pCtx Context, expr string) (*mappin
    
func mapParser(pCtx Context, maps map[string]query.Function) Func[string] {
	p := Sequence(
		FuncAsAny(Term("map")),
		FuncAsAny(SpacesAndTabs),
		// Prevents a missing path from being captured by the next parser
		FuncAsAny(MustBe(
			Expect(
				OneOf(
					QuotedString,
					varNameParser,
				),
				"map name",
			),
		)),
		FuncAsAny(SpacesAndTabs),
		FuncAsAny(DelimitedPattern(
			Sequence(
				charSquigOpen,
				DiscardedWhitespaceNewlineComments,
			),
			// Prevent imports, maps and metadata assignments.
			mappingStatement(pCtx, false, nil),
			Sequence(
				Discard(SpacesAndTabs),
				NewlineAllowComment,
				DiscardedWhitespaceNewlineComments,
			),
			Sequence(
				DiscardedWhitespaceNewlineComments,
				charSquigClose,
			),
		)),
	)

	return func(input []rune) Result[string] {
		res := p(input)
		if res.Err != nil {
			return Fail[string](res.Err, input)
		}

		if maps == nil {
			return Fail[string](
				NewFatalError(input, errors.New("defining maps is not allowed within this block")),
				input,
			)
		}

		seqSlice := res.Payload
		ident := seqSlice[2].(string)
		stmtSlice := seqSlice[4].([]mapping.Statement)

		if _, exists := maps[ident]; exists {
			return Fail[string](NewFatalError(input, fmt.Errorf("map name collision: %v", ident)), input)
		}

		maps[ident] = mapping.NewExecutor("map "+ident, input, maps, stmtSlice...)
		return Success(ident, res.Remaining)
	}
}