<commit_before>package com.quirkygaming.othniel;

import java.util.Scanner;

import com.quirkygaming.othniel.MathOps.Op;


public class Natives extends CallableContainer {
	
	private static Scanner in = new Scanner(System.in);
	
	static void initNatives() {
		cache(new Input("INPUT"));
		cache(new InputLine("INPUTLN"));
		cache(new Print(false, "PRINT"));
		cache(new Print(true, "PRINTLN"));
		cache(new Assign(":"));
		cache(new Xor("XOR"));
		cache(new And("AND"));
		cache(new Or("OR"));
		cache(new Not("NOT"));
		cache(new Ternary("?:"));
		cache(new Add("+"));
		
		for (Callable c : Interpreter.cacheFile("Natives.othsrc").values()) {
			cache(c);
		}
	}
	
	private static void cache(Callable c) {
		calls.put(c.name(), c);
	}
	
	abstract static class Native extends Callable {
		
		CachedCall c;
		
		public Native(String name, Datatype[] ins, Datatype[] outs) {
			super(name, ins, outs);
		}
		
		@Override
		public final void call(Pipe[] runtimeIns, Pipe[] runtimeOuts, CachedCall c) {
			for (int i = 0; i < ins.length; i++) {
				Datatype reqType = ins[i];
				if (reqType.isImplicit()) reqType = reqType.getImplicitType(runtimeIns[i].getLabel(), c);
				else continue;
				Datatype runtimeType = runtimeIns[i].type();
				Datatype.checkCompat(runtimeType, reqType, c.getLine()); // TODO verify order
			}
			for (int i = 0; i < outs.length; i++) {
				Datatype reqType = outs[i];
				if (reqType.isImplicit()) reqType = reqType.getImplicitType(runtimeOuts[i].getLabel(), c);
				else continue;
				Datatype runtimeType = runtimeOuts[i].type();
				Datatype.checkCompat(reqType, runtimeType, c.getLine()); // TODO verify order
			}
			this.c = c;
			call(runtimeIns,runtimeOuts);
		}<commit_msg>Changed some comments<commit_after>package com.quirkygaming.othniel;

import java.util.Scanner;

import com.quirkygaming.othniel.MathOps.Op;


public class Natives extends CallableContainer {
	
	private static Scanner in = new Scanner(System.in);
	
	static void initNatives() {
		cache(new Input("INPUT"));
		cache(new InputLine("INPUTLN"));
		cache(new Print(false, "PRINT"));
		cache(new Print(true, "PRINTLN"));
		cache(new Assign(":"));
		cache(new Xor("XOR"));
		cache(new And("AND"));
		cache(new Or("OR"));
		cache(new Not("NOT"));
		cache(new Ternary("?:"));
		cache(new Add("+"));
		
		for (Callable c : Interpreter.cacheFile("Natives.othsrc").values()) {
			cache(c);
		}
	}
	
	private static void cache(Callable c) {
		calls.put(c.name(), c);
	}
	
	abstract static class Native extends Callable {
		
		CachedCall c;
		
		public Native(String name, Datatype[] ins, Datatype[] outs) {
			super(name, ins, outs);
		}
		
		@Override
		public final void call(Pipe[] runtimeIns, Pipe[] runtimeOuts, CachedCall c) {
			// Loop through ins and outs and if any are defined implicitly, verify their type correctness
			for (int i = 0; i < ins.length; i++) {
				Datatype reqType = ins[i];
				if (reqType.isImplicit()) reqType = reqType.getImplicitType(runtimeIns[i].getLabel(), c);
				else continue;
				Datatype runtimeType = runtimeIns[i].type();
				Datatype.checkCompat(runtimeType, reqType, c.getLine());
			}
			for (int i = 0; i < outs.length; i++) {
				Datatype reqType = outs[i];
				if (reqType.isImplicit()) reqType = reqType.getImplicitType(runtimeOuts[i].getLabel(), c);
				else continue;
				Datatype runtimeType = runtimeOuts[i].type();
				Datatype.checkCompat(reqType, runtimeType, c.getLine()); // TODO verify order
			}
			this.c = c;
			call(runtimeIns,runtimeOuts); // Forward to actual natives
		}
{'fraction_non_alphanumeric': 0.15417256011315417, 'fraction_numerical': 0.0011315417256011315, 'mean_word_length': 4.073170731707317, 'pattern_counts': {'":': 2, '<': 7, '<?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': '6974867', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1179, 'n_words': 296}