<commit_before>var tm = require('./throwMessages.js');

exports.variableValue = function(variable){
    var err = tm.fnInvalidVariable(variable);
    if(variable.charAt(0) != '$'){
        throw (err);
    }
    switch(variable){
        case '$0':
            return 0;
            break;
        case '$at':
            return 1;
            break;
        case '$gp':
            return 28;
            break;
        case '$sp':
            return 29;
            break;
        case '$s8':
            return 30;
            break;
        case '$fp':
            return 30;
            break;
        case '$ra':
            return 31;
            break;
    }
    if(isNaN(variable.charAt(2)))
        throw (err);
    var nm = parseInt(variable.charAt(2));
    switch(variable.charAt(1)){
        case 'v':
            if(nm > 1)
                throw (err);
            return 2 + nm;
            break;
        case 'a':
            if(nm > 3)
                throw (err);
            return 4 + nm;
            break;
        case 't':
            if(nm < 8){
                return 8 + nm;
            } else if(nm >= 8 || nm <= 9){
                return 24 + nm;
            } else {
                throw (err);
            }
            break;
        case 'k':
            if(nm > 1)
                throw (err);
            return 26 + nm;
            break;
        case 's':
            if(nm > 7)
                throw (err);
            return 16 + nm;
            break;
        default:
            throw (err);
            break;
    }
}

exports.opShamtFunc = function(val){
    res = {
        op: 0,
        shamt: 0,
        func: 0
    }<commit_msg>Minnor fix at variable verification<commit_after>var tm = require('./throwMessages.js');

exports.variableValue = function(variable){
    var err = tm.fnInvalidVariable(variable);
    if(variable.charAt(0) != '$'){
        throw (err);
    }
    if(variable.length > 3){
        throw (err);
    }
    switch(variable){
        case '$0':
            return 0;
            break;
        case '$at':
            return 1;
            break;
        case '$gp':
            return 28;
            break;
        case '$sp':
            return 29;
            break;
        case '$s8':
            return 30;
            break;
        case '$fp':
            return 30;
            break;
        case '$ra':
            return 31;
            break;
    }
    if(isNaN(variable.charAt(2))){
        throw (err);
    }
    var nm = parseInt(variable.charAt(2));
    switch(variable.charAt(1)){
        case 'v':
            if(nm > 1)
                throw (err);
            return 2 + nm;
            break;
        case 'a':
            if(nm > 3)
                throw (err);
            return 4 + nm;
            break;
        case 't':
            if(nm < 8){
                return 8 + nm;
            } else if(nm >= 8 || nm <= 9){
                return 24 + nm;
            } else {
                throw (err);
            }
            break;
        case 'k':
            if(nm > 1)
                throw (err);
            return 26 + nm;
            break;
        case 's':
            if(nm > 7)
                throw (err);
            return 16 + nm;
            break;
        default:
            console.log("Cathcou?")
            throw (err);
            break;
    }
}

exports.opShamtFunc = function(val){
    res = {
        op: 0,
        shamt: 0,
        func: 0
    }
{'fraction_non_alphanumeric': 0.12101178499568842, 'fraction_numerical': 0.021557918942224776, 'mean_word_length': 0.9583567810917276, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 14, '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': '953560', 'n_tokens_mistral': 1070, 'n_tokens_neox': 983, 'n_words': 261}