读取三元表达式

@param {Walker} walker 源码读取对象
@return {Object}
170150
function readTertiaryExpr(walker) {
    var conditional = readLogicalORExpr(walker);
    walker.goUntil();

    if (walker.currentCode() === 63) { // ?
        walker.go(1);
        var yesExpr = readTertiaryExpr(walker);
        walker.goUntil();

        if (walker.currentCode() === 58) { // :
            walker.go(1);
            return {
                type: ExprType.TERTIARY,
                segs: [
                    conditional,
                    yesExpr,
                    readTertiaryExpr(walker)
                ]
            };
        }
    }

    return conditional;
}
359706
function (which) {
        var top = document.getElementsByClassName('RRFixTop'),
            right = document.getElementsByClassName('RRFixRight'),
            bottom = document.getElementsByClassName('RRFixBottom'),
            left = document.getElementsByClassName('RRFixLeft');
        if (top && top.length > 1) {
            console.error('fixes的元素同一方向只允许存在一个，top方向有多个fixes元素存在')
        }
        if (right && right.length > 1) {
            console.error('fixes的元素同一方向只允许存在一个，right方向有多个fixes元素存在')
        }
        if (bottom && bottom.length > 1) {
            console.error('fixes的元素同一方向只允许存在一个，bottom方向有多个fixes元素存在')
        }
        if (left && left.length > 1) {
            console.error('fixes的元素同一方向只允许存在一个，left方向有多个fixes元素存在')
        }
        var getF = function (node, i) {
            switch (i) {
                case 0:
                    node[0] = top[0] || false;
                    break;
                case 1:
                    node[1] = right[0] || false;
                    break;
                case 2:
                    node[2] = bottom[0] || false;
                    break;
                case 3:
                    node[3] = left[0] || false;
                    break;
                default:
                    throw new Error('方法：getFixes，参数：which，是个只能包含0-3之间整数的数组，或者为空')
            }
        };
        var node = [];
        if (which && which.length > 0) {
            for (var a = 0; a < which.length; a++) {
                getF(node, which[a])
            }
        } else {
            var _witch = [0, 1, 2, 3];
            for (var b = 0; b < _witch.length; b++) {
                getF(node, _witch[b])
            }
        }
        return node;
    }
602580
function white() {
		var c = walker.ch,
			token = '';
	
		while (c === " " || c === "\t") {
			token += c;
			c = walker.nextChar();
		}
	
		tokener(token, 'white');
	
	}
24138
function tokenChain(stream,state,chain,style,tail){	// NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;)
		state.chain=null;                               //                                                          12   3tail
		state.style=null;
		state.tail=null;
		state.tokenize=function(stream,state){
			var e=false,c,i=0;
			while(c=stream.next()){
				if(c===chain[i]&&!e){
					if(chain[++i]!==undefined){
						state.chain=chain[i];
						state.style=style;
						state.tail=tail}
					else if(tail)
						stream.eatWhile(tail);
					state.tokenize=tokenPerl;
					return style}
				e=!e&&c=="\\"}
			return style};
		return state.tokenize(stream,state)}
1219897
public void walk(ChuckWalker walker) {
        Object chunk;
        for (int i = 0, len = this.children.size(); i < len; i++) {
            chunk = this.children.get(i);
            if (chunk instanceof SourceNode) {
                ((SourceNode) chunk).walk(walker);
            } else {
                if (((String) chunk).length() != 0) {
                    walker.walk((String) chunk, new OriginalPosition(this.line, this.column, this.source, this.name));
                }
            }
        }
    }
