Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 139 lines (127 sloc) 5.01 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
/*
* This file is covered by the Ruby license. See COPYING for more details.
*
* Copyright (C) 2007-2011, Apple Inc. All rights reserved.
* Copyright (C) 2004-2007 Koichi Sasada
*/

#include "macruby_internal.h"
#include "ruby/node.h"
#include "vm.h"

#define extern
#include "id.h"
#undef extern

void
Init_id(void)
{
    /* Symbols */
    symIFUNC = ID2SYM(rb_intern("<IFUNC>"));
    symCFUNC = ID2SYM(rb_intern("<CFUNC>"));

    /* IDs */
    idPLUS = rb_intern("+");
    idMINUS = rb_intern("-");
    idMULT = rb_intern("*");
    idDIV = rb_intern("/");
    idMOD = rb_intern("%");
    idLT = rb_intern("<");
    idLTLT = rb_intern("<<");
    idLE = rb_intern("<=");
    idGT = rb_intern(">");
    idGE = rb_intern(">=");
    idEq = rb_intern("==");
    idEqq = rb_intern("===");
    idBackquote = rb_intern("`");
    idEqTilde = rb_intern("=~");
    idNot = rb_intern("!");
    idNeq = rb_intern("!=");

#if WITH_OBJC
    selPLUS = sel_registerName("+:");
    selMINUS = sel_registerName("-:");
    selMULT = sel_registerName("*:");
    selDIV = sel_registerName("/:");
    selMOD = sel_registerName("%:");
    selAND = sel_registerName("&:");
    selEq = sel_registerName("==:");
    selNeq = sel_registerName("!=:");
    selCmp = sel_registerName("<=>:");
    selLT = sel_registerName("<:");
    selLE = sel_registerName("<=:");
    selGT = sel_registerName(">:");
    selGE = sel_registerName(">=:");
    selLTLT = sel_registerName("<<:");
    selAREF = sel_registerName("[]:");
    selASET = sel_registerName("[]=:");
    selLength = sel_registerName("length");
    selSucc = sel_registerName("succ");
    selNot = sel_registerName("!");
    selNot2 = sel_registerName("!:");
    selAlloc = sel_registerName("alloc");
    selAllocWithZone = sel_registerName("allocWithZone:");
    selCopyWithZone = sel_registerName("copyWithZone:");
    selInit = sel_registerName("init");
    selInitialize = sel_registerName("initialize");
    selInitialize2 = sel_registerName("initialize:");
    selInitializeCopy = sel_registerName("initialize_copy:");
    selDescription = sel_registerName("description");
    selInspect = sel_registerName("inspect");
    selNew = sel_registerName("new");
    selRespondTo = sel_registerName("respond_to?:");
    selMethodMissing = sel_registerName("method_missing:");
    selConstMissing = sel_registerName("const_missing:");
    selCopy = sel_registerName("copy");
    selMutableCopy = sel_registerName("mutableCopy");
    sel_zone = sel_registerName("zone");
    selToS = sel_registerName("to_s");
    selToAry = sel_registerName("to_ary");
    selSend = sel_registerName("send:");
    sel__send__ = sel_registerName("__send__:");
    selCall = sel_registerName("call:");
    selEqTilde = sel_registerName("=~:");
    selClass = sel_registerName("class");
    selEval = sel_registerName("eval:");
    selInstanceEval = sel_registerName("instance_eval:");
    selClassEval = sel_registerName("class_eval:");
    selModuleEval = sel_registerName("module_eval:");
    selLocalVariables = sel_registerName("local_variables");
    selBinding = sel_registerName("binding");
    selEach = sel_registerName("each");
    selEqq = sel_registerName("===:");
    selDup = sel_registerName("dup");
    selBackquote = sel_registerName("`:");
    selMethodAdded = sel_registerName("method_added:");
    selSingletonMethodAdded = sel_registerName("singleton_method_added:");
    selMethodRemoved = sel_registerName("method_removed:");
    selSingletonMethodRemoved = sel_registerName("singleton_method_removed:");
    selMethodUndefined = sel_registerName("method_undefined:");
    selSingletonMethodUndefined = sel_registerName("singleton_method_undefined:");
    selIsEqual = sel_registerName("isEqual:");
    selWrite = sel_registerName("write:");
    selInherited = sel_registerName("inherited:");
    selLambda = sel_registerName("lambda");
    selObjectForKey = sel_registerName("objectForKey:");
    selSetObjectForKey = sel_registerName("setObject:forKey:");

    sel__method__= sel_registerName("__method__");
    sel__callee__ = sel_registerName("__callee__");
#endif

    idAREF = rb_intern("[]");
    idASET = rb_intern("[]=");

    idEach = rb_intern("each");
    idTimes = rb_intern("times");
    idLength = rb_intern("length");
    idLambda = rb_intern("lambda");
    idIntern = rb_intern("intern");
    idGets = rb_intern("gets");
    idSucc = rb_intern("succ");
    idEnd = rb_intern("end");
    idRangeEachLT = rb_intern("Range#each#LT");
    idRangeEachLE = rb_intern("Range#each#LE");
    idArrayEach = rb_intern("Array#each");
    idMethodMissing = rb_intern("method_missing");

    idThrowState = rb_intern("#__ThrowState__");

    idSend = rb_intern("send");
    id__send__ = rb_intern("__send__");

    idRespond_to = rb_intern("respond_to?");
    idInitialize = rb_intern("initialize");

    idIncludedModules = rb_intern("__included_modules__");
    idIncludedInClasses = rb_intern("__included_in_classes__");
    idAncestors = rb_intern("__ancestors__");
}
Something went wrong with that request. Please try again.