============================================================================ Helper function used to handle next/previous when the loop function is 'reverse'
971492
function deltaReverse(arg, increment) {
  let newIdx = arg.idx + arg.direction * increment;
  if (newIdx >= arg.values.length) {
    arg.direction *= -1; // Reverse direction
    newIdx = arg.values.length - 2;
  }

  if (newIdx < 0) {
    arg.direction *= -1; // Reverse direction
    newIdx = 1;
  }

  if (newIdx >= 0 && newIdx < arg.values.length) {
    arg.idx = newIdx;
  }

  return true;
}
300712
def _process_loop_helper(self, node, **kwargs):
        

        if node.attr == LOOP_HELPER_INDEX:
            self.output.write('(arguments[1] + 1)')
        elif node.attr == LOOP_HELPER_INDEX_0:
            self.output.write('arguments[1]')
        elif node.attr == LOOP_HELPER_FIRST:
            self.output.write('(arguments[1] == 0)')
        elif node.attr == LOOP_HELPER_LAST:
            self.output.write('(arguments[1] == arguments[2].length - 1)')
        elif node.attr == LOOP_HELPER_LENGTH:
            self.output.write('arguments[2].length')
846632
function reverse(input) {

  if(isString(input)) {
    return input.split('').reverse().join('');
  }

  return (isArray(input))
    ? input.slice().reverse()
    : input;
}
601628
function loopListener(looper,e)
        {
          var _looper = looper,
              _len = looper.length,
              _e = e,
              _x;
          for(_x=0;_x<_len;_x++)
          {
            looper[_x](_e);
            if(_e._stopPropogation !== undefined) break;
          }
        }
1058045
private static void reverse(int[] path, int i, int j) {
        while (i < j) {
            int tmp = path[i];
            path[i] = path[j];
            path[j] = tmp;
            i++;
            j--;
        }
    }
463056
public static void reverse(final char[] a, int fromIndex, int toIndex) {
        checkFromToIndex(fromIndex, toIndex, len(a));

        if (N.isNullOrEmpty(a) || a.length == 1) {
            return;
        }

        char tmp = 0;

        for (int i = fromIndex, j = toIndex - 1; i < j; i++, j--) {
            tmp = a[i];
            a[i] = a[j];
            a[j] = tmp;
        }
    }
1075609
function reverse(obj) {
    if (!is_1.isValue(obj))
        return null;
    // Reverse an array.
    if (is_1.isArray(obj))
        return obj.reverse();
    // Reverse a string.
    if (is_1.isString(obj)) {
        var i = obj.toString().length;
        var tmpStr = '';
        while (i--)
            tmpStr += obj[i];
        return tmpStr;
    }
    // Reverse an object.
    var result = {};
    for (var p in obj) {
        if (is_1.isObject(obj[p]))
            continue;
        result[obj[p]] = p;
    }
    return result;
}
9691
function reverseArray(array) {
  let index = array.length,
      newArray = [];

  while (index--) {
    newArray.push(array[index]);
  }

  return newArray;
}
658157
def find_reverse(str)
      index = items.reverse.index {|i| i.index < current_row && i.name.start_with?(str)} || items.reverse.index {|i| i.name.start_with? str}
      move_cursor items.size - index - 1 if index
    end
344231
function(_string) {
    if ('undefined' == typeof _string) {
      return null;
    }
    else if ('string' != typeof _string) {
      throw new Error('Wrong parameter type');
    }

    var str = _string.reverse();
    var ret = 0;

    for (var i = 0; i <= (str.length - 1); i++) {
      ret = ret + this.index.indexOf(str.substr(i, 1)) * (this.bcpow(this.index.length, (str.length - 1) - i));
    }

    return ret;
  }
705264
function reverseInner( list, reversedAlready ) {
      if( !list ) {
         return reversedAlready;
      }
      
      return reverseInner(tail(list), cons(head(list), reversedAlready))
   }