1256749
function callAndCatchPromiseError(fn, ...args) {
  // args 最后一个参数如果是如果是 function 则表示 next()
  // 如果执行时出错，调用 next(err)
  const next = args[args.length - 1];
  let p = null;
  try {
    p = fn.apply(null, args);
  } catch (err) {
    return next(err);
  }
  if (p && p.then && p.catch) {
    p.catch(err => next(err));
  }
}
70278
function readAccessor(walker) {
    var firstSeg = readIdent(walker);
    switch (firstSeg) {
        case 'true':
        case 'false':
            return {
                type: ExprType.BOOL,
                value: firstSeg === 'true'
            };
    }

    var result = createAccessor([
        {
            type: ExprType.STRING,
            value: firstSeg
        }
    ]);

    /* eslint-disable no-constant-condition */
    accessorLoop: while (1) {
    /* eslint-enable no-constant-condition */

        switch (walker.currentCode()) {
            case 46: // .
                walker.go(1);

                // ident as string
                result.paths.push({
                    type: ExprType.STRING,
                    value: readIdent(walker)
                });
                break;

            case 91: // [
                walker.go(1);
                result.paths.push(readTertiaryExpr(walker));
                walker.goUntil(93); // ]
                break;

            default:
                break accessorLoop;
        }
    }

    return result;
}
283688
function tree() {
  let bodyHeight = 400;
  let keyDef = d => d.id;
  let parentDef = d => d.parent;
  let defaultLevel = 99999;
  let nodeEnterFactory = () => {};
  let nodeMergeFactory = () => {};

  // Recursively append child nodes
  function nextLevel(selection, data) {
    if (!selection.select('.childlist').size()) {
      selection.append('ul')
        .classed('childlist', true)
        .style('list-style-type', 'none');
    }
    const items = selection.select('.childlist')
      .selectAll('li')
        .data(data, keyDef);
    items.exit().remove();
    items.enter()
      .append('li')
        .each(function (d) {
          d3.select(this).call(nodeEnterFactory, d.data);
        })
      .merge(items)
        .each(function (d) {
          const node = d3.select(this);
          node.call(nodeMergeFactory, d.data);
          if (d.hasOwnProperty('children')) {
            node.call(nextLevel, d.children)
              .select('.arrow')
                .text(d => d.depth - 1 >= defaultLevel ? '▶ ' : '▼ ')
                .on('click', function () {  // Collapse on click
                  const childList = node.select('.childlist');
                  const expanded = childList.style('display') !== 'none';
                  d3.select(this).text(expanded ? '▶ ' : '▼ ');
                  childList.style('display', expanded ? 'none' : 'inherit');
                });
            node.select('.childlist')
                .style('display',
                  d => d.depth - 1 >= defaultLevel ? 'none' : 'inherit');
          } else {
            node.select('.childlist').remove();
          }
        });
  }

  function _tree(selection, records) {
    const root = d3.stratify()
        .id(keyDef)
        .parentId(parentDef)(records);
    selection
        .style('overflow-y', 'scroll')
        .style('height', `${bodyHeight}px`);
    if (!selection.select('.body').size()) {
      selection.append('div').classed('body', true);
    }
    selection.select('.body')
        .call(nextLevel, root.children || []);
    selection.selectAll('.body > ul')
        .style('padding-left', 0);
    selection.selectAll('.body > ul > li')
        .classed('my-2', true);
  }

  _tree.bodyHeight = function (h) {
    bodyHeight = h;
    return _tree;
  };

  _tree.keyDef = function (f) {
    keyDef = f;
    return _tree;
  };

  _tree.defaultLevel = function (lv) {
    defaultLevel = lv;
    return _tree;
  };

  _tree.nodeEnterFactory = function (f) {
    nodeEnterFactory = f;
    return _tree;
  };

  _tree.nodeMergeFactory = function (f) {
    nodeMergeFactory = f;
    return _tree;
  };

  return _tree;
}
933124
function Frame(fun) {
    var defer;
    var tick;
    var isCancel =false;

    /**
     * 执行帧
     * @method request
     * @instance
     * @memberOf lib.animation~Frame
     * @return {lib.animation~Frame} 当前实例
     */
    this.request = function() {
        isCancel = false;
        var args = arguments;

        defer = PromiseDefer();
        PromiseMixin(defer.promise, this);

        tick = requestAnimationFrame(function() {
            if (isCancel) return;
            defer && defer.resolve(fun.apply(win, args));
        });

        return this;
    }

    /**
     * 取消执行
     * @method cancel
     * @instance
     * @memberOf lib.animation~Frame
     * @return {lib.animation~Frame} 当前实例
     */
    this.cancel = function() {
        if (tick) {
            isCancel = true;
            cancelAnimationFrame(tick);
            defer && defer.reject('CANCEL');
        }

        return this;
    }

    /**
     * 复制一个帧实例
     * @method clone
     * @instance
     * @memberOf lib.animation~Frame
     * @return {lib.animation~Frame} 新实例
     */
    this.clone = function() {
        return new Frame(fun);
    }
}
842528
function(r /*, a[, b[, ...]] */) {

		// Get the arguments as an array but ommit the initial item
		Array.prototype.slice.call(arguments, 1).forEach(function(a) {
			if (Array.isArray(r) && Array.isArray(a)) {
				Array.prototype.push.apply(r, a);
			}
			else if (r && (r instanceof Object || typeof r === 'object') && a && (a instanceof Object || typeof a === 'object') && r !== a) {
				for (var x in a) {
					r[x] = hello.utils.extend(r[x], a[x]);
				}
			}
			else {

				if (Array.isArray(a)) {
					// Clone it
					a = a.slice(0);
				}

				r = a;
			}
		});

		return r;
	}
