(tagNameStr string)
| 733 | } |
| 734 | |
| 735 | func (p *parser) parseOutputFunc(tagNameStr string) error { |
| 736 | s := p.s |
| 737 | t, err := expectTagContents(s) |
| 738 | if err != nil { |
| 739 | return err |
| 740 | } |
| 741 | f, err := parseFuncCall(t.Value) |
| 742 | if err != nil { |
| 743 | return fmt.Errorf("error at %s: %s", s.Context(), err) |
| 744 | } |
| 745 | filter := "N" |
| 746 | tagNameStr = tagNameStr[1:] |
| 747 | if strings.HasSuffix(tagNameStr, "h") { |
| 748 | tagNameStr = tagNameStr[:len(tagNameStr)-1] |
| 749 | switch tagNameStr { |
| 750 | case "", "q", "j": |
| 751 | filter = "E" |
| 752 | } |
| 753 | } |
| 754 | |
| 755 | if len(tagNameStr) > 0 || filter == "E" { |
| 756 | tagNameStr = strings.ToUpper(tagNameStr) |
| 757 | p.Printf("{") |
| 758 | p.Printf("qb%s := qt%s.AcquireByteBuffer()", mangleSuffix, mangleSuffix) |
| 759 | p.Printf("%s", f.CallWrite("qb"+mangleSuffix)) |
| 760 | p.Printf("qw%s.%s().%sZ(qb%s.B)", mangleSuffix, filter, tagNameStr, mangleSuffix) |
| 761 | p.Printf("qt%s.ReleaseByteBuffer(qb%s)", mangleSuffix, mangleSuffix) |
| 762 | p.Printf("}") |
| 763 | } else { |
| 764 | p.Printf("%s", f.CallStream("qw"+mangleSuffix)) |
| 765 | } |
| 766 | |
| 767 | return nil |
| 768 | } |
| 769 | |
| 770 | func (p *parser) emitText(text []byte) { |
| 771 | for len(text) > 0 { |
no test coverage detected