---input--- #include #include #include #include "codegen.h" #include "symboltable.h" #include "stringbuffer.h" extern void yyerror(char* msg); static stringBuffer* staticVariableBuffer; static stringBuffer* classInitBuffer; static stringBuffer* currentMethodBuffer; static stringBuffer* finishedMethodsBuffer; static stringBuffer* mainBuffer; static int currentMethodBufferIndex; static int currentMethodStackSize; static int currentMethodStackSizeMax; static int currentMethodNumberOfLocals; static int classInitBufferIndex; static int classInitStackSize; static int classInitStackSizeMax; static int labelCounter = 0; static int global = 1; char tempString[MAX_LENGTH_OF_COMMAND]; extern char* className; /* from minako-syntax.y */ /* forward declarations */ static void increaseStackby(int stackdiff); char convertType(int type); void codegenInit() { staticVariableBuffer = newStringBuffer(); classInitBuffer = newStringBuffer(); currentMethodBuffer = 0; finishedMethodsBuffer = newStringBuffer(); mainBuffer = newStringBuffer(); stringBufferAppend(mainBuffer, "; ------- Header --------------------------------------------"); sprintf(tempString, ".class public synchronized %s", className); stringBufferAppend(mainBuffer, tempString); stringBufferAppend(mainBuffer, ".super java/lang/Object"); stringBufferAppend(mainBuffer, "; -----------------------------------------------------------"); stringBufferAppend(mainBuffer, ""); stringBufferAppend(finishedMethodsBuffer, "; ------- Constructor ---------------------------------------"); stringBufferAppend(finishedMethodsBuffer, ".method public ()V"); stringBufferAppend(finishedMethodsBuffer, "\t.limit stack 1"); stringBufferAppend(finishedMethodsBuffer, "\t.limit locals 1"); stringBufferAppend(finishedMethodsBuffer, "\taload_0"); stringBufferAppend(finishedMethodsBuffer, "\tinvokenonvirtual java/lang/Object/()V"); stringBufferAppend(finishedMethodsBuffer, "\treturn"); stringBufferAppend(finishedMethodsBuffer, ".end method"); stringBufferAppend(finishedMethodsBuffer, "; -----------------------------------------------------------"); stringBufferAppend(finishedMethodsBuffer, ""); stringBufferAppend(staticVariableBuffer, "; ------- Class Variables -----------------------------------"); stringBufferAppend(classInitBuffer, "; ------- Class Initializer ---------------------------------"); stringBufferAppend(classInitBuffer, ".method static ()V"); classInitBufferIndex = classInitBuffer->numberOfNextElement; stringBufferAppend(classInitBuffer, "\t.limit locals 0"); } void codegenAppendCommand(char* cmd, int stackdiff) { char tempString[MAX_LENGTH_OF_COMMAND]; sprintf(tempString, "\t%s", cmd); if (global) stringBufferAppend(classInitBuffer, tempString); else stringBufferAppend(currentMethodBuffer, tempString); increaseStackby(stackdiff); } void codegenInsertCommand(int address, char* cmd, int stackdiff) { char tempString[MAX_LENGTH_OF_COMMAND]; sprintf(tempString, "\t%s", cmd); if (global) stringBufferInsert(classInitBuffer, address, tempString); else stringBufferInsert(currentMethodBuffer, address, tempString); increaseStackby(stackdiff); } void codegenAppendLabel(int label) { char tempString[MAX_LENGTH_OF_COMMAND]; sprintf(tempString, "Label%d:", label); if (global) stringBufferAppend(classInitBuffer, tempString); else stringBufferAppend(currentMethodBuffer, tempString); } void codegenAddVariable(char* name, int type) { /*fprintf(stderr, "add variable %s(%d) global=%d ", name, convertType(type), global);*/ if (global) { if (type == TYPE_INT) sprintf(tempString, ".field static %s %c", name, 'I'); else if (type == TYPE_FLOAT) sprintf(tempString, ".field static %s %c", name, 'F'); else if (type == TYPE_BOOLEAN) sprintf(tempString, ".field static %s %c", name, 'Z'); else yyerror("compiler-intern error in codegenAddGlobalVariable().\n"); stringBufferAppend(staticVariableBuffer, tempString); } else { currentMethodNumberOfLocals++; } } int codegenGetNextLabel() { return labelCounter++; } int codegenGetCurrentAddress() { if (global) return classInitBuffer->numberOfNextElement; else return currentMethodBuffer->numberOfNextElement; } void codegenEnterFunction(symtabEntry* entry) { currentMethodBuffer = newStringBuffer(); currentMethodStackSize = 0; currentMethodStackSizeMax = 0; labelCounter = 1; global = 0; if (strcmp(entry->name, "main") == 0) { if (entry->idtype != TYPE_VOID) yyerror("main has to be void.\n"); currentMethodNumberOfLocals = 1; symtabInsert(strdup("#main-param#"), TYPE_VOID, CLASS_FUNC); stringBufferAppend(currentMethodBuffer, "; ------- Methode ---- void main() --------------------------"); stringBufferAppend(currentMethodBuffer, ".method public static main([Ljava/lang/String;)V"); } else { int i; currentMethodNumberOfLocals = entry->paramIndex; stringBufferAppend(currentMethodBuffer, "; ------- Methode -------------------------------------------"); sprintf(tempString, ".method public static %s(", entry->name); for (i=entry->paramIndex-1; i>=0; i--) { int type = entry->params[i]->idtype; tempString[strlen(tempString)+1] = 0; tempString[strlen(tempString)] = convertType(type); } tempString[strlen(tempString)+2] = 0; tempString[strlen(tempString)+1] = convertType(entry->idtype); tempString[strlen(tempString)] = ')'; stringBufferAppend(currentMethodBuffer, tempString); } currentMethodBufferIndex = currentMethodBuffer->numberOfNextElement; } void codegenLeaveFunction() { global = 1; sprintf(tempString, "\t.limit locals %d", currentMethodNumberOfLocals); stringBufferInsert(currentMethodBuffer, currentMethodBufferIndex, tempString); sprintf(tempString, "\t.limit stack %d", currentMethodStackSizeMax); stringBufferInsert(currentMethodBuffer, currentMethodBufferIndex, tempString); stringBufferAppend(currentMethodBuffer, "\treturn"); stringBufferAppend(currentMethodBuffer, ".end method"); stringBufferAppend(currentMethodBuffer, "; -----------------------------------------------------------"); stringBufferAppend(currentMethodBuffer, ""); stringBufferConcatenate(finishedMethodsBuffer, currentMethodBuffer); } void codegenFinishCode() { stringBufferAppend(staticVariableBuffer, "; -----------------------------------------------------------"); stringBufferAppend(staticVariableBuffer, ""); sprintf(tempString, "\t.limit stack %d", classInitStackSizeMax); stringBufferInsert(classInitBuffer, classInitBufferIndex, tempString); stringBufferAppend(classInitBuffer, "\treturn"); stringBufferAppend(classInitBuffer, ".end method"); stringBufferAppend(classInitBuffer, "; -----------------------------------------------------------"); stringBufferConcatenate(mainBuffer, staticVariableBuffer); stringBufferConcatenate(mainBuffer, finishedMethodsBuffer); stringBufferConcatenate(mainBuffer, classInitBuffer); stringBufferPrint(mainBuffer); } static void increaseStackby(int stackdiff) { if (global) { classInitStackSize += stackdiff; if (classInitStackSize > classInitStackSizeMax) classInitStackSizeMax = classInitStackSize; } else { currentMethodStackSize += stackdiff; if (currentMethodStackSize > currentMethodStackSizeMax) currentMethodStackSizeMax = currentMethodStackSize; } } char convertType(int type) { switch(type) { case TYPE_VOID: return 'V'; case TYPE_INT: return 'I'; case TYPE_FLOAT: return 'F'; case TYPE_BOOLEAN: return 'Z'; default : yyerror("compiler-intern error in convertType().\n"); } return 0; /* to avoid compiler-warning */ } //#include //#include int main() { int a = 12, b = 44; while (a != b) { if (a > b) a -= b; else b -= a; } printf("%d\n%d", a, 0X0);\ } /********************************************************************** array.c - $Author: murphy $ $Date: 2005-11-05 04:33:55 +0100 (Sa, 05 Nov 2005) $ created at: Fri Aug 6 09:46:12 JST 1993 Copyright (C) 1993-2003 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan **********************************************************************/ #include "ruby.h" #include "util.h" #include "st.h" #include "node.h" VALUE rb_cArray, rb_cValues; static ID id_cmp; #define ARY_DEFAULT_SIZE 16 void rb_mem_clear(mem, size) register VALUE *mem; register long size; { while (size--) { *mem++ = Qnil; } } static inline void memfill(mem, size, val) register VALUE *mem; register long size; register VALUE val; { while (size--) { *mem++ = val; } } #define ARY_TMPLOCK FL_USER1 static inline void rb_ary_modify_check(ary) VALUE ary; { if (OBJ_FROZEN(ary)) rb_error_frozen("array"); if (FL_TEST(ary, ARY_TMPLOCK)) rb_raise(rb_eRuntimeError, "can't modify array during iteration"); if (!OBJ_TAINTED(ary) && rb_safe_level() >= 4) rb_raise(rb_eSecurityError, "Insecure: can't modify array"); } static void rb_ary_modify(ary) VALUE ary; { VALUE *ptr; rb_ary_modify_check(ary); if (FL_TEST(ary, ELTS_SHARED)) { ptr = ALLOC_N(VALUE, RARRAY(ary)->len); FL_UNSET(ary, ELTS_SHARED); RARRAY(ary)->aux.capa = RARRAY(ary)->len; MEMCPY(ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len); RARRAY(ary)->ptr = ptr; } } VALUE rb_ary_freeze(ary) VALUE ary; { return rb_obj_freeze(ary); } /* * call-seq: * array.frozen? -> true or false * * Return true if this array is frozen (or temporarily frozen * while being sorted). */ static VALUE rb_ary_frozen_p(ary) VALUE ary; { if (OBJ_FROZEN(ary)) return Qtrue; if (FL_TEST(ary, ARY_TMPLOCK)) return Qtrue; return Qfalse; } static VALUE ary_alloc(VALUE); static VALUE ary_alloc(klass) VALUE klass; { NEWOBJ(ary, struct RArray); OBJSETUP(ary, klass, T_ARRAY); ary->len = 0; ary->ptr = 0; ary->aux.capa = 0; return (VALUE)ary; } static VALUE ary_new(klass, len) VALUE klass; long len; { VALUE ary; if (len < 0) { rb_raise(rb_eArgError, "negative array size (or size too big)"); } if (len > 0 && len * sizeof(VALUE) <= len) { rb_raise(rb_eArgError, "array size too big"); } if (len == 0) len++; ary = ary_alloc(klass); RARRAY(ary)->ptr = ALLOC_N(VALUE, len); RARRAY(ary)->aux.capa = len; return ary; } VALUE rb_ary_new2(len) long len; { return ary_new(rb_cArray, len); } VALUE rb_ary_new() { return rb_ary_new2(ARY_DEFAULT_SIZE); } #ifdef HAVE_STDARG_PROTOTYPES #include #define va_init_list(a,b) va_start(a,b) #else #include #define va_init_list(a,b) va_start(a) #endif VALUE #ifdef HAVE_STDARG_PROTOTYPES rb_ary_new3(long n, ...) #else rb_ary_new3(n, va_alist) long n; va_dcl #endif { va_list ar; VALUE ary; long i; ary = rb_ary_new2(n); va_init_list(ar, n); for (i=0; iptr[i] = va_arg(ar, VALUE); } va_end(ar); RARRAY(ary)->len = n; return ary; } VALUE rb_ary_new4(n, elts) long n; const VALUE *elts; { VALUE ary; ary = rb_ary_new2(n); if (n > 0 && elts) { MEMCPY(RARRAY(ary)->ptr, elts, VALUE, n); } RARRAY(ary)->len = n; return ary; } VALUE #ifdef HAVE_STDARG_PROTOTYPES rb_values_new(long n, ...) #else rb_values_new(n, va_alist) long n; va_dcl #endif { va_list ar; VALUE val; long i; val = ary_new(rb_cValues, n); va_init_list(ar, n); for (i=0; iptr[i] = va_arg(ar, VALUE); } va_end(ar); RARRAY(val)->len = n; return val; } VALUE rb_values_new2(n, elts) long n; const VALUE *elts; { VALUE val; val = ary_new(rb_cValues, n); if (n > 0 && elts) { RARRAY(val)->len = n; MEMCPY(RARRAY(val)->ptr, elts, VALUE, n); } return val; } static VALUE ary_make_shared(ary) VALUE ary; { if (!FL_TEST(ary, ELTS_SHARED)) { NEWOBJ(shared, struct RArray); OBJSETUP(shared, rb_cArray, T_ARRAY); shared->len = RARRAY(ary)->len; shared->ptr = RARRAY(ary)->ptr; shared->aux.capa = RARRAY(ary)->aux.capa; RARRAY(ary)->aux.shared = (VALUE)shared; FL_SET(ary, ELTS_SHARED); OBJ_FREEZE(shared); return (VALUE)shared; } else { return RARRAY(ary)->aux.shared; } } static VALUE ary_shared_array(klass, ary) VALUE klass, ary; { VALUE val = ary_alloc(klass); ary_make_shared(ary); RARRAY(val)->ptr = RARRAY(ary)->ptr; RARRAY(val)->len = RARRAY(ary)->len; RARRAY(val)->aux.shared = RARRAY(ary)->aux.shared; FL_SET(val, ELTS_SHARED); return val; } VALUE rb_values_from_ary(ary) VALUE ary; { return ary_shared_array(rb_cValues, ary); } VALUE rb_ary_from_values(val) VALUE val; { return ary_shared_array(rb_cArray, val); } VALUE rb_assoc_new(car, cdr) VALUE car, cdr; { return rb_values_new(2, car, cdr); } static VALUE to_ary(ary) VALUE ary; { return rb_convert_type(ary, T_ARRAY, "Array", "to_ary"); } static VALUE to_a(ary) VALUE ary; { return rb_convert_type(ary, T_ARRAY, "Array", "to_a"); } VALUE rb_check_array_type(ary) VALUE ary; { return rb_check_convert_type(ary, T_ARRAY, "Array", "to_ary"); } static VALUE rb_ary_replace _((VALUE, VALUE)); /* * call-seq: * Array.new(size=0, obj=nil) * Array.new(array) * Array.new(size) {|index| block } * * Returns a new array. In the first form, the new array is * empty. In the second it is created with _size_ copies of _obj_ * (that is, _size_ references to the same * _obj_). The third form creates a copy of the array * passed as a parameter (the array is generated by calling * to_ary on the parameter). In the last form, an array * of the given size is created. Each element in this array is * calculated by passing the element's index to the given block and * storing the return value. * * Array.new * Array.new(2) * Array.new(5, "A") * * # only one copy of the object is created * a = Array.new(2, Hash.new) * a[0]['cat'] = 'feline' * a * a[1]['cat'] = 'Felix' * a * * # here multiple copies are created * a = Array.new(2) { Hash.new } * a[0]['cat'] = 'feline' * a * * squares = Array.new(5) {|i| i*i} * squares * * copy = Array.new(squares) */ static VALUE rb_ary_initialize(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { long len; VALUE size, val; if (rb_scan_args(argc, argv, "02", &size, &val) == 0) { RARRAY(ary)->len = 0; if (rb_block_given_p()) { rb_warning("given block not used"); } return ary; } if (argc == 1 && !FIXNUM_P(size)) { val = rb_check_array_type(size); if (!NIL_P(val)) { rb_ary_replace(ary, val); return ary; } } len = NUM2LONG(size); if (len < 0) { rb_raise(rb_eArgError, "negative array size"); } if (len > 0 && len * (long)sizeof(VALUE) <= len) { rb_raise(rb_eArgError, "array size too big"); } rb_ary_modify(ary); if (len > RARRAY(ary)->aux.capa) { REALLOC_N(RARRAY(ary)->ptr, VALUE, len); RARRAY(ary)->aux.capa = len; } if (rb_block_given_p()) { long i; if (argc == 2) { rb_warn("block supersedes default value argument"); } for (i=0; ilen = i + 1; } } else { memfill(RARRAY(ary)->ptr, len, val); RARRAY(ary)->len = len; } return ary; } /* * Returns a new array populated with the given objects. * * Array.[]( 1, 'a', /^A/ ) * Array[ 1, 'a', /^A/ ] * [ 1, 'a', /^A/ ] */ static VALUE rb_ary_s_create(argc, argv, klass) int argc; VALUE *argv; VALUE klass; { VALUE ary = ary_alloc(klass); if (argc > 0) { RARRAY(ary)->ptr = ALLOC_N(VALUE, argc); MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc); } RARRAY(ary)->len = RARRAY(ary)->aux.capa = argc; return ary; } void rb_ary_store(ary, idx, val) VALUE ary; long idx; VALUE val; { if (idx < 0) { idx += RARRAY(ary)->len; if (idx < 0) { rb_raise(rb_eIndexError, "index %ld out of array", idx - RARRAY(ary)->len); } } rb_ary_modify(ary); if (idx >= RARRAY(ary)->aux.capa) { long new_capa = RARRAY(ary)->aux.capa / 2; if (new_capa < ARY_DEFAULT_SIZE) { new_capa = ARY_DEFAULT_SIZE; } new_capa += idx; if (new_capa * (long)sizeof(VALUE) <= new_capa) { rb_raise(rb_eArgError, "index too big"); } REALLOC_N(RARRAY(ary)->ptr, VALUE, new_capa); RARRAY(ary)->aux.capa = new_capa; } if (idx > RARRAY(ary)->len) { rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, idx-RARRAY(ary)->len + 1); } if (idx >= RARRAY(ary)->len) { RARRAY(ary)->len = idx + 1; } RARRAY(ary)->ptr[idx] = val; } static VALUE ary_shared_first(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { VALUE nv, result; long n; rb_scan_args(argc, argv, "1", &nv); n = NUM2LONG(nv); if (n > RARRAY(ary)->len) { n = RARRAY(ary)->len; } else if (n < 0) { rb_raise(rb_eArgError, "negative array size"); } result = ary_shared_array(rb_cArray, ary); RARRAY(result)->len = n; return result; } static VALUE ary_shared_last(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { VALUE result = ary_shared_first(argc, argv, ary); RARRAY(result)->ptr += RARRAY(ary)->len - RARRAY(result)->len; return result; } /* * call-seq: * array << obj -> array * * Append---Pushes the given object on to the end of this array. This * expression returns the array itself, so several appends * may be chained together. * * [ 1, 2 ] << "c" << "d" << [ 3, 4 ] * #=> [ 1, 2, "c", "d", [ 3, 4 ] ] * */ VALUE rb_ary_push(ary, item) VALUE ary; VALUE item; { rb_ary_store(ary, RARRAY(ary)->len, item); return ary; } /* * call-seq: * array.push(obj, ... ) -> array * * Append---Pushes the given object(s) on to the end of this array. This * expression returns the array itself, so several appends * may be chained together. * * a = [ "a", "b", "c" ] * a.push("d", "e", "f") * #=> ["a", "b", "c", "d", "e", "f"] */ static VALUE rb_ary_push_m(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { while (argc--) { rb_ary_push(ary, *argv++); } return ary; } VALUE rb_ary_pop(ary) VALUE ary; { rb_ary_modify_check(ary); if (RARRAY(ary)->len == 0) return Qnil; if (!FL_TEST(ary, ELTS_SHARED) && RARRAY(ary)->len * 2 < RARRAY(ary)->aux.capa && RARRAY(ary)->aux.capa > ARY_DEFAULT_SIZE) { RARRAY(ary)->aux.capa = RARRAY(ary)->len * 2; REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa); } return RARRAY(ary)->ptr[--RARRAY(ary)->len]; } /* * call-seq: * array.pop -> obj or nil * * Removes the last element from self and returns it, or * nil if the array is empty. * * a = [ "a", "b", "c", "d" ] * a.pop #=> "d" * a.pop(2) #=> ["b", "c"] * a #=> ["a"] */ static VALUE rb_ary_pop_m(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { VALUE result; if (argc == 0) { return rb_ary_pop(ary); } rb_ary_modify_check(ary); result = ary_shared_last(argc, argv, ary); RARRAY(ary)->len -= RARRAY(result)->len; return result; } VALUE rb_ary_shift(ary) VALUE ary; { VALUE top; rb_ary_modify_check(ary); if (RARRAY(ary)->len == 0) return Qnil; top = RARRAY(ary)->ptr[0]; ary_make_shared(ary); RARRAY(ary)->ptr++; /* shift ptr */ RARRAY(ary)->len--; return top; } /* * call-seq: * array.shift -> obj or nil * * Returns the first element of self and removes it (shifting all * other elements down by one). Returns nil if the array * is empty. * * args = [ "-m", "-q", "filename" ] * args.shift #=> "-m" * args #=> ["-q", "filename"] * * args = [ "-m", "-q", "filename" ] * args.shift(2) #=> ["-m", "-q"] * args #=> ["filename"] */ static VALUE rb_ary_shift_m(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { VALUE result; long n; if (argc == 0) { return rb_ary_shift(ary); } rb_ary_modify_check(ary); result = ary_shared_first(argc, argv, ary); n = RARRAY(result)->len; RARRAY(ary)->ptr += n; RARRAY(ary)->len -= n; return result; } VALUE rb_ary_unshift(ary, item) VALUE ary, item; { rb_ary_modify(ary); if (RARRAY(ary)->len == RARRAY(ary)->aux.capa) { long capa_inc = RARRAY(ary)->aux.capa / 2; if (capa_inc < ARY_DEFAULT_SIZE) { capa_inc = ARY_DEFAULT_SIZE; } RARRAY(ary)->aux.capa += capa_inc; REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa); } /* sliding items */ MEMMOVE(RARRAY(ary)->ptr + 1, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len); RARRAY(ary)->len++; RARRAY(ary)->ptr[0] = item; return ary; } /* * call-seq: * array.unshift(obj, ...) -> array * * Prepends objects to the front of array. * other elements up one. * * a = [ "b", "c", "d" ] * a.unshift("a") #=> ["a", "b", "c", "d"] * a.unshift(1, 2) #=> [ 1, 2, "a", "b", "c", "d"] */ static VALUE rb_ary_unshift_m(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { long len = RARRAY(ary)->len; if (argc == 0) return ary; /* make rooms by setting the last item */ rb_ary_store(ary, len + argc - 1, Qnil); /* sliding items */ MEMMOVE(RARRAY(ary)->ptr + argc, RARRAY(ary)->ptr, VALUE, len); MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc); return ary; } /* faster version - use this if you don't need to treat negative offset */ static inline VALUE rb_ary_elt(ary, offset) VALUE ary; long offset; { if (RARRAY(ary)->len == 0) return Qnil; if (offset < 0 || RARRAY(ary)->len <= offset) { return Qnil; } return RARRAY(ary)->ptr[offset]; } VALUE rb_ary_entry(ary, offset) VALUE ary; long offset; { if (offset < 0) { offset += RARRAY(ary)->len; } return rb_ary_elt(ary, offset); } static VALUE rb_ary_subseq(ary, beg, len) VALUE ary; long beg, len; { VALUE klass, ary2, shared; VALUE *ptr; if (beg > RARRAY(ary)->len) return Qnil; if (beg < 0 || len < 0) return Qnil; if (beg + len > RARRAY(ary)->len) { len = RARRAY(ary)->len - beg; if (len < 0) len = 0; } klass = rb_obj_class(ary); if (len == 0) return ary_new(klass, 0); shared = ary_make_shared(ary); ptr = RARRAY(ary)->ptr; ary2 = ary_alloc(klass); RARRAY(ary2)->ptr = ptr + beg; RARRAY(ary2)->len = len; RARRAY(ary2)->aux.shared = shared; FL_SET(ary2, ELTS_SHARED); return ary2; } /* * call-seq: * array[index] -> obj or nil * array[start, length] -> an_array or nil * array[range] -> an_array or nil * array.slice(index) -> obj or nil * array.slice(start, length) -> an_array or nil * array.slice(range) -> an_array or nil * * Element Reference---Returns the element at _index_, * or returns a subarray starting at _start_ and * continuing for _length_ elements, or returns a subarray * specified by _range_. * Negative indices count backward from the end of the * array (-1 is the last element). Returns nil if the index * (or starting index) are out of range. * * a = [ "a", "b", "c", "d", "e" ] * a[2] + a[0] + a[1] #=> "cab" * a[6] #=> nil * a[1, 2] #=> [ "b", "c" ] * a[1..3] #=> [ "b", "c", "d" ] * a[4..7] #=> [ "e" ] * a[6..10] #=> nil * a[-3, 3] #=> [ "c", "d", "e" ] * # special cases * a[5] #=> nil * a[5, 1] #=> [] * a[5..10] #=> [] * */ VALUE rb_ary_aref(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { VALUE arg; long beg, len; if (argc == 2) { beg = NUM2LONG(argv[0]); len = NUM2LONG(argv[1]); if (beg < 0) { beg += RARRAY(ary)->len; } return rb_ary_subseq(ary, beg, len); } if (argc != 1) { rb_scan_args(argc, argv, "11", 0, 0); } arg = argv[0]; /* special case - speeding up */ if (FIXNUM_P(arg)) { return rb_ary_entry(ary, FIX2LONG(arg)); } /* check if idx is Range */ switch (rb_range_beg_len(arg, &beg, &len, RARRAY(ary)->len, 0)) { case Qfalse: break; case Qnil: return Qnil; default: return rb_ary_subseq(ary, beg, len); } return rb_ary_entry(ary, NUM2LONG(arg)); } /* * call-seq: * array.at(index) -> obj or nil * * Returns the element at _index_. A * negative index counts from the end of _self_. Returns +nil+ * if the index is out of range. See also Array#[]. * (Array#at is slightly faster than Array#[], * as it does not accept ranges and so on.) * * a = [ "a", "b", "c", "d", "e" ] * a.at(0) #=> "a" * a.at(-1) #=> "e" */ static VALUE rb_ary_at(ary, pos) VALUE ary, pos; { return rb_ary_entry(ary, NUM2LONG(pos)); } /* * call-seq: * array.first -> obj or nil * array.first(n) -> an_array * * Returns the first element of the array. If the array is empty, * returns nil. * * a = [ "q", "r", "s", "t" ] * a.first #=> "q" * a.first(2) #=> ["q", "r"] */ static VALUE rb_ary_first(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { if (argc == 0) { if (RARRAY(ary)->len == 0) return Qnil; return RARRAY(ary)->ptr[0]; } else { return ary_shared_first(argc, argv, ary); } } /* * call-seq: * array.last -> obj or nil * array.last(n) -> an_array * * Returns the last element(s) of self. If the array is empty, * the first form returns nil. * * a = [ "w", "x", "y", "z" ] * a.last #=> "z" * a.last(2) #=> ["y", "z"] */ static VALUE rb_ary_last(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { if (argc == 0) { if (RARRAY(ary)->len == 0) return Qnil; return RARRAY(ary)->ptr[RARRAY(ary)->len-1]; } else { return ary_shared_last(argc, argv, ary); } } /* * call-seq: * array.fetch(index) -> obj * array.fetch(index, default ) -> obj * array.fetch(index) {|index| block } -> obj * * Tries to return the element at position index. If the index * lies outside the array, the first form throws an * IndexError exception, the second form returns * default, and the third form returns the value of invoking * the block, passing in the index. Negative values of index * count from the end of the array. * * a = [ 11, 22, 33, 44 ] * a.fetch(1) #=> 22 * a.fetch(-1) #=> 44 * a.fetch(4, 'cat') #=> "cat" * a.fetch(4) { |i| i*i } #=> 16 */ static VALUE rb_ary_fetch(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { VALUE pos, ifnone; long block_given; long idx; rb_scan_args(argc, argv, "11", &pos, &ifnone); block_given = rb_block_given_p(); if (block_given && argc == 2) { rb_warn("block supersedes default value argument"); } idx = NUM2LONG(pos); if (idx < 0) { idx += RARRAY(ary)->len; } if (idx < 0 || RARRAY(ary)->len <= idx) { if (block_given) return rb_yield(pos); if (argc == 1) { rb_raise(rb_eIndexError, "index %ld out of array", idx); } return ifnone; } return RARRAY(ary)->ptr[idx]; } /* * call-seq: * array.index(obj) -> int or nil * array.index {|item| block} -> int or nil * * Returns the index of the first object in self such that is * == to obj. If a block is given instead of an * argument, returns first object for which block is true. * Returns nil if no match is found. * * a = [ "a", "b", "c" ] * a.index("b") #=> 1 * a.index("z") #=> nil * a.index{|x|x=="b"} #=> 1 */ static VALUE rb_ary_index(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { VALUE val; long i; if (rb_scan_args(argc, argv, "01", &val) == 0) { for (i=0; ilen; i++) { if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) { return LONG2NUM(i); } } } else { for (i=0; ilen; i++) { if (rb_equal(RARRAY(ary)->ptr[i], val)) return LONG2NUM(i); } } return Qnil; } /* * call-seq: * array.rindex(obj) -> int or nil * * Returns the index of the last object in array * == to obj. If a block is given instead of an * argument, returns first object for which block is * true. Returns nil if no match is found. * * a = [ "a", "b", "b", "b", "c" ] * a.rindex("b") #=> 3 * a.rindex("z") #=> nil * a.rindex{|x|x=="b"} #=> 3 */ static VALUE rb_ary_rindex(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { VALUE val; long i = RARRAY(ary)->len; if (rb_scan_args(argc, argv, "01", &val) == 0) { while (i--) { if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) return LONG2NUM(i); if (i > RARRAY(ary)->len) { i = RARRAY(ary)->len; } } } else { while (i--) { if (rb_equal(RARRAY(ary)->ptr[i], val)) return LONG2NUM(i); if (i > RARRAY(ary)->len) { i = RARRAY(ary)->len; } } } return Qnil; } VALUE rb_ary_to_ary(obj) VALUE obj; { if (TYPE(obj) == T_ARRAY) { return obj; } if (rb_respond_to(obj, rb_intern("to_ary"))) { return to_ary(obj); } return rb_ary_new3(1, obj); } static void rb_ary_splice(ary, beg, len, rpl) VALUE ary; long beg, len; VALUE rpl; { long rlen; if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len); if (beg < 0) { beg += RARRAY(ary)->len; if (beg < 0) { beg -= RARRAY(ary)->len; rb_raise(rb_eIndexError, "index %ld out of array", beg); } } if (beg + len > RARRAY(ary)->len) { len = RARRAY(ary)->len - beg; } if (rpl == Qundef) { rlen = 0; } else { rpl = rb_ary_to_ary(rpl); rlen = RARRAY(rpl)->len; } rb_ary_modify(ary); if (beg >= RARRAY(ary)->len) { len = beg + rlen; if (len >= RARRAY(ary)->aux.capa) { REALLOC_N(RARRAY(ary)->ptr, VALUE, len); RARRAY(ary)->aux.capa = len; } rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, beg - RARRAY(ary)->len); if (rlen > 0) { MEMCPY(RARRAY(ary)->ptr + beg, RARRAY(rpl)->ptr, VALUE, rlen); } RARRAY(ary)->len = len; } else { long alen; if (beg + len > RARRAY(ary)->len) { len = RARRAY(ary)->len - beg; } alen = RARRAY(ary)->len + rlen - len; if (alen >= RARRAY(ary)->aux.capa) { REALLOC_N(RARRAY(ary)->ptr, VALUE, alen); RARRAY(ary)->aux.capa = alen; } if (len != rlen) { MEMMOVE(RARRAY(ary)->ptr + beg + rlen, RARRAY(ary)->ptr + beg + len, VALUE, RARRAY(ary)->len - (beg + len)); RARRAY(ary)->len = alen; } if (rlen > 0) { MEMMOVE(RARRAY(ary)->ptr + beg, RARRAY(rpl)->ptr, VALUE, rlen); } } } /* * call-seq: * array[index] = obj -> obj * array[start, length] = obj or an_array or nil -> obj or an_array or nil * array[range] = obj or an_array or nil -> obj or an_array or nil * * Element Assignment---Sets the element at _index_, * or replaces a subarray starting at _start_ and * continuing for _length_ elements, or replaces a subarray * specified by _range_. If indices are greater than * the current capacity of the array, the array grows * automatically. A negative indices will count backward * from the end of the array. Inserts elements if _length_ is * zero. An +IndexError+ is raised if a negative index points * past the beginning of the array. See also * Array#push, and Array#unshift. * * a = Array.new * a[4] = "4"; #=> [nil, nil, nil, nil, "4"] * a[0, 3] = [ 'a', 'b', 'c' ] #=> ["a", "b", "c", nil, "4"] * a[1..2] = [ 1, 2 ] #=> ["a", 1, 2, nil, "4"] * a[0, 2] = "?" #=> ["?", 2, nil, "4"] * a[0..2] = "A" #=> ["A", "4"] * a[-1] = "Z" #=> ["A", "Z"] * a[1..-1] = nil #=> ["A", nil] * a[1..-1] = [] #=> ["A"] */ static VALUE rb_ary_aset(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { long offset, beg, len; if (argc == 3) { rb_ary_splice(ary, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]); return argv[2]; } if (argc != 2) { rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc); } if (FIXNUM_P(argv[0])) { offset = FIX2LONG(argv[0]); goto fixnum; } if (rb_range_beg_len(argv[0], &beg, &len, RARRAY(ary)->len, 1)) { /* check if idx is Range */ rb_ary_splice(ary, beg, len, argv[1]); return argv[1]; } offset = NUM2LONG(argv[0]); fixnum: rb_ary_store(ary, offset, argv[1]); return argv[1]; } /* * call-seq: * array.insert(index, obj...) -> array * * Inserts the given values before the element with the given index * (which may be negative). * * a = %w{ a b c d } * a.insert(2, 99) #=> ["a", "b", 99, "c", "d"] * a.insert(-2, 1, 2, 3) #=> ["a", "b", 99, "c", 1, 2, 3, "d"] */ static VALUE rb_ary_insert(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { long pos; if (argc < 1) { rb_raise(rb_eArgError, "wrong number of arguments (at least 1)"); } pos = NUM2LONG(argv[0]); if (pos == -1) { pos = RARRAY(ary)->len; } else if (pos < 0) { pos++; } if (argc == 1) return ary; rb_ary_splice(ary, pos, 0, rb_ary_new4(argc - 1, argv + 1)); return ary; } /* * call-seq: * array.each {|item| block } -> array * * Calls block once for each element in self, passing that * element as a parameter. * * a = [ "a", "b", "c" ] * a.each {|x| print x, " -- " } * * produces: * * a -- b -- c -- */ VALUE rb_ary_each(ary) VALUE ary; { long i; for (i=0; ilen; i++) { rb_yield(RARRAY(ary)->ptr[i]); } return ary; } /* * call-seq: * array.each_index {|index| block } -> array * * Same as Array#each, but passes the index of the element * instead of the element itself. * * a = [ "a", "b", "c" ] * a.each_index {|x| print x, " -- " } * * produces: * * 0 -- 1 -- 2 -- */ static VALUE rb_ary_each_index(ary) VALUE ary; { long i; for (i=0; ilen; i++) { rb_yield(LONG2NUM(i)); } return ary; } /* * call-seq: * array.reverse_each {|item| block } * * Same as Array#each, but traverses self in reverse * order. * * a = [ "a", "b", "c" ] * a.reverse_each {|x| print x, " " } * * produces: * * c b a */ static VALUE rb_ary_reverse_each(ary) VALUE ary; { long len = RARRAY(ary)->len; while (len--) { rb_yield(RARRAY(ary)->ptr[len]); if (RARRAY(ary)->len < len) { len = RARRAY(ary)->len; } } return ary; } /* * call-seq: * array.length -> int * * Returns the number of elements in self. May be zero. * * [ 1, 2, 3, 4, 5 ].length #=> 5 */ static VALUE rb_ary_length(ary) VALUE ary; { return LONG2NUM(RARRAY(ary)->len); } /* * call-seq: * array.empty? -> true or false * * Returns true if self array contains no elements. * * [].empty? #=> true */ static VALUE rb_ary_empty_p(ary) VALUE ary; { if (RARRAY(ary)->len == 0) return Qtrue; return Qfalse; } VALUE rb_ary_dup(ary) VALUE ary; { VALUE dup = rb_ary_new2(RARRAY(ary)->len); DUPSETUP(dup, ary); MEMCPY(RARRAY(dup)->ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len); RARRAY(dup)->len = RARRAY(ary)->len; return dup; } extern VALUE rb_output_fs; static VALUE recursive_join(ary, arg, recur) VALUE ary; VALUE *arg; int recur; { if (recur) { return rb_str_new2("[...]"); } return rb_ary_join(arg[0], arg[1]); } VALUE rb_ary_join(ary, sep) VALUE ary, sep; { long len = 1, i; int taint = Qfalse; VALUE result, tmp; if (RARRAY(ary)->len == 0) return rb_str_new(0, 0); if (OBJ_TAINTED(ary) || OBJ_TAINTED(sep)) taint = Qtrue; for (i=0; ilen; i++) { tmp = rb_check_string_type(RARRAY(ary)->ptr[i]); len += NIL_P(tmp) ? 10 : RSTRING(tmp)->len; } if (!NIL_P(sep)) { StringValue(sep); len += RSTRING(sep)->len * (RARRAY(ary)->len - 1); } result = rb_str_buf_new(len); for (i=0; ilen; i++) { tmp = RARRAY(ary)->ptr[i]; switch (TYPE(tmp)) { case T_STRING: break; case T_ARRAY: { VALUE args[2]; args[0] = tmp; args[1] = sep; tmp = rb_exec_recursive(recursive_join, ary, (VALUE)args); } break; default: tmp = rb_obj_as_string(tmp); } if (i > 0 && !NIL_P(sep)) rb_str_buf_append(result, sep); rb_str_buf_append(result, tmp); if (OBJ_TAINTED(tmp)) taint = Qtrue; } if (taint) OBJ_TAINT(result); return result; } /* * call-seq: * array.join(sep=$,) -> str * * Returns a string created by converting each element of the array to * a string, separated by sep. * * [ "a", "b", "c" ].join #=> "abc" * [ "a", "b", "c" ].join("-") #=> "a-b-c" */ static VALUE rb_ary_join_m(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { VALUE sep; rb_scan_args(argc, argv, "01", &sep); if (NIL_P(sep)) sep = rb_output_fs; return rb_ary_join(ary, sep); } /* * call-seq: * array.to_s -> string * * Returns _self_.join. * * [ "a", "e", "i", "o" ].to_s #=> "aeio" * */ VALUE rb_ary_to_s(ary) VALUE ary; { if (RARRAY(ary)->len == 0) return rb_str_new(0, 0); return rb_ary_join(ary, rb_output_fs); } static VALUE inspect_ary(ary, dummy, recur) VALUE ary; VALUE dummy; int recur; { int tainted = OBJ_TAINTED(ary); long i; VALUE s, str; if (recur) return rb_tainted_str_new2("[...]"); str = rb_str_buf_new2("["); for (i=0; ilen; i++) { s = rb_inspect(RARRAY(ary)->ptr[i]); if (OBJ_TAINTED(s)) tainted = Qtrue; if (i > 0) rb_str_buf_cat2(str, ", "); rb_str_buf_append(str, s); } rb_str_buf_cat2(str, "]"); if (tainted) OBJ_TAINT(str); return str; } /* * call-seq: * array.inspect -> string * * Create a printable version of array. */ static VALUE rb_ary_inspect(ary) VALUE ary; { if (RARRAY(ary)->len == 0) return rb_str_new2("[]"); return rb_exec_recursive(inspect_ary, ary, 0); } /* * call-seq: * array.to_a -> array * * Returns _self_. If called on a subclass of Array, converts * the receiver to an Array object. */ static VALUE rb_ary_to_a(ary) VALUE ary; { if (rb_obj_class(ary) != rb_cArray) { VALUE dup = rb_ary_new2(RARRAY(ary)->len); rb_ary_replace(dup, ary); return dup; } return ary; } /* * call-seq: * array.to_ary -> array * * Returns _self_. */ static VALUE rb_ary_to_ary_m(ary) VALUE ary; { return ary; } VALUE rb_ary_reverse(ary) VALUE ary; { VALUE *p1, *p2; VALUE tmp; rb_ary_modify(ary); if (RARRAY(ary)->len > 1) { p1 = RARRAY(ary)->ptr; p2 = p1 + RARRAY(ary)->len - 1; /* points last item */ while (p1 < p2) { tmp = *p1; *p1++ = *p2; *p2-- = tmp; } } return ary; } /* * call-seq: * array.reverse! -> array * * Reverses _self_ in place. * * a = [ "a", "b", "c" ] * a.reverse! #=> ["c", "b", "a"] * a #=> ["c", "b", "a"] */ static VALUE rb_ary_reverse_bang(ary) VALUE ary; { return rb_ary_reverse(ary); } /* * call-seq: * array.reverse -> an_array * * Returns a new array containing self's elements in reverse order. * * [ "a", "b", "c" ].reverse #=> ["c", "b", "a"] * [ 1 ].reverse #=> [1] */ static VALUE rb_ary_reverse_m(ary) VALUE ary; { return rb_ary_reverse(rb_ary_dup(ary)); } struct ary_sort_data { VALUE ary; VALUE *ptr; long len; }; static void ary_sort_check(data) struct ary_sort_data *data; { if (RARRAY(data->ary)->ptr != data->ptr || RARRAY(data->ary)->len != data->len) { rb_raise(rb_eRuntimeError, "array modified during sort"); } } static int sort_1(a, b, data) VALUE *a, *b; struct ary_sort_data *data; { VALUE retval = rb_yield_values(2, *a, *b); int n; n = rb_cmpint(retval, *a, *b); ary_sort_check(data); return n; } static int sort_2(ap, bp, data) VALUE *ap, *bp; struct ary_sort_data *data; { VALUE retval; VALUE a = *ap, b = *bp; int n; if (FIXNUM_P(a) && FIXNUM_P(b)) { if ((long)a > (long)b) return 1; if ((long)a < (long)b) return -1; return 0; } if (TYPE(a) == T_STRING && TYPE(b) == T_STRING) { return rb_str_cmp(a, b); } retval = rb_funcall(a, id_cmp, 1, b); n = rb_cmpint(retval, a, b); ary_sort_check(data); return n; } static VALUE sort_internal(ary) VALUE ary; { struct ary_sort_data data; data.ary = ary; data.ptr = RARRAY(ary)->ptr; data.len = RARRAY(ary)->len; qsort(RARRAY(ary)->ptr, RARRAY(ary)->len, sizeof(VALUE), rb_block_given_p()?sort_1:sort_2, &data); return ary; } static VALUE sort_unlock(ary) VALUE ary; { FL_UNSET(ary, ARY_TMPLOCK); return ary; } /* * call-seq: * array.sort! -> array * array.sort! {| a,b | block } -> array * * Sorts _self_. Comparisons for * the sort will be done using the <=> operator or using * an optional code block. The block implements a comparison between * a and b, returning -1, 0, or +1. See also * Enumerable#sort_by. * * a = [ "d", "a", "e", "c", "b" ] * a.sort #=> ["a", "b", "c", "d", "e"] * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"] */ VALUE rb_ary_sort_bang(ary) VALUE ary; { rb_ary_modify(ary); if (RARRAY(ary)->len > 1) { FL_SET(ary, ARY_TMPLOCK); /* prohibit modification during sort */ rb_ensure(sort_internal, ary, sort_unlock, ary); } return ary; } /* * call-seq: * array.sort -> an_array * array.sort {| a,b | block } -> an_array * * Returns a new array created by sorting self. Comparisons for * the sort will be done using the <=> operator or using * an optional code block. The block implements a comparison between * a and b, returning -1, 0, or +1. See also * Enumerable#sort_by. * * a = [ "d", "a", "e", "c", "b" ] * a.sort #=> ["a", "b", "c", "d", "e"] * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"] */ VALUE rb_ary_sort(ary) VALUE ary; { ary = rb_ary_dup(ary); rb_ary_sort_bang(ary); return ary; } /* * call-seq: * array.collect {|item| block } -> an_array * array.map {|item| block } -> an_array * * Invokes block once for each element of self. Creates a * new array containing the values returned by the block. * See also Enumerable#collect. * * a = [ "a", "b", "c", "d" ] * a.collect {|x| x + "!" } #=> ["a!", "b!", "c!", "d!"] * a #=> ["a", "b", "c", "d"] */ static VALUE rb_ary_collect(ary) VALUE ary; { long i; VALUE collect; if (!rb_block_given_p()) { return rb_ary_new4(RARRAY(ary)->len, RARRAY(ary)->ptr); } collect = rb_ary_new2(RARRAY(ary)->len); for (i = 0; i < RARRAY(ary)->len; i++) { rb_ary_push(collect, rb_yield(RARRAY(ary)->ptr[i])); } return collect; } /* * call-seq: * array.collect! {|item| block } -> array * array.map! {|item| block } -> array * * Invokes the block once for each element of _self_, replacing the * element with the value returned by _block_. * See also Enumerable#collect. * * a = [ "a", "b", "c", "d" ] * a.collect! {|x| x + "!" } * a #=> [ "a!", "b!", "c!", "d!" ] */ static VALUE rb_ary_collect_bang(ary) VALUE ary; { long i; rb_ary_modify(ary); for (i = 0; i < RARRAY(ary)->len; i++) { rb_ary_store(ary, i, rb_yield(RARRAY(ary)->ptr[i])); } return ary; } VALUE rb_get_values_at(obj, olen, argc, argv, func) VALUE obj; long olen; int argc; VALUE *argv; VALUE (*func) _((VALUE,long)); { VALUE result = rb_ary_new2(argc); long beg, len, i, j; for (i=0; i an_array * * Returns an array containing the elements in * _self_ corresponding to the given selector(s). The selectors * may be either integer indices or ranges. * See also Array#select. * * a = %w{ a b c d e f } * a.values_at(1, 3, 5) * a.values_at(1, 3, 5, 7) * a.values_at(-1, -3, -5, -7) * a.values_at(1..3, 2...5) */ static VALUE rb_ary_values_at(argc, argv, ary) int argc; VALUE *argv; VALUE ary; { return rb_get_values_at(ary, RARRAY(ary)->len, argc, argv, rb_ary_entry); } /* * call-seq: * array.select {|item| block } -> an_array * * Invokes the block passing in successive elements from array, * returning an array containing those elements for which the block * returns a true value (equivalent to Enumerable#select). * * a = %w{ a b c d e f } * a.select {|v| v =~ /[aeiou]/} #=> ["a", "e"] */ static VALUE rb_ary_select(ary) VALUE ary; { VALUE result; long i; result = rb_ary_new2(RARRAY(ary)->len); for (i = 0; i < RARRAY(ary)->len; i++) { if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) { rb_ary_push(result, rb_ary_elt(ary, i)); } } return result; } ---tokens--- '#' Comment.Preproc 'include' Comment.Preproc ' ' Text '' Comment.PreprocFile '\n' Comment.Preproc '#' Comment.Preproc 'include' Comment.Preproc ' ' Text '' Comment.PreprocFile '\n' Comment.Preproc '#' Comment.Preproc 'include' Comment.Preproc ' ' Text '' Comment.PreprocFile '\n' Comment.Preproc '#' Comment.Preproc 'include' Comment.Preproc ' ' Text '"codegen.h"' Comment.PreprocFile '\n' Comment.Preproc '#' Comment.Preproc 'include' Comment.Preproc ' ' Text '"symboltable.h"' Comment.PreprocFile '\n' Comment.Preproc '#' Comment.Preproc 'include' Comment.Preproc ' ' Text '"stringbuffer.h"' Comment.PreprocFile '\n' Comment.Preproc '\n' Text 'extern' Keyword ' ' Text 'void' Keyword.Type ' ' Text 'yyerror' Name '(' Punctuation 'char' Keyword.Type '*' Operator ' ' Text 'msg' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'stringBuffer' Name '*' Operator ' ' Text 'staticVariableBuffer' Name ';' Punctuation '\n' Text 'static' Keyword ' ' Text 'stringBuffer' Name '*' Operator ' ' Text 'classInitBuffer' Name ';' Punctuation '\n' Text 'static' Keyword ' ' Text 'stringBuffer' Name '*' Operator ' ' Text 'currentMethodBuffer' Name ';' Punctuation '\n' Text 'static' Keyword ' ' Text 'stringBuffer' Name '*' Operator ' ' Text 'finishedMethodsBuffer' Name ';' Punctuation '\n' Text 'static' Keyword ' ' Text 'stringBuffer' Name '*' Operator ' ' Text 'mainBuffer' Name ';' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'int' Keyword.Type ' ' Text 'currentMethodBufferIndex' Name ';' Punctuation '\n' Text 'static' Keyword ' ' Text 'int' Keyword.Type ' ' Text 'currentMethodStackSize' Name ';' Punctuation '\n' Text 'static' Keyword ' ' Text 'int' Keyword.Type ' ' Text 'currentMethodStackSizeMax' Name ';' Punctuation '\n' Text 'static' Keyword ' ' Text 'int' Keyword.Type ' ' Text 'currentMethodNumberOfLocals' Name ';' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'int' Keyword.Type ' ' Text 'classInitBufferIndex' Name ';' Punctuation '\n' Text 'static' Keyword ' ' Text 'int' Keyword.Type ' ' Text 'classInitStackSize' Name ';' Punctuation '\n' Text 'static' Keyword ' ' Text 'int' Keyword.Type ' ' Text 'classInitStackSizeMax' Name ';' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'int' Keyword.Type ' ' Text 'labelCounter' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text 'static' Keyword ' ' Text 'int' Keyword.Type ' ' Text 'global' Name ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ';' Punctuation '\n' Text '\n' Text 'char' Keyword.Type ' ' Text 'tempString' Name '[' Punctuation 'MAX_LENGTH_OF_COMMAND' Name ']' Punctuation ';' Punctuation '\n' Text '\n' Text 'extern' Keyword ' ' Text 'char' Keyword.Type '*' Operator ' ' Text 'className' Name ';' Punctuation ' ' Text '/* from minako-syntax.y */' Comment.Multiline '\n' Text '\n' Text '/* forward declarations */' Comment.Multiline '\n' Text 'static' Keyword ' ' Text 'void' Keyword.Type ' ' Text 'increaseStackby' Name '(' Punctuation 'int' Keyword.Type ' ' Text 'stackdiff' Name ')' Punctuation ';' Punctuation '\n' Text 'char' Keyword.Type ' ' Text 'convertType' Name.Function '(' Punctuation 'int' Keyword.Type ' ' Text 'type' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text 'void' Keyword.Type ' ' Text 'codegenInit' Name.Function '(' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'staticVariableBuffer' Name ' ' Text '=' Operator ' ' Text 'newStringBuffer' Name '(' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'classInitBuffer' Name ' ' Text '=' Operator ' ' Text 'newStringBuffer' Name '(' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'currentMethodBuffer' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text '\t' Text 'finishedMethodsBuffer' Name ' ' Text '=' Operator ' ' Text 'newStringBuffer' Name '(' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'mainBuffer' Name ' ' Text '=' Operator ' ' Text 'newStringBuffer' Name '(' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'mainBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '; ------- Header --------------------------------------------' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation ' \n\t' Text 'sprintf' Name '(' Punctuation 'tempString' Name ',' Punctuation ' ' Text '"' Literal.String '.class public synchronized %s' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'className' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'mainBuffer' Name ',' Punctuation ' ' Text 'tempString' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'mainBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '.super java/lang/Object' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'mainBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '; -----------------------------------------------------------' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'mainBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t\n\t' Text 'stringBufferAppend' Name '(' Punctuation 'finishedMethodsBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '; ------- Constructor ---------------------------------------' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'finishedMethodsBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '.method public ()V' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'finishedMethodsBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape '.limit stack 1' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'finishedMethodsBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape '.limit locals 1' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'finishedMethodsBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape 'aload_0' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'finishedMethodsBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape 'invokenonvirtual java/lang/Object/()V' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'finishedMethodsBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape 'return' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'finishedMethodsBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '.end method' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'finishedMethodsBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '; -----------------------------------------------------------' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'finishedMethodsBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'staticVariableBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '; ------- Class Variables -----------------------------------' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'classInitBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '; ------- Class Initializer ---------------------------------' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'classInitBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '.method static ()V' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'classInitBufferIndex' Name ' ' Text '=' Operator ' ' Text 'classInitBuffer' Name '-' Operator '>' Operator 'numberOfNextElement' Name ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'classInitBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape '.limit locals 0' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\n' Text '}' Punctuation '\n' Text '\n' Text 'void' Keyword.Type ' ' Text 'codegenAppendCommand' Name.Function '(' Punctuation 'char' Keyword.Type '*' Operator ' ' Text 'cmd' Name ',' Punctuation ' ' Text 'int' Keyword.Type ' ' Text 'stackdiff' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'char' Keyword.Type ' ' Text 'tempString' Name '[' Punctuation 'MAX_LENGTH_OF_COMMAND' Name ']' Punctuation ';' Punctuation '\n' Text '\t' Text 'sprintf' Name '(' Punctuation 'tempString' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape '%s' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'cmd' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'global' Name ')' Punctuation ' ' Text 'stringBufferAppend' Name '(' Punctuation 'classInitBuffer' Name ',' Punctuation ' ' Text 'tempString' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'else' Keyword ' ' Text 'stringBufferAppend' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text 'tempString' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'increaseStackby' Name '(' Punctuation 'stackdiff' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'void' Keyword.Type ' ' Text 'codegenInsertCommand' Name.Function '(' Punctuation 'int' Keyword.Type ' ' Text 'address' Name ',' Punctuation ' ' Text 'char' Keyword.Type '*' Operator ' ' Text 'cmd' Name ',' Punctuation ' ' Text 'int' Keyword.Type ' ' Text 'stackdiff' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'char' Keyword.Type ' ' Text 'tempString' Name '[' Punctuation 'MAX_LENGTH_OF_COMMAND' Name ']' Punctuation ';' Punctuation '\n' Text '\t' Text 'sprintf' Name '(' Punctuation 'tempString' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape '%s' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'cmd' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'global' Name ')' Punctuation ' ' Text 'stringBufferInsert' Name '(' Punctuation 'classInitBuffer' Name ',' Punctuation ' ' Text 'address' Name ',' Punctuation ' ' Text 'tempString' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'else' Keyword ' ' Text 'stringBufferInsert' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text 'address' Name ',' Punctuation ' ' Text 'tempString' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'increaseStackby' Name '(' Punctuation 'stackdiff' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'void' Keyword.Type ' ' Text 'codegenAppendLabel' Name.Function '(' Punctuation 'int' Keyword.Type ' ' Text 'label' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'char' Keyword.Type ' ' Text 'tempString' Name '[' Punctuation 'MAX_LENGTH_OF_COMMAND' Name ']' Punctuation ';' Punctuation '\n' Text '\t' Text 'sprintf' Name '(' Punctuation 'tempString' Name ',' Punctuation ' ' Text '"' Literal.String 'Label%d:' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'label' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'global' Name ')' Punctuation ' ' Text 'stringBufferAppend' Name '(' Punctuation 'classInitBuffer' Name ',' Punctuation ' ' Text 'tempString' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'else' Keyword ' ' Text 'stringBufferAppend' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text 'tempString' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'void' Keyword.Type ' ' Text 'codegenAddVariable' Name.Function '(' Punctuation 'char' Keyword.Type '*' Operator ' ' Text 'name' Name ',' Punctuation ' ' Text 'int' Keyword.Type ' ' Text 'type' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text '/*fprintf(stderr, "add variable %s(%d) global=%d ", name, convertType(type), global);*/' Comment.Multiline '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'global' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t\t' Text 'if' Keyword ' ' Text '(' Punctuation 'type' Name ' ' Text '=' Operator '=' Operator ' ' Text 'TYPE_INT' Name ')' Punctuation ' ' Text 'sprintf' Name '(' Punctuation 'tempString' Name ',' Punctuation ' ' Text '"' Literal.String '.field static %s %c' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'name' Name ',' Punctuation ' ' Text "'" Literal.String.Char 'I' Literal.String.Char "'" Literal.String.Char ')' Punctuation ';' Punctuation '\n' Text '\t\t' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'type' Name ' ' Text '=' Operator '=' Operator ' ' Text 'TYPE_FLOAT' Name ')' Punctuation ' ' Text 'sprintf' Name '(' Punctuation 'tempString' Name ',' Punctuation ' ' Text '"' Literal.String '.field static %s %c' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'name' Name ',' Punctuation ' ' Text "'" Literal.String.Char 'F' Literal.String.Char "'" Literal.String.Char ')' Punctuation ';' Punctuation '\n' Text '\t\t' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'type' Name ' ' Text '=' Operator '=' Operator ' ' Text 'TYPE_BOOLEAN' Name ')' Punctuation ' ' Text 'sprintf' Name '(' Punctuation 'tempString' Name ',' Punctuation ' ' Text '"' Literal.String '.field static %s %c' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'name' Name ',' Punctuation ' ' Text "'" Literal.String.Char 'Z' Literal.String.Char "'" Literal.String.Char ')' Punctuation ';' Punctuation '\n' Text '\t\t' Text 'else' Keyword ' ' Text 'yyerror' Name '(' Punctuation '"' Literal.String 'compiler-intern error in codegenAddGlobalVariable().' Literal.String '\\n' Literal.String.Escape '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t\t' Text 'stringBufferAppend' Name '(' Punctuation 'staticVariableBuffer' Name ',' Punctuation ' ' Text 'tempString' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'else' Keyword ' ' Text '{' Punctuation '\n' Text '\t\t' Text 'currentMethodNumberOfLocals' Name '+' Operator '+' Operator ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'int' Keyword.Type ' ' Text 'codegenGetNextLabel' Name.Function '(' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'labelCounter' Name '+' Operator '+' Operator ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'int' Keyword.Type ' ' Text 'codegenGetCurrentAddress' Name.Function '(' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'global' Name ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'classInitBuffer' Name '-' Operator '>' Operator 'numberOfNextElement' Name ';' Punctuation '\n' Text '\t' Text 'else' Keyword ' ' Text 'return' Keyword ' ' Text 'currentMethodBuffer' Name '-' Operator '>' Operator 'numberOfNextElement' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'void' Keyword.Type ' ' Text 'codegenEnterFunction' Name.Function '(' Punctuation 'symtabEntry' Name '*' Operator ' ' Text 'entry' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'currentMethodBuffer' Name ' ' Text '=' Operator ' ' Text 'newStringBuffer' Name '(' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'currentMethodStackSize' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text '\t' Text 'currentMethodStackSizeMax' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text '\t' Text 'labelCounter' Name ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ';' Punctuation '\n' Text '\t' Text 'global' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text '\t\n\t' Text 'if' Keyword ' ' Text '(' Punctuation 'strcmp' Name '(' Punctuation 'entry' Name '-' Operator '>' Operator 'name' Name ',' Punctuation ' ' Text '"' Literal.String 'main' Literal.String '"' Literal.String ')' Punctuation ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t\t' Text 'if' Keyword ' ' Text '(' Punctuation 'entry' Name '-' Operator '>' Operator 'idtype' Name ' ' Text '!' Operator '=' Operator ' ' Text 'TYPE_VOID' Name ')' Punctuation ' ' Text 'yyerror' Name '(' Punctuation '"' Literal.String 'main has to be void.' Literal.String '\\n' Literal.String.Escape '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t\t' Text 'currentMethodNumberOfLocals' Name ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ';' Punctuation '\n' Text '\t\t' Text 'symtabInsert' Name '(' Punctuation 'strdup' Name '(' Punctuation '"' Literal.String '#main-param#' Literal.String '"' Literal.String ')' Punctuation ',' Punctuation ' ' Text 'TYPE_VOID' Name ',' Punctuation ' ' Text 'CLASS_FUNC' Name ')' Punctuation ';' Punctuation '\n' Text '\t\t' Text 'stringBufferAppend' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '; ------- Methode ---- void main() --------------------------' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t\t' Text 'stringBufferAppend' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '.method public static main([Ljava/lang/String;)V' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'else' Keyword ' ' Text '{' Punctuation '\n' Text '\t\t' Text 'int' Keyword.Type ' ' Text 'i' Name ';' Punctuation '\n' Text '\t\t' Text 'currentMethodNumberOfLocals' Name ' ' Text '=' Operator ' ' Text 'entry' Name '-' Operator '>' Operator 'paramIndex' Name ';' Punctuation '\n' Text '\t\t' Text 'stringBufferAppend' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '; ------- Methode -------------------------------------------' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t\t' Text 'sprintf' Name '(' Punctuation 'tempString' Name ',' Punctuation ' ' Text '"' Literal.String '.method public static %s(' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'entry' Name '-' Operator '>' Operator 'name' Name ')' Punctuation ';' Punctuation '\n' Text '\t\t' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name '=' Operator 'entry' Name '-' Operator '>' Operator 'paramIndex' Name '-1' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '>' Operator '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '-' Operator '-' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t\t\t' Text 'int' Keyword.Type ' ' Text 'type' Name ' ' Text '=' Operator ' ' Text 'entry' Name '-' Operator '>' Operator 'params' Name '[' Punctuation 'i' Name ']' Punctuation '-' Operator '>' Operator 'idtype' Name ';' Punctuation '\n' Text '\t\t\t' Text 'tempString' Name '[' Punctuation 'strlen' Name '(' Punctuation 'tempString' Name ')' Punctuation '+' Operator '1' Literal.Number.Integer ']' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text '\t\t\t' Text 'tempString' Name '[' Punctuation 'strlen' Name '(' Punctuation 'tempString' Name ')' Punctuation ']' Punctuation ' ' Text '=' Operator ' ' Text 'convertType' Name '(' Punctuation 'type' Name ')' Punctuation ';' Punctuation '\n' Text '\t\t' Text '}' Punctuation '\n' Text '\t\t' Text 'tempString' Name '[' Punctuation 'strlen' Name '(' Punctuation 'tempString' Name ')' Punctuation '+' Operator '2' Literal.Number.Integer ']' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text '\t\t' Text 'tempString' Name '[' Punctuation 'strlen' Name '(' Punctuation 'tempString' Name ')' Punctuation '+' Operator '1' Literal.Number.Integer ']' Punctuation ' ' Text '=' Operator ' ' Text 'convertType' Name '(' Punctuation 'entry' Name '-' Operator '>' Operator 'idtype' Name ')' Punctuation ';' Punctuation '\n' Text '\t\t' Text 'tempString' Name '[' Punctuation 'strlen' Name '(' Punctuation 'tempString' Name ')' Punctuation ']' Punctuation ' ' Text '=' Operator ' ' Text "'" Literal.String.Char ')' Literal.String.Char "'" Literal.String.Char ';' Punctuation '\n' Text '\t\t' Text 'stringBufferAppend' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text 'tempString' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'currentMethodBufferIndex' Name ' ' Text '=' Operator ' ' Text 'currentMethodBuffer' Name '-' Operator '>' Operator 'numberOfNextElement' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'void' Keyword.Type ' ' Text 'codegenLeaveFunction' Name.Function '(' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'global' Name ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ';' Punctuation '\n' Text '\t' Text 'sprintf' Name '(' Punctuation 'tempString' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape '.limit locals %d' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'currentMethodNumberOfLocals' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferInsert' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text 'currentMethodBufferIndex' Name ',' Punctuation ' ' Text 'tempString' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'sprintf' Name '(' Punctuation 'tempString' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape '.limit stack %d' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'currentMethodStackSizeMax' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferInsert' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text 'currentMethodBufferIndex' Name ',' Punctuation ' ' Text 'tempString' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape 'return' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '.end method' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '; -----------------------------------------------------------' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'currentMethodBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\n' Text '\t' Text 'stringBufferConcatenate' Name '(' Punctuation 'finishedMethodsBuffer' Name ',' Punctuation ' ' Text 'currentMethodBuffer' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '\n' Text '\n' Text 'void' Keyword.Type ' ' Text 'codegenFinishCode' Name.Function '(' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'staticVariableBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '; -----------------------------------------------------------' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'staticVariableBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\n' Text '\t' Text 'sprintf' Name '(' Punctuation 'tempString' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape '.limit stack %d' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'classInitStackSizeMax' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferInsert' Name '(' Punctuation 'classInitBuffer' Name ',' Punctuation ' ' Text 'classInitBufferIndex' Name ',' Punctuation ' ' Text 'tempString' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'classInitBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '\\t' Literal.String.Escape 'return' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'classInitBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '.end method' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferAppend' Name '(' Punctuation 'classInitBuffer' Name ',' Punctuation ' ' Text '"' Literal.String '; -----------------------------------------------------------' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t\n\t' Text 'stringBufferConcatenate' Name '(' Punctuation 'mainBuffer' Name ',' Punctuation ' ' Text 'staticVariableBuffer' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferConcatenate' Name '(' Punctuation 'mainBuffer' Name ',' Punctuation ' ' Text 'finishedMethodsBuffer' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'stringBufferConcatenate' Name '(' Punctuation 'mainBuffer' Name ',' Punctuation ' ' Text 'classInitBuffer' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text '\t' Text 'stringBufferPrint' Name '(' Punctuation 'mainBuffer' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'void' Keyword.Type ' ' Text 'increaseStackby' Name '(' Punctuation 'int' Keyword.Type ' ' Text 'stackdiff' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'global' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t\t' Text 'classInitStackSize' Name ' ' Text '+' Operator '=' Operator ' ' Text 'stackdiff' Name ';' Punctuation '\n' Text '\t\t' Text 'if' Keyword ' ' Text '(' Punctuation 'classInitStackSize' Name ' ' Text '>' Operator ' ' Text 'classInitStackSizeMax' Name ')' Punctuation ' ' Text 'classInitStackSizeMax' Name ' ' Text '=' Operator ' ' Text 'classInitStackSize' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'else' Keyword ' ' Text '{' Punctuation '\n' Text '\t\t' Text 'currentMethodStackSize' Name ' ' Text '+' Operator '=' Operator ' ' Text 'stackdiff' Name ';' Punctuation '\n' Text '\t\t' Text 'if' Keyword ' ' Text '(' Punctuation 'currentMethodStackSize' Name ' ' Text '>' Operator ' ' Text 'currentMethodStackSizeMax' Name ')' Punctuation ' ' Text 'currentMethodStackSizeMax' Name ' ' Text '=' Operator ' ' Text 'currentMethodStackSize' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'char' Keyword.Type ' ' Text 'convertType' Name '(' Punctuation 'int' Keyword.Type ' ' Text 'type' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'switch' Keyword '(' Punctuation 'type' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t\t' Text 'case' Keyword ' ' Text 'TYPE_VOID' Name.Label ':' Punctuation ' ' Text 'return' Keyword ' ' Text "'" Literal.String.Char 'V' Literal.String.Char "'" Literal.String.Char ';' Punctuation '\n' Text '\t\t' Text 'case' Keyword ' ' Text 'TYPE_INT' Name.Label ':' Punctuation ' ' Text 'return' Keyword ' ' Text "'" Literal.String.Char 'I' Literal.String.Char "'" Literal.String.Char ';' Punctuation '\n' Text '\t\t' Text 'case' Keyword ' ' Text 'TYPE_FLOAT' Name.Label ':' Punctuation ' ' Text 'return' Keyword ' ' Text "'" Literal.String.Char 'F' Literal.String.Char "'" Literal.String.Char ';' Punctuation '\n' Text '\t\t' Text 'case' Keyword ' ' Text 'TYPE_BOOLEAN' Name.Label ':' Punctuation ' ' Text 'return' Keyword ' ' Text "'" Literal.String.Char 'Z' Literal.String.Char "'" Literal.String.Char ';' Punctuation '\n' Text '\t\t' Text 'default' Keyword ' ' Text ':' Operator ' ' Text 'yyerror' Name '(' Punctuation '"' Literal.String 'compiler-intern error in convertType().' Literal.String '\\n' Literal.String.Escape '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text '0' Literal.Number.Integer ';' Punctuation ' ' Text '/* to avoid compiler-warning */' Comment.Multiline '\n' Text '}' Punctuation '\n' Text '\n' Text '\n' Text '//#include \n' Comment.Single '//#include \n' Comment.Single '\n' Text 'int' Keyword.Type ' ' Text 'main' Name '(' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'int' Keyword.Type ' ' Text 'a' Name ' ' Text '=' Operator ' ' Text '12' Literal.Number.Integer ',' Punctuation ' ' Text 'b' Name ' ' Text '=' Operator ' ' Text '44' Literal.Number.Integer ';' Punctuation '\n' Text '\t' Text 'while' Keyword ' ' Text '(' Punctuation 'a' Name ' ' Text '!' Operator '=' Operator ' ' Text 'b' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t\t' Text 'if' Keyword ' ' Text '(' Punctuation 'a' Name ' ' Text '>' Operator ' ' Text 'b' Name ')' Punctuation '\n' Text '\t\t\t' Text 'a' Name ' ' Text '-' Operator '=' Operator ' ' Text 'b' Name ';' Punctuation '\n' Text '\t\t' Text 'else' Keyword '\n' Text '\t\t\t' Text 'b' Name ' ' Text '-' Operator '=' Operator ' ' Text 'a' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'printf' Name '(' Punctuation '"' Literal.String '%d' Literal.String '\\n' Literal.String.Escape '%d' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'a' Name ',' Punctuation ' ' Text '0X0' Literal.Number.Hex ')' Punctuation ';' Punctuation '\\\n' Text '}' Punctuation '\n' Text '\n' Text '\n' Text '/**********************************************************************\n\n array.c -\n\n $Author: murphy $\n $Date: 2005-11-05 04:33:55 +0100 (Sa, 05 Nov 2005) $\n created at: Fri Aug 6 09:46:12 JST 1993\n\n Copyright (C) 1993-2003 Yukihiro Matsumoto\n Copyright (C) 2000 Network Applied Communication Laboratory, Inc.\n Copyright (C) 2000 Information-technology Promotion Agency, Japan\n\n**********************************************************************/' Comment.Multiline '\n' Text '\n' Text '#' Comment.Preproc 'include' Comment.Preproc ' ' Text '"ruby.h"' Comment.PreprocFile '\n' Comment.Preproc '#' Comment.Preproc 'include' Comment.Preproc ' ' Text '"util.h"' Comment.PreprocFile '\n' Comment.Preproc '#' Comment.Preproc 'include' Comment.Preproc ' ' Text '"st.h"' Comment.PreprocFile '\n' Comment.Preproc '#' Comment.Preproc 'include' Comment.Preproc ' ' Text '"node.h"' Comment.PreprocFile '\n' Comment.Preproc '\n' Text 'VALUE' Name ' ' Text 'rb_cArray' Name ',' Punctuation ' ' Text 'rb_cValues' Name ';' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'ID' Name ' ' Text 'id_cmp' Name ';' Punctuation '\n' Text '\n' Text '#' Comment.Preproc 'define ARY_DEFAULT_SIZE 16' Comment.Preproc '\n' Comment.Preproc '\n' Text '\n' Text 'void' Keyword.Type '\n' Text 'rb_mem_clear' Name.Function '(' Punctuation 'mem' Name ',' Punctuation ' ' Text 'size' Name ')' Punctuation '\n' Text ' ' Text 'register' Keyword ' ' Text 'VALUE' Name ' ' Text '*' Operator 'mem' Name ';' Punctuation '\n' Text ' ' Text 'register' Keyword ' ' Text 'long' Keyword.Type ' ' Text 'size' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '(' Punctuation 'size' Name '-' Operator '-' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text '*' Operator 'mem' Name '+' Operator '+' Operator ' ' Text '=' Operator ' ' Text 'Qnil' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'inline' Keyword.Reserved ' ' Text 'void' Keyword.Type '\n' Text 'memfill' Name '(' Punctuation 'mem' Name ',' Punctuation ' ' Text 'size' Name ',' Punctuation ' ' Text 'val' Name ')' Punctuation '\n' Text ' ' Text 'register' Keyword ' ' Text 'VALUE' Name ' ' Text '*' Operator 'mem' Name ';' Punctuation '\n' Text ' ' Text 'register' Keyword ' ' Text 'long' Keyword.Type ' ' Text 'size' Name ';' Punctuation '\n' Text ' ' Text 'register' Keyword ' ' Text 'VALUE' Name ' ' Text 'val' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '(' Punctuation 'size' Name '-' Operator '-' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text '*' Operator 'mem' Name '+' Operator '+' Operator ' ' Text '=' Operator ' ' Text 'val' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '#' Comment.Preproc 'define ARY_TMPLOCK FL_USER1' Comment.Preproc '\n' Comment.Preproc '\n' Text 'static' Keyword ' ' Text 'inline' Keyword.Reserved ' ' Text 'void' Keyword.Type '\n' Text 'rb_ary_modify_check' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'OBJ_FROZEN' Name '(' Punctuation 'ary' Name ')' Punctuation ')' Punctuation ' ' Text 'rb_error_frozen' Name '(' Punctuation '"' Literal.String 'array' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'FL_TEST' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'ARY_TMPLOCK' Name ')' Punctuation ')' Punctuation '\n' Text '\t' Text 'rb_raise' Name '(' Punctuation 'rb_eRuntimeError' Name ',' Punctuation ' ' Text '"' Literal.String "can't modify array during iteration" Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation '!' Operator 'OBJ_TAINTED' Name '(' Punctuation 'ary' Name ')' Punctuation ' ' Text '&' Operator '&' Operator ' ' Text 'rb_safe_level' Name '(' Punctuation ')' Punctuation ' ' Text '>' Operator '=' Operator ' ' Text '4' Literal.Number.Integer ')' Punctuation '\n' Text '\t' Text 'rb_raise' Name '(' Punctuation 'rb_eSecurityError' Name ',' Punctuation ' ' Text '"' Literal.String "Insecure: can't modify array" Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'void' Keyword.Type '\n' Text 'rb_ary_modify' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'ptr' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'rb_ary_modify_check' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'FL_TEST' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'ELTS_SHARED' Name ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'ptr' Name ' ' Text '=' Operator ' ' Text 'ALLOC_N' Name '(' Punctuation 'VALUE' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'FL_UNSET' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'ELTS_SHARED' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text '\t' Text 'MEMCPY' Name '(' Punctuation 'ptr' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '=' Operator ' ' Text 'ptr' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_freeze' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_obj_freeze' Name.Function '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.frozen? -> true or false\n *\n * Return true if this array is frozen (or temporarily frozen\n * while being sorted).\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_frozen_p' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'OBJ_FROZEN' Name '(' Punctuation 'ary' Name ')' Punctuation ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'Qtrue' Name ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'FL_TEST' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'ARY_TMPLOCK' Name ')' Punctuation ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'Qtrue' Name ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'Qfalse' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name ' ' Text 'ary_alloc' Name '(' Punctuation 'VALUE' Name ')' Punctuation ';' Punctuation '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'ary_alloc' Name '(' Punctuation 'klass' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'klass' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'NEWOBJ' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'struct' Keyword ' ' Text 'RArray' Name.Class ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'OBJSETUP' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'klass' Name ',' Punctuation ' ' Text 'T_ARRAY' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'ary' Name '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text ' ' Text 'ary' Name '-' Operator '>' Operator 'ptr' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text ' ' Text 'ary' Name '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text '\n' Text ' ' Text 'return' Keyword ' ' Text '(' Punctuation 'VALUE' Name ')' Punctuation 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'ary_new' Name '(' Punctuation 'klass' Name ',' Punctuation ' ' Text 'len' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'klass' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'len' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'len' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_raise' Name '(' Punctuation 'rb_eArgError' Name ',' Punctuation ' ' Text '"' Literal.String 'negative array size (or size too big)' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'len' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text '&' Operator '&' Operator ' ' Text 'len' Name ' ' Text '*' Operator ' ' Text 'sizeof' Keyword '(' Punctuation 'VALUE' Name ')' Punctuation ' ' Text '<' Operator '=' Operator ' ' Text 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_raise' Name '(' Punctuation 'rb_eArgError' Name ',' Punctuation ' ' Text '"' Literal.String 'array size too big' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'len' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'len' Name '+' Operator '+' Operator ';' Punctuation '\n' Text ' \n ' Text 'ary' Name ' ' Text '=' Operator ' ' Text 'ary_alloc' Name '(' Punctuation 'klass' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '=' Operator ' ' Text 'ALLOC_N' Name '(' Punctuation 'VALUE' Name ',' Punctuation ' ' Text 'len' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '=' Operator ' ' Text 'len' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_new2' Name '(' Punctuation 'len' Name ')' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'len' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary_new' Name.Function '(' Punctuation 'rb_cArray' Name ',' Punctuation ' ' Text 'len' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_new' Name '(' Punctuation ')' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_ary_new2' Name.Function '(' Punctuation 'ARY_DEFAULT_SIZE' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '#' Comment.Preproc 'ifdef HAVE_STDARG_PROTOTYPES' Comment.Preproc '\n' Comment.Preproc '#' Comment.Preproc 'include' Comment.Preproc ' ' Text '' Comment.PreprocFile '\n' Comment.Preproc '#' Comment.Preproc 'define va_init_list(a,b) va_start(a,b)' Comment.Preproc '\n' Comment.Preproc '#' Comment.Preproc 'else' Comment.Preproc '\n' Comment.Preproc '#' Comment.Preproc 'include' Comment.Preproc ' ' Text '' Comment.PreprocFile '\n' Comment.Preproc '#' Comment.Preproc 'define va_init_list(a,b) va_start(a)' Comment.Preproc '\n' Comment.Preproc '#' Comment.Preproc 'endif' Comment.Preproc '\n' Comment.Preproc '\n' Text 'VALUE' Name '\n' Text '#' Comment.Preproc 'ifdef HAVE_STDARG_PROTOTYPES' Comment.Preproc '\n' Comment.Preproc 'rb_ary_new3' Name '(' Punctuation 'long' Keyword.Type ' ' Text 'n' Name ',' Punctuation ' ' Text '.' Punctuation '.' Punctuation '.' Punctuation ')' Punctuation '\n' Text '#' Comment.Preproc 'else' Comment.Preproc '\n' Comment.Preproc 'rb_ary_new3' Name '(' Punctuation 'n' Name ',' Punctuation ' ' Text 'va_alist' Name ')' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'n' Name ';' Punctuation '\n' Text ' ' Text 'va_dcl' Name '\n' Text '#' Comment.Preproc 'endif' Comment.Preproc '\n' Comment.Preproc '{' Punctuation '\n' Text ' ' Text 'va_list' Keyword.Type ' ' Text 'ar' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'i' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'ary' Name ' ' Text '=' Operator ' ' Text 'rb_ary_new2' Name '(' Punctuation 'n' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'va_init_list' Name '(' Punctuation 'ar' Name ',' Punctuation ' ' Text 'n' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '<' Operator 'n' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '=' Operator ' ' Text 'va_arg' Name '(' Punctuation 'ar' Name ',' Punctuation ' ' Text 'VALUE' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'va_end' Name '(' Punctuation 'ar' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'n' Name ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_new4' Name '(' Punctuation 'n' Name ',' Punctuation ' ' Text 'elts' Name ')' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'n' Name ';' Punctuation '\n' Text ' ' Text 'const' Keyword ' ' Text 'VALUE' Name ' ' Text '*' Operator 'elts' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'ary' Name ' ' Text '=' Operator ' ' Text 'rb_ary_new2' Name '(' Punctuation 'n' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'n' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text '&' Operator '&' Operator ' ' Text 'elts' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'MEMCPY' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'elts' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'n' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'n' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text '#' Comment.Preproc 'ifdef HAVE_STDARG_PROTOTYPES' Comment.Preproc '\n' Comment.Preproc 'rb_values_new' Name '(' Punctuation 'long' Keyword.Type ' ' Text 'n' Name ',' Punctuation ' ' Text '.' Punctuation '.' Punctuation '.' Punctuation ')' Punctuation '\n' Text '#' Comment.Preproc 'else' Comment.Preproc '\n' Comment.Preproc 'rb_values_new' Name '(' Punctuation 'n' Name ',' Punctuation ' ' Text 'va_alist' Name ')' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'n' Name ';' Punctuation '\n' Text ' ' Text 'va_dcl' Name '\n' Text '#' Comment.Preproc 'endif' Comment.Preproc '\n' Comment.Preproc '{' Punctuation '\n' Text ' ' Text 'va_list' Keyword.Type ' ' Text 'ar' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'val' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'i' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'val' Name ' ' Text '=' Operator ' ' Text 'ary_new' Name '(' Punctuation 'rb_cValues' Name ',' Punctuation ' ' Text 'n' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'va_init_list' Name '(' Punctuation 'ar' Name ',' Punctuation ' ' Text 'n' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '<' Operator 'n' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'val' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '=' Operator ' ' Text 'va_arg' Name '(' Punctuation 'ar' Name ',' Punctuation ' ' Text 'VALUE' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'va_end' Name '(' Punctuation 'ar' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'val' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'n' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'return' Keyword ' ' Text 'val' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_values_new2' Name '(' Punctuation 'n' Name ',' Punctuation ' ' Text 'elts' Name ')' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'n' Name ';' Punctuation '\n' Text ' ' Text 'const' Keyword ' ' Text 'VALUE' Name ' ' Text '*' Operator 'elts' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'val' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'val' Name ' ' Text '=' Operator ' ' Text 'ary_new' Name '(' Punctuation 'rb_cValues' Name ',' Punctuation ' ' Text 'n' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'n' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text '&' Operator '&' Operator ' ' Text 'elts' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'val' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'n' Name ';' Punctuation '\n' Text '\t' Text 'MEMCPY' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'val' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'elts' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'n' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'return' Keyword ' ' Text 'val' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'ary_make_shared' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation '!' Operator 'FL_TEST' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'ELTS_SHARED' Name ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'NEWOBJ' Name '(' Punctuation 'shared' Name ',' Punctuation ' ' Text 'struct' Keyword ' ' Text 'RArray' Name.Class ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'OBJSETUP' Name '(' Punctuation 'shared' Name ',' Punctuation ' ' Text 'rb_cArray' Name ',' Punctuation ' ' Text 'T_ARRAY' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text '\t' Text 'shared' Name '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text '\t' Text 'shared' Name '-' Operator '>' Operator 'ptr' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ';' Punctuation '\n' Text '\t' Text 'shared' Name '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ';' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'shared' Name ' ' Text '=' Operator ' ' Text '(' Punctuation 'VALUE' Name ')' Punctuation 'shared' Name ';' Punctuation '\n' Text '\t' Text 'FL_SET' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'ELTS_SHARED' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'OBJ_FREEZE' Name '(' Punctuation 'shared' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text '(' Punctuation 'VALUE' Name ')' Punctuation 'shared' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'else' Keyword ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'RARRAY' Name.Function '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'shared' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'ary_shared_array' Name '(' Punctuation 'klass' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'klass' Name ',' Punctuation ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'val' Name ' ' Text '=' Operator ' ' Text 'ary_alloc' Name '(' Punctuation 'klass' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'ary_make_shared' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'val' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'val' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'val' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'shared' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'shared' Name ';' Punctuation '\n' Text ' ' Text 'FL_SET' Name '(' Punctuation 'val' Name ',' Punctuation ' ' Text 'ELTS_SHARED' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'val' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_values_from_ary' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary_shared_array' Name.Function '(' Punctuation 'rb_cValues' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_from_values' Name '(' Punctuation 'val' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'val' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary_shared_array' Name.Function '(' Punctuation 'rb_cArray' Name ',' Punctuation ' ' Text 'val' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_assoc_new' Name '(' Punctuation 'car' Name ',' Punctuation ' ' Text 'cdr' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'car' Name ',' Punctuation ' ' Text 'cdr' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_values_new' Name.Function '(' Punctuation '2' Literal.Number.Integer ',' Punctuation ' ' Text 'car' Name ',' Punctuation ' ' Text 'cdr' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'to_ary' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_convert_type' Name.Function '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'T_ARRAY' Name ',' Punctuation ' ' Text '"' Literal.String 'Array' Literal.String '"' Literal.String ',' Punctuation ' ' Text '"' Literal.String 'to_ary' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'to_a' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_convert_type' Name.Function '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'T_ARRAY' Name ',' Punctuation ' ' Text '"' Literal.String 'Array' Literal.String '"' Literal.String ',' Punctuation ' ' Text '"' Literal.String 'to_a' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_check_array_type' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_check_convert_type' Name.Function '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'T_ARRAY' Name ',' Punctuation ' ' Text '"' Literal.String 'Array' Literal.String '"' Literal.String ',' Punctuation ' ' Text '"' Literal.String 'to_ary' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name ' ' Text 'rb_ary_replace' Name ' ' Text '_' Name '(' Punctuation '(' Punctuation 'VALUE' Name ',' Punctuation ' ' Text 'VALUE' Name ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * Array.new(size=0, obj=nil)\n * Array.new(array)\n * Array.new(size) {|index| block }\n *\n * Returns a new array. In the first form, the new array is\n * empty. In the second it is created with _size_ copies of _obj_\n * (that is, _size_ references to the same\n * _obj_). The third form creates a copy of the array\n * passed as a parameter (the array is generated by calling\n * to_ary on the parameter). In the last form, an array\n * of the given size is created. Each element in this array is\n * calculated by passing the element\'s index to the given block and\n * storing the return value.\n *\n * Array.new\n * Array.new(2)\n * Array.new(5, "A")\n * \n * # only one copy of the object is created\n * a = Array.new(2, Hash.new)\n * a[0][\'cat\'] = \'feline\'\n * a\n * a[1][\'cat\'] = \'Felix\'\n * a\n * \n * # here multiple copies are created\n * a = Array.new(2) { Hash.new }\n * a[0][\'cat\'] = \'feline\'\n * a\n * \n * squares = Array.new(5) {|i| i*i}\n * squares\n * \n * copy = Array.new(squares)\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_initialize' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'len' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'size' Name ',' Punctuation ' ' Text 'val' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'rb_scan_args' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text '"' Literal.String '02' Literal.String '"' Literal.String ',' Punctuation ' ' Text '&' Operator 'size' Name ',' Punctuation ' ' Text '&' Operator 'val' Name ')' Punctuation ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'rb_block_given_p' Name '(' Punctuation ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'rb_warning' Name '(' Punctuation '"' Literal.String 'given block not used' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '=' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text '&' Operator '&' Operator ' ' Text '!' Operator 'FIXNUM_P' Name '(' Punctuation 'size' Name ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'val' Name ' ' Text '=' Operator ' ' Text 'rb_check_array_type' Name '(' Punctuation 'size' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation '!' Operator 'NIL_P' Name '(' Punctuation 'val' Name ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'rb_ary_replace' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'val' Name ')' Punctuation ';' Punctuation '\n' Text '\t ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'len' Name ' ' Text '=' Operator ' ' Text 'NUM2LONG' Name '(' Punctuation 'size' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'len' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_raise' Name '(' Punctuation 'rb_eArgError' Name ',' Punctuation ' ' Text '"' Literal.String 'negative array size' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'len' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text '&' Operator '&' Operator ' ' Text 'len' Name ' ' Text '*' Operator ' ' Text '(' Punctuation 'long' Keyword.Type ')' Punctuation 'sizeof' Keyword '(' Punctuation 'VALUE' Name ')' Punctuation ' ' Text '<' Operator '=' Operator ' ' Text 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_raise' Name '(' Punctuation 'rb_eArgError' Name ',' Punctuation ' ' Text '"' Literal.String 'array size too big' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'rb_ary_modify' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'len' Name ' ' Text '>' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'REALLOC_N' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'len' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '=' Operator ' ' Text 'len' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'rb_block_given_p' Name '(' Punctuation ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'long' Keyword.Type ' ' Text 'i' Name ';' Punctuation '\n' Text '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '=' Operator '=' Operator ' ' Text '2' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'rb_warn' Name '(' Punctuation '"' Literal.String 'block supersedes default value argument' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '<' Operator 'len' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'rb_ary_store' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'i' Name ',' Punctuation ' ' Text 'rb_yield' Name '(' Punctuation 'LONG2NUM' Name '(' Punctuation 'i' Name ')' Punctuation ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'i' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'else' Keyword ' ' Text '{' Punctuation '\n' Text '\t' Text 'memfill' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'len' Name ',' Punctuation ' ' Text 'val' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'len' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '\n' Text "/* \n* Returns a new array populated with the given objects. \n*\n* Array.[]( 1, 'a', /^A/ )\n* Array[ 1, 'a', /^A/ ]\n* [ 1, 'a', /^A/ ]\n*/" Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_s_create' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'klass' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'klass' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ' ' Text '=' Operator ' ' Text 'ary_alloc' Name '(' Punctuation 'klass' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '=' Operator ' ' Text 'ALLOC_N' Name '(' Punctuation 'VALUE' Name ',' Punctuation ' ' Text 'argc' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'MEMCPY' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'argc' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '=' Operator ' ' Text 'argc' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'void' Keyword.Type '\n' Text 'rb_ary_store' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'idx' Name ',' Punctuation ' ' Text 'val' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'idx' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'val' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'idx' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'idx' Name ' ' Text '+' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'idx' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'rb_raise' Name '(' Punctuation 'rb_eIndexError' Name ',' Punctuation ' ' Text '"' Literal.String 'index %ld out of array' Literal.String '"' Literal.String ',' Punctuation '\n' Text '\t\t ' Text 'idx' Name ' ' Text '-' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'rb_ary_modify' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'idx' Name ' ' Text '>' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'long' Keyword.Type ' ' Text 'new_capa' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '/' Operator ' ' Text '2' Literal.Number.Integer ';' Punctuation '\n' Text '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'new_capa' Name ' ' Text '<' Operator ' ' Text 'ARY_DEFAULT_SIZE' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'new_capa' Name ' ' Text '=' Operator ' ' Text 'ARY_DEFAULT_SIZE' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'new_capa' Name ' ' Text '+' Operator '=' Operator ' ' Text 'idx' Name ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'new_capa' Name ' ' Text '*' Operator ' ' Text '(' Punctuation 'long' Keyword.Type ')' Punctuation 'sizeof' Keyword '(' Punctuation 'VALUE' Name ')' Punctuation ' ' Text '<' Operator '=' Operator ' ' Text 'new_capa' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'rb_raise' Name '(' Punctuation 'rb_eArgError' Name ',' Punctuation ' ' Text '"' Literal.String 'index too big' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'REALLOC_N' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'new_capa' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '=' Operator ' ' Text 'new_capa' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'idx' Name ' ' Text '>' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_mem_clear' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '+' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ',' Punctuation '\n' Text '\t\t ' Text 'idx' Name '-' Operator 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'idx' Name ' ' Text '>' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'idx' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'idx' Name ']' Punctuation ' ' Text '=' Operator ' ' Text 'val' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'ary_shared_first' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'nv' Name ',' Punctuation ' ' Text 'result' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'n' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'rb_scan_args' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text '"' Literal.String '1' Literal.String '"' Literal.String ',' Punctuation ' ' Text '&' Operator 'nv' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text 'NUM2LONG' Name '(' Punctuation 'nv' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'n' Name ' ' Text '>' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'n' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'n' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_raise' Name '(' Punctuation 'rb_eArgError' Name ',' Punctuation ' ' Text '"' Literal.String 'negative array size' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'result' Name ' ' Text '=' Operator ' ' Text 'ary_shared_array' Name '(' Punctuation 'rb_cArray' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'result' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'n' Name ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'result' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'ary_shared_last' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'result' Name ' ' Text '=' Operator ' ' Text 'ary_shared_first' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'result' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '+' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '-' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'result' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'result' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array << obj -> array\n * \n * Append---Pushes the given object on to the end of this array. This\n * expression returns the array itself, so several appends\n * may be chained together.\n *\n * [ 1, 2 ] << "c" << "d" << [ 3, 4 ]\n * #=> [ 1, 2, "c", "d", [ 3, 4 ] ]\n *\n */' Comment.Multiline '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_push' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'item' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'item' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'rb_ary_store' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ',' Punctuation ' ' Text 'item' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/* \n * call-seq:\n * array.push(obj, ... ) -> array\n * \n * Append---Pushes the given object(s) on to the end of this array. This\n * expression returns the array itself, so several appends\n * may be chained together.\n *\n * a = [ "a", "b", "c" ]\n * a.push("d", "e", "f") \n * #=> ["a", "b", "c", "d", "e", "f"]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_push_m' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '(' Punctuation 'argc' Name '-' Operator '-' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_ary_push' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text '*' Operator 'argv' Name '+' Operator '+' Operator ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_pop' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'rb_ary_modify_check' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'Qnil' Name ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation '!' Operator 'FL_TEST' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'ELTS_SHARED' Name ')' Punctuation ' ' Text '&' Operator '&' Operator '\n' Text '\t ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '*' Operator ' ' Text '2' Literal.Number.Integer ' ' Text '<' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '&' Operator '&' Operator '\n' Text '\t ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '>' Operator ' ' Text 'ARY_DEFAULT_SIZE' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '*' Operator ' ' Text '2' Literal.Number.Integer ';' Punctuation '\n' Text '\t' Text 'REALLOC_N' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation '-' Operator '-' Operator 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ']' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.pop -> obj or nil\n * \n * Removes the last element from self and returns it, or\n * nil if the array is empty.\n * \n * a = [ "a", "b", "c", "d" ]\n * a.pop #=> "d"\n * a.pop(2) #=> ["b", "c"]\n * a #=> ["a"]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_pop_m' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'result' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'rb_ary_pop' Name.Function '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'rb_ary_modify_check' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'result' Name ' ' Text '=' Operator ' ' Text 'ary_shared_last' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '-' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'result' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'result' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_shift' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'top' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'rb_ary_modify_check' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'Qnil' Name ';' Punctuation '\n' Text ' ' Text 'top' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ';' Punctuation '\n' Text ' ' Text 'ary_make_shared' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '+' Operator '+' Operator ';' Punctuation '\t\t' Text '/* shift ptr */' Comment.Multiline '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name '-' Operator '-' Operator ';' Punctuation '\n' Text '\n' Text ' ' Text 'return' Keyword ' ' Text 'top' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.shift -> obj or nil\n * \n * Returns the first element of self and removes it (shifting all\n * other elements down by one). Returns nil if the array\n * is empty.\n * \n * args = [ "-m", "-q", "filename" ]\n * args.shift #=> "-m"\n * args #=> ["-q", "filename"]\n *\n * args = [ "-m", "-q", "filename" ]\n * args.shift(2) #=> ["-m", "-q"]\n * args #=> ["filename"]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_shift_m' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'result' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'n' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'rb_ary_shift' Name.Function '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'rb_ary_modify_check' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'result' Name ' ' Text '=' Operator ' ' Text 'ary_shared_first' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'result' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '+' Operator '=' Operator ' ' Text 'n' Name ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '-' Operator '=' Operator ' ' Text 'n' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'return' Keyword ' ' Text 'result' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_unshift' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'item' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ',' Punctuation ' ' Text 'item' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'rb_ary_modify' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'long' Keyword.Type ' ' Text 'capa_inc' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '/' Operator ' ' Text '2' Literal.Number.Integer ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'capa_inc' Name ' ' Text '<' Operator ' ' Text 'ARY_DEFAULT_SIZE' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'capa_inc' Name ' ' Text '=' Operator ' ' Text 'ARY_DEFAULT_SIZE' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '+' Operator '=' Operator ' ' Text 'capa_inc' Name ';' Punctuation '\n' Text '\t' Text 'REALLOC_N' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text '/* sliding items */' Comment.Multiline '\n' Text ' ' Text 'MEMMOVE' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name '+' Operator '+' Operator ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ' ' Text '=' Operator ' ' Text 'item' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.unshift(obj, ...) -> array\n * \n * Prepends objects to the front of array.\n * other elements up one.\n * \n * a = [ "b", "c", "d" ]\n * a.unshift("a") #=> ["a", "b", "c", "d"]\n * a.unshift(1, 2) #=> [ 1, 2, "a", "b", "c", "d"]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_unshift_m' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'len' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '\n' Text ' ' Text '/* make rooms by setting the last item */' Comment.Multiline '\n' Text ' ' Text 'rb_ary_store' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'len' Name ' ' Text '+' Operator ' ' Text 'argc' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer ',' Punctuation ' ' Text 'Qnil' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text '/* sliding items */' Comment.Multiline '\n' Text ' ' Text 'MEMMOVE' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '+' Operator ' ' Text 'argc' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'len' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'MEMCPY' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'argc' Name ')' Punctuation ';' Punctuation '\n' Text ' \n ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text "/* faster version - use this if you don't need to treat negative offset */" Comment.Multiline '\n' Text 'static' Keyword ' ' Text 'inline' Keyword.Reserved ' ' Text 'VALUE' Name '\n' Text 'rb_ary_elt' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'offset' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'offset' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'Qnil' Name ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'offset' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ' ' Text '|' Operator '|' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '<' Operator '=' Operator ' ' Text 'offset' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'Qnil' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'offset' Name ']' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_entry' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'offset' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'offset' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'offset' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'offset' Name ' ' Text '+' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_ary_elt' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'offset' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_subseq' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'beg' Name ',' Punctuation ' ' Text 'len' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'beg' Name ',' Punctuation ' ' Text 'len' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'klass' Name ',' Punctuation ' ' Text 'ary2' Name ',' Punctuation ' ' Text 'shared' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'ptr' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'beg' Name ' ' Text '>' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'Qnil' Name ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'beg' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ' ' Text '|' Operator '|' Operator ' ' Text 'len' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'Qnil' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'beg' Name ' ' Text '+' Operator ' ' Text 'len' Name ' ' Text '>' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'len' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '-' Operator ' ' Text 'beg' Name ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'len' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation '\n' Text '\t ' Text 'len' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'klass' Name ' ' Text '=' Operator ' ' Text 'rb_obj_class' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'len' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'ary_new' Name '(' Punctuation 'klass' Name ',' Punctuation ' ' Text '0' Literal.Number.Integer ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'shared' Name ' ' Text '=' Operator ' ' Text 'ary_make_shared' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'ptr' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ';' Punctuation '\n' Text ' ' Text 'ary2' Name ' ' Text '=' Operator ' ' Text 'ary_alloc' Name '(' Punctuation 'klass' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary2' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '=' Operator ' ' Text 'ptr' Name ' ' Text '+' Operator ' ' Text 'beg' Name ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary2' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'len' Name ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'ary2' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'shared' Name ' ' Text '=' Operator ' ' Text 'shared' Name ';' Punctuation '\n' Text ' ' Text 'FL_SET' Name '(' Punctuation 'ary2' Name ',' Punctuation ' ' Text 'ELTS_SHARED' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary2' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/* \n * call-seq:\n * array[index] -> obj or nil\n * array[start, length] -> an_array or nil\n * array[range] -> an_array or nil\n * array.slice(index) -> obj or nil\n * array.slice(start, length) -> an_array or nil\n * array.slice(range) -> an_array or nil\n *\n * Element Reference---Returns the element at _index_,\n * or returns a subarray starting at _start_ and\n * continuing for _length_ elements, or returns a subarray\n * specified by _range_.\n * Negative indices count backward from the end of the\n * array (-1 is the last element). Returns nil if the index\n * (or starting index) are out of range.\n *\n * a = [ "a", "b", "c", "d", "e" ]\n * a[2] + a[0] + a[1] #=> "cab"\n * a[6] #=> nil\n * a[1, 2] #=> [ "b", "c" ]\n * a[1..3] #=> [ "b", "c", "d" ]\n * a[4..7] #=> [ "e" ]\n * a[6..10] #=> nil\n * a[-3, 3] #=> [ "c", "d", "e" ]\n * # special cases\n * a[5] #=> nil\n * a[5, 1] #=> []\n * a[5..10] #=> []\n *\n */' Comment.Multiline '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_aref' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'arg' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'beg' Name ',' Punctuation ' ' Text 'len' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '=' Operator '=' Operator ' ' Text '2' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'beg' Name ' ' Text '=' Operator ' ' Text 'NUM2LONG' Name '(' Punctuation 'argv' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'len' Name ' ' Text '=' Operator ' ' Text 'NUM2LONG' Name '(' Punctuation 'argv' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'beg' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'beg' Name ' ' Text '+' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'rb_ary_subseq' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'beg' Name ',' Punctuation ' ' Text 'len' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '!' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_scan_args' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text '"' Literal.String '11' Literal.String '"' Literal.String ',' Punctuation ' ' Text '0' Literal.Number.Integer ',' Punctuation ' ' Text '0' Literal.Number.Integer ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'arg' Name ' ' Text '=' Operator ' ' Text 'argv' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ';' Punctuation '\n' Text ' ' Text '/* special case - speeding up */' Comment.Multiline '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'FIXNUM_P' Name '(' Punctuation 'arg' Name ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'rb_ary_entry' Name.Function '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'FIX2LONG' Name '(' Punctuation 'arg' Name ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text '/* check if idx is Range */' Comment.Multiline '\n' Text ' ' Text 'switch' Keyword ' ' Text '(' Punctuation 'rb_range_beg_len' Name '(' Punctuation 'arg' Name ',' Punctuation ' ' Text '&' Operator 'beg' Name ',' Punctuation ' ' Text '&' Operator 'len' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ',' Punctuation ' ' Text '0' Literal.Number.Integer ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text ' ' Text 'case' Keyword ' ' Text 'Qfalse' Name.Label ':' Punctuation '\n' Text '\t' Text 'break' Keyword ';' Punctuation '\n' Text ' ' Text 'case' Keyword ' ' Text 'Qnil' Name.Label ':' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'Qnil' Name ';' Punctuation '\n' Text ' ' Text 'default' Keyword ':' Operator '\n' Text '\t' Text 'return' Keyword ' ' Text 'rb_ary_subseq' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'beg' Name ',' Punctuation ' ' Text 'len' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_ary_entry' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'NUM2LONG' Name '(' Punctuation 'arg' Name ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/* \n * call-seq:\n * array.at(index) -> obj or nil\n *\n * Returns the element at _index_. A\n * negative index counts from the end of _self_. Returns +nil+\n * if the index is out of range. See also Array#[].\n * (Array#at is slightly faster than Array#[],\n * as it does not accept ranges and so on.)\n *\n * a = [ "a", "b", "c", "d", "e" ]\n * a.at(0) #=> "a"\n * a.at(-1) #=> "e"\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_at' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'pos' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ',' Punctuation ' ' Text 'pos' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_ary_entry' Name.Function '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'NUM2LONG' Name '(' Punctuation 'pos' Name ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.first -> obj or nil\n * array.first(n) -> an_array\n * \n * Returns the first element of the array. If the array is empty,\n * returns nil.\n * \n * a = [ "q", "r", "s", "t" ]\n * a.first #=> "q"\n * a.first(2) #=> ["q", "r"]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_first' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'Qnil' Name ';' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'RARRAY' Name.Function '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'else' Keyword ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'ary_shared_first' Name.Function '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.last -> obj or nil\n * array.last(n) -> an_array\n * \n * Returns the last element(s) of self. If the array is empty,\n * the first form returns nil.\n * \n * a = [ "w", "x", "y", "z" ]\n * a.last #=> "z"\n * a.last(2) #=> ["y", "z"]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_last' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'Qnil' Name ';' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'RARRAY' Name.Function '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name '-1' Literal.Number.Integer ']' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'else' Keyword ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'ary_shared_last' Name.Function '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.fetch(index) -> obj\n * array.fetch(index, default ) -> obj\n * array.fetch(index) {|index| block } -> obj\n * \n * Tries to return the element at position index. If the index\n * lies outside the array, the first form throws an\n * IndexError exception, the second form returns\n * default, and the third form returns the value of invoking\n * the block, passing in the index. Negative values of index\n * count from the end of the array.\n * \n * a = [ 11, 22, 33, 44 ]\n * a.fetch(1) #=> 22\n * a.fetch(-1) #=> 44\n * a.fetch(4, \'cat\') #=> "cat"\n * a.fetch(4) { |i| i*i } #=> 16\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_fetch' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'pos' Name ',' Punctuation ' ' Text 'ifnone' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'block_given' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'idx' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'rb_scan_args' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text '"' Literal.String '11' Literal.String '"' Literal.String ',' Punctuation ' ' Text '&' Operator 'pos' Name ',' Punctuation ' ' Text '&' Operator 'ifnone' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'block_given' Name ' ' Text '=' Operator ' ' Text 'rb_block_given_p' Name '(' Punctuation ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'block_given' Name ' ' Text '&' Operator '&' Operator ' ' Text 'argc' Name ' ' Text '=' Operator '=' Operator ' ' Text '2' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_warn' Name '(' Punctuation '"' Literal.String 'block supersedes default value argument' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'idx' Name ' ' Text '=' Operator ' ' Text 'NUM2LONG' Name '(' Punctuation 'pos' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'idx' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'idx' Name ' ' Text '+' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'idx' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ' ' Text '|' Operator '|' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '<' Operator '=' Operator ' ' Text 'idx' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'block_given' Name ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'rb_yield' Name '(' Punctuation 'pos' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '=' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'rb_raise' Name '(' Punctuation 'rb_eIndexError' Name ',' Punctuation ' ' Text '"' Literal.String 'index %ld out of array' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'idx' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'ifnone' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'idx' Name ']' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.index(obj) -> int or nil\n * array.index {|item| block} -> int or nil\n * \n * Returns the index of the first object in self such that is\n * == to obj. If a block is given instead of an\n * argument, returns first object for which block is true.\n * Returns nil if no match is found.\n * \n * a = [ "a", "b", "c" ]\n * a.index("b") #=> 1\n * a.index("z") #=> nil\n * a.index{|x|x=="b"} #=> 1\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_index' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'val' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'i' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'rb_scan_args' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text '"' Literal.String '01' Literal.String '"' Literal.String ',' Punctuation ' ' Text '&' Operator 'val' Name ')' Punctuation ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '<' Operator 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'if' Keyword ' ' Text '(' Punctuation 'RTEST' Name '(' Punctuation 'rb_yield' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ')' Punctuation ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t\t' Text 'return' Keyword ' ' Text 'LONG2NUM' Name.Function '(' Punctuation 'i' Name ')' Punctuation ';' Punctuation '\n' Text '\t ' Text '}' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'else' Keyword ' ' Text '{' Punctuation '\n' Text '\t' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '<' Operator 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'if' Keyword ' ' Text '(' Punctuation 'rb_equal' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ',' Punctuation ' ' Text 'val' Name ')' Punctuation ')' Punctuation '\n' Text '\t\t' Text 'return' Keyword ' ' Text 'LONG2NUM' Name '(' Punctuation 'i' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'Qnil' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.rindex(obj) -> int or nil\n * \n * Returns the index of the last object in array\n * == to obj. If a block is given instead of an\n * argument, returns first object for which block is\n * true. Returns nil if no match is found.\n * \n * a = [ "a", "b", "b", "b", "c" ]\n * a.rindex("b") #=> 3\n * a.rindex("z") #=> nil\n * a.rindex{|x|x=="b"} #=> 3\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_rindex' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'val' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'rb_scan_args' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text '"' Literal.String '01' Literal.String '"' Literal.String ',' Punctuation ' ' Text '&' Operator 'val' Name ')' Punctuation ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'while' Keyword ' ' Text '(' Punctuation 'i' Name '-' Operator '-' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'if' Keyword ' ' Text '(' Punctuation 'RTEST' Name '(' Punctuation 'rb_yield' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ')' Punctuation ')' Punctuation ')' Punctuation '\n' Text '\t\t' Text 'return' Keyword ' ' Text 'LONG2NUM' Name '(' Punctuation 'i' Name ')' Punctuation ';' Punctuation '\n' Text '\t ' Text 'if' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '>' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t\t' Text 'i' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text '\t ' Text '}' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'else' Keyword ' ' Text '{' Punctuation '\n' Text '\t' Text 'while' Keyword ' ' Text '(' Punctuation 'i' Name '-' Operator '-' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'if' Keyword ' ' Text '(' Punctuation 'rb_equal' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ',' Punctuation ' ' Text 'val' Name ')' Punctuation ')' Punctuation '\n' Text '\t\t' Text 'return' Keyword ' ' Text 'LONG2NUM' Name '(' Punctuation 'i' Name ')' Punctuation ';' Punctuation '\n' Text '\t ' Text 'if' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '>' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t\t' Text 'i' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text '\t ' Text '}' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'Qnil' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_to_ary' Name '(' Punctuation 'obj' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'obj' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'TYPE' Name '(' Punctuation 'obj' Name ')' Punctuation ' ' Text '=' Operator '=' Operator ' ' Text 'T_ARRAY' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'obj' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'rb_respond_to' Name '(' Punctuation 'obj' Name ',' Punctuation ' ' Text 'rb_intern' Name '(' Punctuation '"' Literal.String 'to_ary' Literal.String '"' Literal.String ')' Punctuation ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'to_ary' Name.Function '(' Punctuation 'obj' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_ary_new3' Name '(' Punctuation '1' Literal.Number.Integer ',' Punctuation ' ' Text 'obj' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'void' Keyword.Type '\n' Text 'rb_ary_splice' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'beg' Name ',' Punctuation ' ' Text 'len' Name ',' Punctuation ' ' Text 'rpl' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'beg' Name ',' Punctuation ' ' Text 'len' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'rpl' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'rlen' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'len' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'rb_raise' Name '(' Punctuation 'rb_eIndexError' Name ',' Punctuation ' ' Text '"' Literal.String 'negative length (%ld)' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'len' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'beg' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'beg' Name ' ' Text '+' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'beg' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'beg' Name ' ' Text '-' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text '\t ' Text 'rb_raise' Name '(' Punctuation 'rb_eIndexError' Name ',' Punctuation ' ' Text '"' Literal.String 'index %ld out of array' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'beg' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'beg' Name ' ' Text '+' Operator ' ' Text 'len' Name ' ' Text '>' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'len' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '-' Operator ' ' Text 'beg' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'rpl' Name ' ' Text '=' Operator '=' Operator ' ' Text 'Qundef' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rlen' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'else' Keyword ' ' Text '{' Punctuation '\n' Text '\t' Text 'rpl' Name ' ' Text '=' Operator ' ' Text 'rb_ary_to_ary' Name '(' Punctuation 'rpl' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'rlen' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'rpl' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'rb_ary_modify' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'beg' Name ' ' Text '>' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'len' Name ' ' Text '=' Operator ' ' Text 'beg' Name ' ' Text '+' Operator ' ' Text 'rlen' Name ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'len' Name ' ' Text '>' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'REALLOC_N' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'len' Name ')' Punctuation ';' Punctuation '\n' Text '\t ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '=' Operator ' ' Text 'len' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'rb_mem_clear' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '+' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ',' Punctuation ' ' Text 'beg' Name ' ' Text '-' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'rlen' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'MEMCPY' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '+' Operator ' ' Text 'beg' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'rpl' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'rlen' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'len' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'else' Keyword ' ' Text '{' Punctuation '\n' Text '\t' Text 'long' Keyword.Type ' ' Text 'alen' Name ';' Punctuation '\n' Text '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'beg' Name ' ' Text '+' Operator ' ' Text 'len' Name ' ' Text '>' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'len' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '-' Operator ' ' Text 'beg' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\n' Text '\t' Text 'alen' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '+' Operator ' ' Text 'rlen' Name ' ' Text '-' Operator ' ' Text 'len' Name ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'alen' Name ' ' Text '>' Operator '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'REALLOC_N' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'alen' Name ')' Punctuation ';' Punctuation '\n' Text '\t ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'aux' Name '.' Punctuation 'capa' Name ' ' Text '=' Operator ' ' Text 'alen' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'len' Name ' ' Text '!' Operator '=' Operator ' ' Text 'rlen' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'MEMMOVE' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '+' Operator ' ' Text 'beg' Name ' ' Text '+' Operator ' ' Text 'rlen' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '+' Operator ' ' Text 'beg' Name ' ' Text '+' Operator ' ' Text 'len' Name ',' Punctuation '\n' Text '\t\t ' Text 'VALUE' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '-' Operator ' ' Text '(' Punctuation 'beg' Name ' ' Text '+' Operator ' ' Text 'len' Name ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'alen' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'rlen' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'MEMMOVE' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '+' Operator ' ' Text 'beg' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'rpl' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'rlen' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/* \n * call-seq:\n * array[index] = obj -> obj\n * array[start, length] = obj or an_array or nil -> obj or an_array or nil\n * array[range] = obj or an_array or nil -> obj or an_array or nil\n *\n * Element Assignment---Sets the element at _index_,\n * or replaces a subarray starting at _start_ and\n * continuing for _length_ elements, or replaces a subarray\n * specified by _range_. If indices are greater than\n * the current capacity of the array, the array grows\n * automatically. A negative indices will count backward\n * from the end of the array. Inserts elements if _length_ is\n * zero. An +IndexError+ is raised if a negative index points\n * past the beginning of the array. See also\n * Array#push, and Array#unshift.\n * \n * a = Array.new\n * a[4] = "4"; #=> [nil, nil, nil, nil, "4"]\n * a[0, 3] = [ \'a\', \'b\', \'c\' ] #=> ["a", "b", "c", nil, "4"]\n * a[1..2] = [ 1, 2 ] #=> ["a", 1, 2, nil, "4"]\n * a[0, 2] = "?" #=> ["?", 2, nil, "4"]\n * a[0..2] = "A" #=> ["A", "4"]\n * a[-1] = "Z" #=> ["A", "Z"]\n * a[1..-1] = nil #=> ["A", nil]\n * a[1..-1] = [] #=> ["A"]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_aset' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'offset' Name ',' Punctuation ' ' Text 'beg' Name ',' Punctuation ' ' Text 'len' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '=' Operator '=' Operator ' ' Text '3' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_ary_splice' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'NUM2LONG' Name '(' Punctuation 'argv' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ')' Punctuation ',' Punctuation ' ' Text 'NUM2LONG' Name '(' Punctuation 'argv' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ',' Punctuation ' ' Text 'argv' Name '[' Punctuation '2' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'argv' Name '[' Punctuation '2' Literal.Number.Integer ']' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '!' Operator '=' Operator ' ' Text '2' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_raise' Name '(' Punctuation 'rb_eArgError' Name ',' Punctuation ' ' Text '"' Literal.String 'wrong number of arguments (%d for 2)' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'argc' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'FIXNUM_P' Name '(' Punctuation 'argv' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'offset' Name ' ' Text '=' Operator ' ' Text 'FIX2LONG' Name '(' Punctuation 'argv' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'goto' Keyword ' ' Text 'fixnum' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'rb_range_beg_len' Name '(' Punctuation 'argv' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ',' Punctuation ' ' Text '&' Operator 'beg' Name ',' Punctuation ' ' Text '&' Operator 'len' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ',' Punctuation ' ' Text '1' Literal.Number.Integer ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text '/* check if idx is Range */' Comment.Multiline '\n' Text '\t' Text 'rb_ary_splice' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'beg' Name ',' Punctuation ' ' Text 'len' Name ',' Punctuation ' ' Text 'argv' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'argv' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'offset' Name ' ' Text '=' Operator ' ' Text 'NUM2LONG' Name '(' Punctuation 'argv' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text 'fixnum' Name.Label ':' Punctuation '\n' Text ' ' Text 'rb_ary_store' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'offset' Name ',' Punctuation ' ' Text 'argv' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'argv' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.insert(index, obj...) -> array\n * \n * Inserts the given values before the element with the given index\n * (which may be negative).\n * \n * a = %w{ a b c d }\n * a.insert(2, 99) #=> ["a", "b", 99, "c", "d"]\n * a.insert(-2, 1, 2, 3) #=> ["a", "b", 99, "c", 1, 2, 3, "d"]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_insert' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'pos' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '<' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_raise' Name '(' Punctuation 'rb_eArgError' Name ',' Punctuation ' ' Text '"' Literal.String 'wrong number of arguments (at least 1)' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'pos' Name ' ' Text '=' Operator ' ' Text 'NUM2LONG' Name '(' Punctuation 'argv' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'pos' Name ' ' Text '=' Operator '=' Operator ' ' Text '-1' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'pos' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'pos' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'pos' Name '+' Operator '+' Operator ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'argc' Name ' ' Text '=' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text 'rb_ary_splice' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'pos' Name ',' Punctuation ' ' Text '0' Literal.Number.Integer ',' Punctuation ' ' Text 'rb_ary_new4' Name '(' Punctuation 'argc' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer ',' Punctuation ' ' Text 'argv' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.each {|item| block } -> array\n * \n * Calls block once for each element in self, passing that\n * element as a parameter.\n * \n * a = [ "a", "b", "c" ]\n * a.each {|x| print x, " -- " }\n * \n * produces:\n * \n * a -- b -- c --\n */' Comment.Multiline '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_each' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'i' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '<' Operator 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_yield' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.each_index {|index| block } -> array\n * \n * Same as Array#each, but passes the index of the element\n * instead of the element itself.\n * \n * a = [ "a", "b", "c" ]\n * a.each_index {|x| print x, " -- " }\n * \n * produces:\n * \n * 0 -- 1 -- 2 --\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_each_index' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'i' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '<' Operator 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_yield' Name '(' Punctuation 'LONG2NUM' Name '(' Punctuation 'i' Name ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.reverse_each {|item| block } \n * \n * Same as Array#each, but traverses self in reverse\n * order.\n * \n * a = [ "a", "b", "c" ]\n * a.reverse_each {|x| print x, " " }\n * \n * produces:\n * \n * c b a\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_reverse_each' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'len' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'while' Keyword ' ' Text '(' Punctuation 'len' Name '-' Operator '-' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_yield' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'len' Name ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '<' Operator ' ' Text 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'len' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.length -> int\n * \n * Returns the number of elements in self. May be zero.\n * \n * [ 1, 2, 3, 4, 5 ].length #=> 5\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_length' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'LONG2NUM' Name.Function '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.empty? -> true or false\n * \n * Returns true if self array contains no elements.\n * \n * [].empty? #=> true\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_empty_p' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'Qtrue' Name ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'Qfalse' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_dup' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'dup' Name ' ' Text '=' Operator ' ' Text 'rb_ary_new2' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'DUPSETUP' Name '(' Punctuation 'dup' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'MEMCPY' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'dup' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'VALUE' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'RARRAY' Name '(' Punctuation 'dup' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'dup' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'extern' Keyword ' ' Text 'VALUE' Name ' ' Text 'rb_output_fs' Name ';' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'recursive_join' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'arg' Name ',' Punctuation ' ' Text 'recur' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'arg' Name ';' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'recur' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'recur' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'rb_str_new2' Name.Function '(' Punctuation '"' Literal.String '[...]' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_ary_join' Name '(' Punctuation 'arg' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ',' Punctuation ' ' Text 'arg' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_join' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'sep' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ',' Punctuation ' ' Text 'sep' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'len' Name ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ',' Punctuation ' ' Text 'i' Name ';' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'taint' Name ' ' Text '=' Operator ' ' Text 'Qfalse' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'result' Name ',' Punctuation ' ' Text 'tmp' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'rb_str_new' Name '(' Punctuation '0' Literal.Number.Integer ',' Punctuation ' ' Text '0' Literal.Number.Integer ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'OBJ_TAINTED' Name '(' Punctuation 'ary' Name ')' Punctuation ' ' Text '|' Operator '|' Operator ' ' Text 'OBJ_TAINTED' Name '(' Punctuation 'sep' Name ')' Punctuation ')' Punctuation ' ' Text 'taint' Name ' ' Text '=' Operator ' ' Text 'Qtrue' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '<' Operator 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'tmp' Name ' ' Text '=' Operator ' ' Text 'rb_check_string_type' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'len' Name ' ' Text '+' Operator '=' Operator ' ' Text 'NIL_P' Name '(' Punctuation 'tmp' Name ')' Punctuation ' ' Text '?' Operator ' ' Text '10' Literal.Number.Integer ' ' Text ':' Operator ' ' Text 'RSTRING' Name '(' Punctuation 'tmp' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation '!' Operator 'NIL_P' Name '(' Punctuation 'sep' Name ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'StringValue' Name '(' Punctuation 'sep' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'len' Name ' ' Text '+' Operator '=' Operator ' ' Text 'RSTRING' Name '(' Punctuation 'sep' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '*' Operator ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'result' Name ' ' Text '=' Operator ' ' Text 'rb_str_buf_new' Name '(' Punctuation 'len' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '<' Operator 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'tmp' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ';' Punctuation '\n' Text '\t' Text 'switch' Keyword ' ' Text '(' Punctuation 'TYPE' Name '(' Punctuation 'tmp' Name ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'case' Keyword ' ' Text 'T_STRING' Name.Label ':' Punctuation '\n' Text '\t ' Text 'break' Keyword ';' Punctuation '\n' Text '\t ' Text 'case' Keyword ' ' Text 'T_ARRAY' Name.Label ':' Punctuation '\n' Text '\t ' Text '{' Punctuation '\n' Text '\t\t' Text 'VALUE' Name ' ' Text 'args' Name '[' Punctuation '2' Literal.Number.Integer ']' Punctuation ';' Punctuation '\n' Text '\n' Text '\t\t' Text 'args' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ' ' Text '=' Operator ' ' Text 'tmp' Name ';' Punctuation '\n' Text '\t\t' Text 'args' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ' ' Text '=' Operator ' ' Text 'sep' Name ';' Punctuation '\n' Text '\t\t' Text 'tmp' Name ' ' Text '=' Operator ' ' Text 'rb_exec_recursive' Name '(' Punctuation 'recursive_join' Name ',' Punctuation ' ' Text 'ary' Name ',' Punctuation ' ' Text '(' Punctuation 'VALUE' Name ')' Punctuation 'args' Name ')' Punctuation ';' Punctuation '\n' Text '\t ' Text '}' Punctuation '\n' Text '\t ' Text 'break' Keyword ';' Punctuation '\n' Text '\t ' Text 'default' Keyword ':' Operator '\n' Text '\t ' Text 'tmp' Name ' ' Text '=' Operator ' ' Text 'rb_obj_as_string' Name '(' Punctuation 'tmp' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text '&' Operator '&' Operator ' ' Text '!' Operator 'NIL_P' Name '(' Punctuation 'sep' Name ')' Punctuation ')' Punctuation '\n' Text '\t ' Text 'rb_str_buf_append' Name '(' Punctuation 'result' Name ',' Punctuation ' ' Text 'sep' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'rb_str_buf_append' Name '(' Punctuation 'result' Name ',' Punctuation ' ' Text 'tmp' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'OBJ_TAINTED' Name '(' Punctuation 'tmp' Name ')' Punctuation ')' Punctuation ' ' Text 'taint' Name ' ' Text '=' Operator ' ' Text 'Qtrue' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'taint' Name ')' Punctuation ' ' Text 'OBJ_TAINT' Name '(' Punctuation 'result' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'result' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.join(sep=$,) -> str\n * \n * Returns a string created by converting each element of the array to\n * a string, separated by sep.\n * \n * [ "a", "b", "c" ].join #=> "abc"\n * [ "a", "b", "c" ].join("-") #=> "a-b-c"\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_join_m' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'sep' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'rb_scan_args' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text '"' Literal.String '01' Literal.String '"' Literal.String ',' Punctuation ' ' Text '&' Operator 'sep' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'NIL_P' Name '(' Punctuation 'sep' Name ')' Punctuation ')' Punctuation ' ' Text 'sep' Name ' ' Text '=' Operator ' ' Text 'rb_output_fs' Name ';' Punctuation '\n' Text ' \n ' Text 'return' Keyword ' ' Text 'rb_ary_join' Name.Function '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'sep' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.to_s -> string\n * \n * Returns _self_.join.\n * \n * [ "a", "e", "i", "o" ].to_s #=> "aeio"\n *\n */' Comment.Multiline '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_to_s' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'rb_str_new' Name '(' Punctuation '0' Literal.Number.Integer ',' Punctuation ' ' Text '0' Literal.Number.Integer ')' Punctuation ';' Punctuation '\n' Text ' \n ' Text 'return' Keyword ' ' Text 'rb_ary_join' Name.Function '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'rb_output_fs' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'inspect_ary' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'dummy' Name ',' Punctuation ' ' Text 'recur' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'dummy' Name ';' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'recur' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'tainted' Name ' ' Text '=' Operator ' ' Text 'OBJ_TAINTED' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'i' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 's' Name ',' Punctuation ' ' Text 'str' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'recur' Name ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'rb_tainted_str_new2' Name '(' Punctuation '"' Literal.String '[...]' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'str' Name ' ' Text '=' Operator ' ' Text 'rb_str_buf_new2' Name '(' Punctuation '"' Literal.String '[' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '<' Operator 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 's' Name ' ' Text '=' Operator ' ' Text 'rb_inspect' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'OBJ_TAINTED' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation ' ' Text 'tainted' Name ' ' Text '=' Operator ' ' Text 'Qtrue' Name ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'rb_str_buf_cat2' Name '(' Punctuation 'str' Name ',' Punctuation ' ' Text '"' Literal.String ', ' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'rb_str_buf_append' Name '(' Punctuation 'str' Name ',' Punctuation ' ' Text 's' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'rb_str_buf_cat2' Name '(' Punctuation 'str' Name ',' Punctuation ' ' Text '"' Literal.String ']' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'tainted' Name ')' Punctuation ' ' Text 'OBJ_TAINT' Name '(' Punctuation 'str' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'str' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.inspect -> string\n *\n * Create a printable version of array.\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_inspect' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '=' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'return' Keyword ' ' Text 'rb_str_new2' Name '(' Punctuation '"' Literal.String '[]' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_exec_recursive' Name.Function '(' Punctuation 'inspect_ary' Name ',' Punctuation ' ' Text 'ary' Name ',' Punctuation ' ' Text '0' Literal.Number.Integer ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.to_a -> array\n * \n * Returns _self_. If called on a subclass of Array, converts\n * the receiver to an Array object.\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_to_a' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'rb_obj_class' Name '(' Punctuation 'ary' Name ')' Punctuation ' ' Text '!' Operator '=' Operator ' ' Text 'rb_cArray' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'VALUE' Name ' ' Text 'dup' Name ' ' Text '=' Operator ' ' Text 'rb_ary_new2' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'rb_ary_replace' Name '(' Punctuation 'dup' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation ';' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'dup' Name ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.to_ary -> array\n * \n * Returns _self_.\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_to_ary_m' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_reverse' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'p1' Name ',' Punctuation ' ' Text '*' Operator 'p2' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'tmp' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'rb_ary_modify' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '>' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'p1' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ';' Punctuation '\n' Text '\t' Text 'p2' Name ' ' Text '=' Operator ' ' Text 'p1' Name ' ' Text '+' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer ';' Punctuation '\t' Text '/* points last item */' Comment.Multiline '\n' Text '\n' Text '\t' Text 'while' Keyword ' ' Text '(' Punctuation 'p1' Name ' ' Text '<' Operator ' ' Text 'p2' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'tmp' Name ' ' Text '=' Operator ' ' Text '*' Operator 'p1' Name ';' Punctuation '\n' Text '\t ' Text '*' Operator 'p1' Name '+' Operator '+' Operator ' ' Text '=' Operator ' ' Text '*' Operator 'p2' Name ';' Punctuation '\n' Text '\t ' Text '*' Operator 'p2' Name '-' Operator '-' Operator ' ' Text '=' Operator ' ' Text 'tmp' Name ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.reverse! -> array \n * \n * Reverses _self_ in place.\n * \n * a = [ "a", "b", "c" ]\n * a.reverse! #=> ["c", "b", "a"]\n * a #=> ["c", "b", "a"]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_reverse_bang' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_ary_reverse' Name.Function '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.reverse -> an_array\n * \n * Returns a new array containing self\'s elements in reverse order.\n * \n * [ "a", "b", "c" ].reverse #=> ["c", "b", "a"]\n * [ 1 ].reverse #=> [1]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_reverse_m' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_ary_reverse' Name.Function '(' Punctuation 'rb_ary_dup' Name '(' Punctuation 'ary' Name ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'struct' Keyword ' ' Text 'ary_sort_data' Name.Class ' ' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'ptr' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'len' Name ';' Punctuation '\n' Text '}' Punctuation ';' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'void' Keyword.Type '\n' Text 'ary_sort_check' Name '(' Punctuation 'data' Name ')' Punctuation '\n' Text ' ' Text 'struct' Keyword ' ' Text 'ary_sort_data' Name.Class ' ' Text '*' Operator 'data' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'data' Name '-' Operator '>' Operator 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ' ' Text '!' Operator '=' Operator ' ' Text 'data' Name '-' Operator '>' Operator 'ptr' Name ' ' Text '|' Operator '|' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'data' Name '-' Operator '>' Operator 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '!' Operator '=' Operator ' ' Text 'data' Name '-' Operator '>' Operator 'len' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_raise' Name '(' Punctuation 'rb_eRuntimeError' Name ',' Punctuation ' ' Text '"' Literal.String 'array modified during sort' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'int' Keyword.Type '\n' Text 'sort_1' Name '(' Punctuation 'a' Name ',' Punctuation ' ' Text 'b' Name ',' Punctuation ' ' Text 'data' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'a' Name ',' Punctuation ' ' Text '*' Operator 'b' Name ';' Punctuation '\n' Text ' ' Text 'struct' Keyword ' ' Text 'ary_sort_data' Name.Class ' ' Text '*' Operator 'data' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'retval' Name ' ' Text '=' Operator ' ' Text 'rb_yield_values' Name '(' Punctuation '2' Literal.Number.Integer ',' Punctuation ' ' Text '*' Operator 'a' Name ',' Punctuation ' ' Text '*' Operator 'b' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'n' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text 'rb_cmpint' Name '(' Punctuation 'retval' Name ',' Punctuation ' ' Text '*' Operator 'a' Name ',' Punctuation ' ' Text '*' Operator 'b' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'ary_sort_check' Name '(' Punctuation 'data' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'n' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'int' Keyword.Type '\n' Text 'sort_2' Name '(' Punctuation 'ap' Name ',' Punctuation ' ' Text 'bp' Name ',' Punctuation ' ' Text 'data' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'ap' Name ',' Punctuation ' ' Text '*' Operator 'bp' Name ';' Punctuation '\n' Text ' ' Text 'struct' Keyword ' ' Text 'ary_sort_data' Name.Class ' ' Text '*' Operator 'data' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'retval' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'a' Name ' ' Text '=' Operator ' ' Text '*' Operator 'ap' Name ',' Punctuation ' ' Text 'b' Name ' ' Text '=' Operator ' ' Text '*' Operator 'bp' Name ';' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'n' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'FIXNUM_P' Name '(' Punctuation 'a' Name ')' Punctuation ' ' Text '&' Operator '&' Operator ' ' Text 'FIXNUM_P' Name '(' Punctuation 'b' Name ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation '(' Punctuation 'long' Keyword.Type ')' Punctuation 'a' Name ' ' Text '>' Operator ' ' Text '(' Punctuation 'long' Keyword.Type ')' Punctuation 'b' Name ')' Punctuation ' ' Text 'return' Keyword ' ' Text '1' Literal.Number.Integer ';' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation '(' Punctuation 'long' Keyword.Type ')' Punctuation 'a' Name ' ' Text '<' Operator ' ' Text '(' Punctuation 'long' Keyword.Type ')' Punctuation 'b' Name ')' Punctuation ' ' Text 'return' Keyword ' ' Text '-1' Literal.Number.Integer ';' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text '0' Literal.Number.Integer ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'TYPE' Name '(' Punctuation 'a' Name ')' Punctuation ' ' Text '=' Operator '=' Operator ' ' Text 'T_STRING' Name ' ' Text '&' Operator '&' Operator ' ' Text 'TYPE' Name '(' Punctuation 'b' Name ')' Punctuation ' ' Text '=' Operator '=' Operator ' ' Text 'T_STRING' Name ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'rb_str_cmp' Name.Function '(' Punctuation 'a' Name ',' Punctuation ' ' Text 'b' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'retval' Name ' ' Text '=' Operator ' ' Text 'rb_funcall' Name '(' Punctuation 'a' Name ',' Punctuation ' ' Text 'id_cmp' Name ',' Punctuation ' ' Text '1' Literal.Number.Integer ',' Punctuation ' ' Text 'b' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text 'rb_cmpint' Name '(' Punctuation 'retval' Name ',' Punctuation ' ' Text 'a' Name ',' Punctuation ' ' Text 'b' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'ary_sort_check' Name '(' Punctuation 'data' Name ')' Punctuation ';' Punctuation '\n' Text '\n' Text ' ' Text 'return' Keyword ' ' Text 'n' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'sort_internal' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'struct' Keyword ' ' Text 'ary_sort_data' Name.Class ' ' Text 'data' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'data' Name '.' Punctuation 'ary' Name ' ' Text '=' Operator ' ' Text 'ary' Name ';' Punctuation '\n' Text ' ' Text 'data' Name '.' Punctuation 'ptr' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ';' Punctuation ' ' Text 'data' Name '.' Punctuation 'len' Name ' ' Text '=' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation '\n' Text ' ' Text 'qsort' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ',' Punctuation ' ' Text 'sizeof' Keyword '(' Punctuation 'VALUE' Name ')' Punctuation ',' Punctuation '\n' Text '\t ' Text 'rb_block_given_p' Name '(' Punctuation ')' Punctuation '?' Operator 'sort_1' Name.Label ':' Punctuation 'sort_2' Name ',' Punctuation ' ' Text '&' Operator 'data' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'sort_unlock' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'FL_UNSET' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'ARY_TMPLOCK' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.sort! -> array\n * array.sort! {| a,b | block } -> array \n * \n * Sorts _self_. Comparisons for\n * the sort will be done using the <=> operator or using\n * an optional code block. The block implements a comparison between\n * a and b, returning -1, 0, or +1. See also\n * Enumerable#sort_by.\n * \n * a = [ "d", "a", "e", "c", "b" ]\n * a.sort #=> ["a", "b", "c", "d", "e"]\n * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]\n */' Comment.Multiline '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_sort_bang' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'rb_ary_modify' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ' ' Text '>' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'FL_SET' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'ARY_TMPLOCK' Name ')' Punctuation ';' Punctuation '\t' Text '/* prohibit modification during sort */' Comment.Multiline '\n' Text '\t' Text 'rb_ensure' Name '(' Punctuation 'sort_internal' Name ',' Punctuation ' ' Text 'ary' Name ',' Punctuation ' ' Text 'sort_unlock' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.sort -> an_array \n * array.sort {| a,b | block } -> an_array \n * \n * Returns a new array created by sorting self. Comparisons for\n * the sort will be done using the <=> operator or using\n * an optional code block. The block implements a comparison between\n * a and b, returning -1, 0, or +1. See also\n * Enumerable#sort_by.\n * \n * a = [ "d", "a", "e", "c", "b" ]\n * a.sort #=> ["a", "b", "c", "d", "e"]\n * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]\n */' Comment.Multiline '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_ary_sort' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'ary' Name ' ' Text '=' Operator ' ' Text 'rb_ary_dup' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'rb_ary_sort_bang' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.collect {|item| block } -> an_array\n * array.map {|item| block } -> an_array\n * \n * Invokes block once for each element of self. Creates a \n * new array containing the values returned by the block.\n * See also Enumerable#collect.\n * \n * a = [ "a", "b", "c", "d" ]\n * a.collect {|x| x + "!" } #=> ["a!", "b!", "c!", "d!"]\n * a #=> ["a", "b", "c", "d"]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_collect' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'i' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'collect' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '(' Punctuation '!' Operator 'rb_block_given_p' Name '(' Punctuation ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'return' Keyword ' ' Text 'rb_ary_new4' Name.Function '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text '\n' Text ' ' Text 'collect' Name ' ' Text '=' Operator ' ' Text 'rb_ary_new2' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_ary_push' Name '(' Punctuation 'collect' Name ',' Punctuation ' ' Text 'rb_yield' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'collect' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/* \n * call-seq:\n * array.collect! {|item| block } -> array\n * array.map! {|item| block } -> array\n *\n * Invokes the block once for each element of _self_, replacing the\n * element with the value returned by _block_.\n * See also Enumerable#collect.\n * \n * a = [ "a", "b", "c", "d" ]\n * a.collect! {|x| x + "!" }\n * a #=> [ "a!", "b!", "c!", "d!" ]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_collect_bang' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'i' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'rb_ary_modify' Name '(' Punctuation 'ary' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'rb_ary_store' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'i' Name ',' Punctuation ' ' Text 'rb_yield' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'ary' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text 'VALUE' Name '\n' Text 'rb_get_values_at' Name '(' Punctuation 'obj' Name ',' Punctuation ' ' Text 'olen' Name ',' Punctuation ' ' Text 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'func' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'obj' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'olen' Name ';' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '(' Punctuation '*' Operator 'func' Name ')' Punctuation ' ' Text '_' Name '(' Punctuation '(' Punctuation 'VALUE' Name ',' Punctuation 'long' Keyword.Type ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'result' Name ' ' Text '=' Operator ' ' Text 'rb_ary_new2' Name '(' Punctuation 'argc' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'beg' Name ',' Punctuation ' ' Text 'len' Name ',' Punctuation ' ' Text 'i' Name ',' Punctuation ' ' Text 'j' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name '<' Operator 'argc' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'FIXNUM_P' Name '(' Punctuation 'argv' Name '[' Punctuation 'i' Name ']' Punctuation ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'rb_ary_push' Name '(' Punctuation 'result' Name ',' Punctuation ' ' Text '(' Punctuation '*' Operator 'func' Name ')' Punctuation '(' Punctuation 'obj' Name ',' Punctuation ' ' Text 'FIX2LONG' Name '(' Punctuation 'argv' Name '[' Punctuation 'i' Name ']' Punctuation ')' Punctuation ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t ' Text 'continue' Keyword ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text '/* check if idx is Range */' Comment.Multiline '\n' Text '\t' Text 'switch' Keyword ' ' Text '(' Punctuation 'rb_range_beg_len' Name '(' Punctuation 'argv' Name '[' Punctuation 'i' Name ']' Punctuation ',' Punctuation ' ' Text '&' Operator 'beg' Name ',' Punctuation ' ' Text '&' Operator 'len' Name ',' Punctuation ' ' Text 'olen' Name ',' Punctuation ' ' Text '0' Literal.Number.Integer ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'case' Keyword ' ' Text 'Qfalse' Name.Label ':' Punctuation '\n' Text '\t ' Text 'break' Keyword ';' Punctuation '\n' Text '\t ' Text 'case' Keyword ' ' Text 'Qnil' Name.Label ':' Punctuation '\n' Text '\t ' Text 'continue' Keyword ';' Punctuation '\n' Text '\t ' Text 'default' Keyword ':' Operator '\n' Text '\t ' Text 'for' Keyword ' ' Text '(' Punctuation 'j' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'j' Name '<' Operator 'len' Name ';' Punctuation ' ' Text 'j' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t\t' Text 'rb_ary_push' Name '(' Punctuation 'result' Name ',' Punctuation ' ' Text '(' Punctuation '*' Operator 'func' Name ')' Punctuation '(' Punctuation 'obj' Name ',' Punctuation ' ' Text 'j' Name '+' Operator 'beg' Name ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t ' Text '}' Punctuation '\n' Text '\t ' Text 'continue' Keyword ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text '\t' Text 'rb_ary_push' Name '(' Punctuation 'result' Name ',' Punctuation ' ' Text '(' Punctuation '*' Operator 'func' Name ')' Punctuation '(' Punctuation 'obj' Name ',' Punctuation ' ' Text 'NUM2LONG' Name '(' Punctuation 'argv' Name '[' Punctuation 'i' Name ']' Punctuation ')' Punctuation ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'result' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/* \n * call-seq:\n * array.values_at(selector,... ) -> an_array\n *\n * Returns an array containing the elements in\n * _self_ corresponding to the given selector(s). The selectors\n * may be either integer indices or ranges. \n * See also Array#select.\n * \n * a = %w{ a b c d e f }\n * a.values_at(1, 3, 5)\n * a.values_at(1, 3, 5, 7)\n * a.values_at(-1, -3, -5, -7)\n * a.values_at(1..3, 2...5)\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_values_at' Name '(' Punctuation 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'ary' Name ')' Punctuation '\n' Text ' ' Text 'int' Keyword.Type ' ' Text 'argc' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text '*' Operator 'argv' Name ';' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'rb_get_values_at' Name.Function '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ',' Punctuation ' ' Text 'argc' Name ',' Punctuation ' ' Text 'argv' Name ',' Punctuation ' ' Text 'rb_ary_entry' Name ')' Punctuation ';' Punctuation '\n' Text '}' Punctuation '\n' Text '\n' Text '/*\n * call-seq:\n * array.select {|item| block } -> an_array\n * \n * Invokes the block passing in successive elements from array,\n * returning an array containing those elements for which the block\n * returns a true value (equivalent to Enumerable#select).\n * \n * a = %w{ a b c d e f }\n * a.select {|v| v =~ /[aeiou]/} #=> ["a", "e"]\n */' Comment.Multiline '\n' Text '\n' Text 'static' Keyword ' ' Text 'VALUE' Name '\n' Text 'rb_ary_select' Name '(' Punctuation 'ary' Name ')' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'ary' Name ';' Punctuation '\n' Text '{' Punctuation '\n' Text ' ' Text 'VALUE' Name ' ' Text 'result' Name ';' Punctuation '\n' Text ' ' Text 'long' Keyword.Type ' ' Text 'i' Name ';' Punctuation '\n' Text '\n' Text ' ' Text 'result' Name ' ' Text '=' Operator ' ' Text 'rb_ary_new2' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ')' Punctuation ';' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'len' Name ';' Punctuation ' ' Text 'i' Name '+' Operator '+' Operator ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t' Text 'if' Keyword ' ' Text '(' Punctuation 'RTEST' Name '(' Punctuation 'rb_yield' Name '(' Punctuation 'RARRAY' Name '(' Punctuation 'ary' Name ')' Punctuation '-' Operator '>' Operator 'ptr' Name '[' Punctuation 'i' Name ']' Punctuation ')' Punctuation ')' Punctuation ')' Punctuation ' ' Text '{' Punctuation '\n' Text '\t ' Text 'rb_ary_push' Name '(' Punctuation 'result' Name ',' Punctuation ' ' Text 'rb_ary_elt' Name '(' Punctuation 'ary' Name ',' Punctuation ' ' Text 'i' Name ')' Punctuation ')' Punctuation ';' Punctuation '\n' Text '\t' Text '}' Punctuation '\n' Text ' ' Text '}' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'result' Name ';' Punctuation '\n' Text '}' Punctuation '\n' Text