814211
function flip(input){
		input = input.reverse();
		
		// Flip any options back into the right order
		for(let i = 0, l = input.length; i < l; ++i){
			const arg = input[i];
			const opt = shortNames[arg] || longNames[arg];
			
			if(opt){
				const from    = Math.max(0, i - opt.arity);
				const to      = i + 1;
				const extract = input.slice(from, to).reverse();
				input.splice(from, extract.length, ...extract);
			}
		}
		
		return input;
	}
314761
function _reverseAndPrecompute () {
    STATE_NAME_STRICT = Object.keys(US_STATE_NAME_TO_CODE);

    var territoryKeys = Object.keys(US_INHABITED_TERRITORIES_NAME_TO_CODE);

    (STATE_NAME_STRICT || []).forEach(function(stateName) {
        US_STATE_CODE_TO_NAME[US_STATE_NAME_TO_CODE[stateName]] = stateName;
        US_CAPITAL_TO_STATE_NAME[US_STATE_NAME_TO_CAPITAL[stateName]] = stateName;
    });

    (territoryKeys || []).forEach(function(territoryName) {
        US_INHABITED_TERRITORIES_CODE_TO_NAME[US_INHABITED_TERRITORIES_NAME_TO_CODE[territoryName]] = territoryName;
        US_CAPITAL_TO_INHABITED_TERRITORY_NAME[US_INHABITED_TERRITORIES_NAME_TO_CAPITAL[territoryName]] = territoryName;
    });

    // Let us precompute now
    STATE_CODE_STRICT   = Object.keys(US_STATE_CODE_TO_NAME);
    STATE_NAME_ALL      = (STATE_NAME_STRICT || []).concat(territoryKeys);
    STATE_CODE_ALL      = (STATE_CODE_STRICT || []).concat(Object.keys(US_INHABITED_TERRITORIES_CODE_TO_NAME));
}
1222460
function reverse ($this, opts) {
            if (opts.debug) console.time("blast reversal");

            var skippedDescendantRoot = false;

            $this
                .removeClass(NAME + "-root")
                .removeAttr("aria-label")
                .find("." + NAME)
                    .each(function () {
                        var $this = $(this);
                        /* Do not reverse Blast on descendant root elements. (Before you can reverse Blast on an element, you must reverse Blast on any parent elements that have been Blasted.) */
                        if (!$this.closest("." + NAME + "-root").length) {
                            var thisParentNode = this.parentNode;
                            
                            /* This triggers some sort of node layout, thereby solving a node normalization bug in <=IE7 for reasons unknown. If you know the specific reason, tweet me: @Shapiro. */
                            if (IE <= 7) (thisParentNode.firstChild.nodeName);

                            /* Strip the HTML tags off of the wrapper elements by replacing the elements with their child node's text. */
                            thisParentNode.replaceChild(this.firstChild, this);

                            /* Normalize() parents to remove empty text nodes and concatenate sibling text nodes. (This cleans up the DOM after our manipulation.) */
                            thisParentNode.normalize();
                        } else {
                            skippedDescendantRoot = true;
                        }
                    });

            /* Zepto core doesn't include cache-based $.data(), so we mimic data-attr removal by setting it to undefined. */
            if (window.Zepto) {
                $this.data(NAME, undefined);
            } else {
                $this.removeData(NAME);
            }

            if (opts.debug) {
                console.log(NAME + ": Reversed Blast" + ($this.attr("id") ? " on #" + $this.attr("id") + "." : ".") + (skippedDescendantRoot ? " Skipped reversal on the children of one or more descendant root elements." : ""));
                console.timeEnd("blast reversal");
            }
        }
442655
function defineReverse() {
    return Array.prototype.reverse ? function (x) {
      return x.reverse();
    } : function (x) {
      return x.reduceRight(function (agg, item) {
        agg.push(item);
        return agg;
      }, []);
    };
  }
184565
private static void reverse(int first, int last, Swapper swapper) {
	// no more needed since manually inlined
	while (first < --last) {
		swapper.swap(first++,last);
	}
}
738736
def reverse_each(&block)
      node = @last_leaf
      while node
        break unless node.reverse_each(&block)
        node = node.prev_sibling
      end
    end