212822
function readNumber(walker) {
    var match = walker.match(/\s*(-?[0-9]+(\.[0-9]+)?)/g, 1);

    if (match) {
        return {
            type: ExprType.NUMBER,
            value: +match[1]
        };
    }
    else if (walker.currentCode() === 45) {
        walker.go(1);
        return {
            type: ExprType.UNARY,
            expr: readUnaryExpr(walker),
            operator: 45
        };
    }
}
462822
function(walk) {
    return this.tryBracing(walk, '`', '`', function(w) {
      this.out.push("<code>");
      while (w.hasCurrent())
        this.emitCode(w);
      this.out.push("</code>");
    });
  }
537081
function(obj) {

        if (Array.isArray(obj)) {

            return {

                at: function(skip, pos) { return obj[pos] },
                rest: function(skip, pos) { return obj.slice(pos) }
            };
        }

        var iter = toObject(obj)[Symbol.iterator]();

        return {

            at: function(skip) {

                var r;

                while (skip--)
                    r = iter.next();

                return r.value;
            },

            rest: function(skip) {

                var a = [], r;

                while (--skip)
                    r = iter.next();

                while (r = iter.next(), !r.done)
                    a.push(r.value);

                return a;
            }
        };
    }
784752
function depth(root) {
	let i = 0;
	let walker = document.createTreeWalker(root, 0xFFFFFFFF, {
		acceptNode: function(node){
			let nt = node.nodeType;
			return nt === 1 || nt === 3;
		}
	});

	while(walker.nextNode()) {
		i++;
	}
	return i;
}
1232116
function (x) {
        if (x.length === 2) {
            return new THREE.Vector2(x[0], x[1]);
        } else if (x.length === 3) {
            return new THREE.Vector3(x[0], x[1], x[2]);
        }
    }
336809
function (format, params, name, traversePath) {
      this._sortParams(params);
      traversePath = traversePath || [];
      switch (format) {
        case 0: // 哈希
          var result = {};
          var pathNodeNum = null;
          params.forEach(function (param) {
            pathNodeNum = traversePath.length;
            if (!param.ignored) {//如果有忽略则不显示范例
              result[param.name] = this._getMockByParam(param, traversePath);
            }
            traversePath.length = pathNodeNum;
          }, this);
          return result;
        case 1: // 枚举
          return this._getEnumMock(params);
        case 2: // 数组
          // params[0] 存的是数组元素的类型
          return this._getArrayMockByArrEleType(params[0], 3, traversePath);
        case 3: // 字符
        case 4: // 数值
        case 5: // 布尔
          var sysDatatype = {
            id: format == 3 ? 10001 : format == 4 ? 10002 : 10003,
            name: name
          };
          if (params.length == 1) {
            // 自定义类型, 要考虑默认值和生成规则
            // 系统类型的 params 参数为空数组
            var param = params[0];
            sysDatatype = Object.assign(sysDatatype, {
              defaultValue: param.defaultValue,
              genExpression: param.genExpression
            });
          }
          return this._getMockOfSysDatatype(sysDatatype);
        case 6: // 文件
          return '<File>';
        default:
          break;
      }
    }
772798
function getter_THREE_SpriteMaterial(inst) {
	return [
		inst.name,
		inst.side,
		inst.opacity,
		inst.blending,
		inst.blendSrc,
		inst.blendDst,
		inst.blendEquation,
		inst.depthFunc,
		inst.polygonOffsetFactor,
		inst.polygonOffsetUnits,
		inst.alphaTest,
		inst.overdraw,
		inst.blendSrcAlpha,
		inst.blendDstAlpha,
		inst.blendEquationAlpha,
		inst.transparent,
		inst.depthTest,
		inst.depthWrite,
		inst.colorWrite,
		inst.polygonOffset,
		inst.visible,
		inst.precision,
		inst.color,
		inst.map,
		inst.rotation,
		inst.fog];
}