<commit_before>package printer

import (
	"bytes"
	"fmt"
	"io"

	"github.com/fatih/hcl/ast"
)

const (
	blank   = byte(' ')
	newline = byte('\n')
	tab     = byte('\t')
)

func (p *printer) printNode(n ast.Node) []byte {
	var buf bytes.Buffer

	switch t := n.(type) {
	case *ast.ObjectList:
		for i, item := range t.Items {
			buf.Write(p.printObjectItem(item))
			if i != len(t.Items)-1 {
				buf.WriteByte(newline)
			}
		}
	case *ast.ObjectKey:
		buf.WriteString(t.Token.Text)
	case *ast.ObjectItem:
		buf.Write(p.printObjectItem(t))
	case *ast.LiteralType:
		buf.WriteString(t.Token.Text)
	case *ast.ListType:
		buf.Write(p.printList(t))
	case *ast.ObjectType:
		buf.Write(p.printObjectType(t))
	default:
		fmt.Printf(" unknown type: %T\n", n)
	}<commit_msg>printer: add newline after each object<commit_after>package printer

import (
	"bytes"
	"fmt"
	"io"

	"github.com/fatih/hcl/ast"
)

const (
	blank   = byte(' ')
	newline = byte('\n')
	tab     = byte('\t')
)

func (p *printer) printNode(n ast.Node) []byte {
	var buf bytes.Buffer

	switch t := n.(type) {
	case *ast.ObjectList:
		for i, item := range t.Items {
			buf.Write(p.printObjectItem(item))
			if i != len(t.Items)-1 {
				buf.Write([]byte{newline, newline})
			}
		}
	case *ast.ObjectKey:
		buf.WriteString(t.Token.Text)
	case *ast.ObjectItem:
		buf.Write(p.printObjectItem(t))
	case *ast.LiteralType:
		buf.WriteString(t.Token.Text)
	case *ast.ListType:
		buf.Write(p.printList(t))
	case *ast.ObjectType:
		buf.Write(p.printObjectType(t))
	default:
		fmt.Printf(" unknown type: %T\n", n)
	}
{'fraction_non_alphanumeric': 0.17307692307692307, 'fraction_numerical': 0.001282051282051282, 'mean_word_length': 3.5510204081632653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7010471', 'n_tokens_mistral': 681, 'n_tokens_neox': 645, 'n_words': 124}