<commit_before>package org.strategoxt.imp.runtime.stratego.adapter;

import org.spoofax.interpreter.terms.IStrategoString;
import org.spoofax.interpreter.terms.IStrategoTerm;
import org.spoofax.interpreter.terms.ITermPrinter;
import org.strategoxt.imp.runtime.parser.ast.StringAstNode;

public class WrappedAstNodeString extends WrappedAstNode implements IStrategoString {
	
	protected WrappedAstNodeString(IStrategoAstNode node) {
		super(node);
		assert node instanceof StringAstNode;
	}

	public String stringValue() {
		return ((StringAstNode) getNode()).getValue();
	}

    public void prettyPrint(ITermPrinter pp) {
    	pp.print("\"");
    	pp.print(stringValue().replace("\\", "\\\\").replace("\"", "\\\""));
    	pp.print("\"");
    	printAnnotations(pp);
    }

	public int getTermType() {
		return IStrategoTerm.STRING;<commit_msg>Escape newlines when printing term strings.<commit_after>package org.strategoxt.imp.runtime.stratego.adapter;

import org.spoofax.interpreter.terms.IStrategoString;
import org.spoofax.interpreter.terms.IStrategoTerm;
import org.spoofax.interpreter.terms.ITermPrinter;
import org.strategoxt.imp.runtime.parser.ast.StringAstNode;

public class WrappedAstNodeString extends WrappedAstNode implements IStrategoString {
	
	protected WrappedAstNodeString(IStrategoAstNode node) {
		super(node);
		assert node instanceof StringAstNode;
	}

	public String stringValue() {
		return ((StringAstNode) getNode()).getValue();
	}

    public void prettyPrint(ITermPrinter pp) {
    	pp.print("\"");
    	pp.print(stringValue().replace("\\", "\\\\").replace("\"", "\\\"")
    			.replace("\n", "\\n").replace("\r", "\\r"));
    	pp.print("\"");
    	printAnnotations(pp);
    }

	public int getTermType() {
		return IStrategoTerm.STRING;
{'fraction_non_alphanumeric': 0.1445578231292517, 'fraction_numerical': 0.0, 'mean_word_length': 4.67524115755627, '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': '6749107', 'n_tokens_mistral': 625, 'n_tokens_neox': 577, 'n_words': 97}