<commit_before>"use strict;";
/*
 * repl.js
 * Copyright (C) 2015 <NAME> <kovid at kovidgoyal.net>
 *
 * Distributed under terms of the BSD license.
 */


var fs = require('fs');
var path = require('path');
var vm = require('vm');
var readline = require('readline');
var util = require('util');
var colored = require('./utils').safe_colored;
var RapydScript = require('./compiler').create_compiler();

function create_ctx(baselib, show_js, console) {
    var ctx = vm.createContext({'console':console, 'show_js': !!show_js, 'RapydScript':RapydScript, 'require':require});
	vm.runInContext(baselib, ctx, {'filename':'baselib-plain-pretty.js'});
	var b = vm.runInContext('this', ctx);
	for (var key in b) {
		if (key.substr(0, 9) == '_$rapyd$_' && key.substr(key.length - 9) == '_polyfill') {
			var symname = key.substr(9, key.length - 18);
			vm.runInContext('var ' +  symname + ' = ' + key + '();', ctx);
		}
	}
	RapydScript.AST_Node.warn_function = function() {};
    return ctx;
}


var homedir = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];
var cachedir = expanduser(process.env.XDG_CACHE_HOME || '~/.cache');
var all_keywords = RapydScript.ALL_KEYWORDS.split(' ');
var enum_global = "var global = Function('return this')(); Object.getOwnPropertyNames(global);";

function expanduser(x) {
  if (!x) return x;<commit_msg>Remove unneeded polyfill code from REPL<commit_after>"use strict;";
/*
 * repl.js
 * Copyright (C) 2015 <NAME> <kovid at kovidgoyal.net>
 *
 * Distributed under terms of the BSD license.
 */


var fs = require('fs');
var path = require('path');
var vm = require('vm');
var readline = require('readline');
var util = require('util');
var colored = require('./utils').safe_colored;
var RapydScript = require('./compiler').create_compiler();

function create_ctx(baselib, show_js, console) {
    var ctx = vm.createContext({'console':console, 'show_js': !!show_js, 'RapydScript':RapydScript, 'require':require});
	vm.runInContext(baselib, ctx, {'filename':'baselib-plain-pretty.js'});
	RapydScript.AST_Node.warn_function = function() {};
    return ctx;
}


var homedir = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];
var cachedir = expanduser(process.env.XDG_CACHE_HOME || '~/.cache');
var all_keywords = RapydScript.ALL_KEYWORDS.split(' ');
var enum_global = "var global = Function('return this')(); Object.getOwnPropertyNames(global);";

function expanduser(x) {
  if (!x) return x;
{'fraction_non_alphanumeric': 0.18181818181818182, 'fraction_numerical': 0.007337953526294333, 'mean_word_length': 5.228426395939087, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3773404', 'n_tokens_mistral': 859, 'n_tokens_neox': 824, 'n_words': 193}