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: parser.go
    path of file: ./repos/quicktemplate/parser
    
    the code of the file until where you have to start completion: package parser

import (
	"bytes"
	"fmt"
	"go/ast"
	goparser "go/parser"
	gotoken "go/token"
	"io"
	"path/filepath"
	"strconv"
	"strings"
)

type parser struct {
	s                *scanner
	w                io.Writer
	packageName      string
	skipLineComments bool
	prefix           string
	forDepth         int
	switchDepth    
    
func (p *parser) parseFunc() error {
	s := p.s
	t, err := expectTagContents(s)
	if err != nil {
		return err
	}
	funcStr := "func " + string(t.Value)
	f, err := parseFuncDef(t.Value)
	if err != nil {
		return fmt.Errorf("error in %q at %s: %s", funcStr, s.Context(), err)
	}
	p.emitFuncStart(f)
	for s.Next() {
		t := s.Token()
		switch t.ID {
		case text:
			p.emitText(t.Value)
		case tagName:
			ok, err := p.tryParseCommonTags(t.Value)
			if err != nil {
				return fmt.Errorf("error in %q: %s", funcStr, err)
			}
			if ok {
				continue
			}
			switch string(t.Value) {
			case "endfunc":
				if err = skipTagContents(s); err != nil {
					return err
				}
				p.emitFuncEnd(f)
				return nil
			default:
				return fmt.Errorf("unexpected tag found in %q: %q at %s", funcStr, t.Value, s.Context())
			}
		default:
			return fmt.Errorf("unexpected token found when parsing %q: %s at %s", funcStr, t, s.Context())
		}
	}
	if err := s.LastError(); err != nil {
		return fmt.Errorf("cannot parse %q: %s", funcStr, err)
	}
	return fmt.Errorf("cannot find endfunc tag for %q at %s", funcStr, s.Context())
}