<commit_before>/* vim:fileencoding=utf-8
 * 
 * Copyright (C) 2015 <NAME> <kovid at kovidgoyal.net>
 *
 * Distributed under terms of the BSD license
 */
"use strict;";

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

var WARN = 1, ERROR = 2;
var MESSAGES = {
    'undef': 'undefined symbol: "{name}"',
    'unused-import': '"{name}" is imported but not used',
    'unused-local' : '"{name}" is defined but not used',
    'loop-shadowed': 'The loop variable "{name}" was previously used in this scope at line: {line}',
    'extra-semicolon': 'This semi-colon is not needed',
    'eol-semicolon': 'Semi-colons at the end of the line are unnecessary',
    'func-in-branch': 'JavaScript in strict mode does not allow the definition of named functions/classes inside a branch such as an if/try/switch',
    'syntax-err': 'A syntax error caused compilation to abort',
    'import-err': 'An import error caused compilation to abort',
    'def-after-use': 'The symbol "{name}" is defined (at line {line}) after it is used',
    'dup-key': 'JavaScript in strict mode does not allow for duplicate keys ("{name}" is duplicated) in object mode',
};

BUILTINS = {
    'this':true, 'self':true, 'window':true, 'document':true, 
    'print':true, 'len':true, 'range':true, 'dir':true, 'eval':true,
    'undefined':true, 'arguments':true, 'bind':true, 'abs':true,
    'enumerate':true, 'rebind_all':true, 'extends':true, 'reversed':true,
    'sum':true, 'getattr':true, 'setattr':true, 'hasattr':true, 'symbolfor':true,
    'parseInt':true, 'parseFloat':true, 'isNaN':true, 'JSON':true, 'Math':true,
    '_$rapyd$_modules':true, 'require':true,
};
Object.keys(RapydScript.NATIVE_CLASSES).forEach(function (name) { BUILTINS[name] = true; });

function cmp(a, b) {<commit_msg>Linter: Add bool as a default builtin<commit_after>/* vim:fileencoding=utf-8
 * 
 * Copyright (C) 2015 <NAME> <kovid at kovidgoyal.net>
 *
 * Distributed under terms of the BSD license
 */
"use strict;";

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

var WARN = 1, ERROR = 2;
var MESSAGES = {
    'undef': 'undefined symbol: "{name}"',
    'unused-import': '"{name}" is imported but not used',
    'unused-local' : '"{name}" is defined but not used',
    'loop-shadowed': 'The loop variable "{name}" was previously used in this scope at line: {line}',
    'extra-semicolon': 'This semi-colon is not needed',
    'eol-semicolon': 'Semi-colons at the end of the line are unnecessary',
    'func-in-branch': 'JavaScript in strict mode does not allow the definition of named functions/classes inside a branch such as an if/try/switch',
    'syntax-err': 'A syntax error caused compilation to abort',
    'import-err': 'An import error caused compilation to abort',
    'def-after-use': 'The symbol "{name}" is defined (at line {line}) after it is used',
    'dup-key': 'JavaScript in strict mode does not allow for duplicate keys ("{name}" is duplicated) in object mode',
};

BUILTINS = {
    'this':true, 'self':true, 'window':true, 'document':true, 
    'print':true, 'len':true, 'range':true, 'dir':true, 'eval':true,
    'undefined':true, 'arguments':true, 'bind':true, 'abs':true,
    'enumerate':true, 'rebind_all':true, 'extends':true, 'reversed':true,
    'sum':true, 'getattr':true, 'setattr':true, 'hasattr':true, 'symbolfor':true,
    'parseInt':true, 'parseFloat':true, 'isNaN':true, 'JSON':true, 'Math':true,
    '_$rapyd$_modules':true, 'require':true, 'bool':true,
};
Object.keys(RapydScript.NATIVE_CLASSES).forEach(function (name) { BUILTINS[name] = true; });

function cmp(a, b) {
{'fraction_non_alphanumeric': 0.17230527143981117, 'fraction_numerical': 0.0036716496197220037, 'mean_word_length': 4.778787878787878, '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': '565789', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1236, 'n_words': 389}