<commit_before>package terse

import (
	"html/template"
	"text/template/parse"
)

func compile(name string, funcs template.FuncMap, tt tokenTree) (map[string]*parse.Tree, error) {
	if tt.err != nil {
		return map[string]*parse.Tree{}, tt.err
	}

	var nodes []parse.Node
	if len(tt.roots) > 0 {
		nodes = tt.roots[0].Compile("")
		for _, rn := range tt.roots[1:] {
			nodes = append(nodes, rn.Compile("\n")...)
		}
	}

	pt := &parse.Tree{
		Name: name,
		Root: &parse.ListNode{
			NodeType: parse.NodeList,
			Pos:      parse.Pos(0),
			Nodes:    nodes,
		},
	}

	return map[string]*parse.Tree{name: pt}, nil
}
<commit_msg>Remove special casing for first root node<commit_after>package terse

import (
	"html/template"
	"text/template/parse"
)

func compile(name string, funcs template.FuncMap, tt tokenTree) (map[string]*parse.Tree, error) {
	if tt.err != nil {
		return map[string]*parse.Tree{}, tt.err
	}

	var nodes []parse.Node
	var prefix string
	if len(tt.roots) > 0 {
		for _, rn := range tt.roots {
			nodes = append(nodes, rn.Compile(prefix)...)
			prefix = "\n"
		}
	}

	pt := &parse.Tree{
		Name: name,
		Root: &parse.ListNode{
			NodeType: parse.NodeList,
			Pos:      parse.Pos(0),
			Nodes:    nodes,
		},
	}

	return map[string]*parse.Tree{name: pt}, nil
}

{'fraction_non_alphanumeric': 0.16588050314465408, 'fraction_numerical': 0.0047169811320754715, 'mean_word_length': 3.3299319727891157, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6767388', 'n_tokens_mistral': 528, 'n_tokens_neox': 479, 'n_words': 111}