读取字符串

@param {Walker} walker 源码读取对象
@return {Object}
778428
function readString(walker) {
    var startCode = walker.currentCode();
    var startIndex = walker.index;
    var charCode;

    walkLoop: while ((charCode = walker.nextCode())) {
        switch (charCode) {
            case 92: // \
                walker.go(1);
                break;
            case startCode:
                walker.go(1);
                break walkLoop;
        }
    }

    var literal = walker.cut(startIndex, walker.index);
    return {
        type: ExprType.STRING,
        // 处理字符转义
        value: (new Function('return ' + literal))()
    };
}
609741
function promiseGenerator(arr) {
  const data = [];
  const last = Symbol('last');
  
  // 添加迭代队列，以获取最后一次的promise执行结果
  arr.push(last);

  return arr.reduce((sum, value, index) => {
    return sum.then((result) => {
      // 忽略初始数据，即Promise.resolve()的返回数据
      if (index !== 0) data.push(result);

      // 如果到最后一个节点，则完成迭代，返回总体数据
      if (value === last) return data;

      return value();
    })
  }, Promise.resolve())
}
1089822
function () {
      var path = Immutable.List();
      for (var i = 0; i < arguments.length; i++) {
        path = path.concat(arguments[i]);
      }
      return this.state.getIn(path);
    }
1104012
def triggered(self, walker):
        

        if self.use_count:
            comp_value = walker.count()
        else:
            if walker.count() == 0:
                return False

            comp_value = walker.peek().value

        return self.comp_function(comp_value, self.reference)
618446
function walkBemJson(bemJson, cb) {
  let result;

  if (Array.isArray(bemJson)) {
    result = [];
    bemJson.forEach((childBemJson, i) => {
      result[i] = walkBemJson(childBemJson, cb);
    });
  } else if (bemJson instanceof Object) {
    result = {};
    Object.keys(bemJson).forEach((key) => {
      result[key] = walkBemJson(bemJson[key], cb);
    });
  } else if (typeof bemJson === 'string') {
    result = cb(bemJson);
  }

  return result;
}
343528
function _walkResetEmiter (ins, em, _pem) {
    if ($type(ins) == OBJECT) {
        var items = ins
        if (instanceOf(ins, Mux)) {
            ins._$emitter(em, _pem)
            items = ins.$props()
        }
        $util.objEach(items, function (k, v) {
            _walkResetEmiter(v, em, _pem)
        })
    } else if ($type(ins) == ARRAY) {
        ins.forEach(function (v) {
            _walkResetEmiter(v, em, _pem)
        })
    }
}
93167
function spinner(promise, text = 'loading', spinnerIcon = 'monkey') {
    const spinner = ora({ spinner: spinnerIcon, text }).start();
    return new Promise((resolve, reject) => {
        promise
            .then(resolved => {
                spinner.stop();
                resolve(resolved);
            })
            .catch(err => {
                spinner.stop();
                reject(err);
            });
    });
}
317318
function getValue(item, keyOrPath) {
  const keys = keyOrPath.split('.');
  const used = [];
  while (keys.length > 0) {
    const key = keys.shift();
    used.push(key);
    if (!isValid(item[key])) {
      throw new Error(`path ${used.join('.')} is not an object`);
    }
    item = item[key];
  }
  return item[keys[0]];
}
879330
def _make_walker(self, *args, **kwargs):
        # type: (*Any, **Any) -> Walker
        
        walker = self.walker_class(*args, **kwargs)
        return walker
716082
def query_walkers():
    """"""
    return [
        import_string(walker)() if isinstance(walker, six.string_types)
        else walker() for walker in current_app.config[
            'COLLECTIONS_QUERY_WALKERS']
    ]
889140
function elementOrComponent (node, walker) {
    // we should generate sth like
    // n.elt("div", {e1:[0,0,"arg"]}, {"title":["",1]}, 0, [...])
    var attributeContent = "0", eventContent = "0", exprCode = "0", attributes = node.attributes, length = attributes.length;
    if (length > 0) {
        var list, attributeName, attributesList = [], eventList = [], exprList = [], attribute, type, exprIndex = 1;

        for (var i = 0; length > i; i++) {
            attribute = attributes[i];
            list = attributesList;
            attributeName = attribute.name;
            if (attribute.name.match(/^on/i)) {
                // this is an event handler
                list = eventList;
                attributeName = attribute.name.slice(2);
            }

            type = attribute.type;
            if (type === "text") {
                list.push('"' + attributeName + '":"' + attribute.value.replace(/"/g, "\\\"") + '"');
            } else if (type === "expression") {
                var expr = formatExpression(attribute, exprIndex, walker);
                exprIndex = expr.nextIndex;
                exprList.push(expr.code);
                if (list === eventList) {
                    list.push('"' + attributeName + '":' + expr.exprIdx);
                } else {
                    list.push('"' + attributeName + '":["",' + expr.exprIdx + ']');
                }
            } else if (type === "textblock") {
                var textBlock = formatTextBlock(attribute, exprIndex, walker);
                exprIndex = textBlock.nextIndex;
                if (textBlock.exprArg !== '0') {
                    exprList.push(textBlock.exprArg.slice(1, -1));
                }
                list.push('"' + attributeName + '":' + textBlock.blockArgs);
            } else if (type === "name") {
                list.push('"' + attributeName + '":null');
            } else {
                walker.logError("Invalid attribute type: " + type);
            }
        }
        if (attributesList.length) {
            attributeContent = "{" + attributesList.join(',') + "}";
        }
        if (eventList.length) {
            eventContent = "{" + eventList.join(',') + "}";
        }
        exprCode = exprList.length === 0 ? "0" : "{" + exprList.join(',') + "}";
    }

    var content = '';
    if (node.content && node.content.length) {
        content = ',[' + walker.walk(node.content, module.exports).join(",") + ']';
    }

    return [exprCode, ',', attributeContent, ',', eventContent, content].join('');
}
1365950
function walk (newNode, oldNode) {
  // if (DEBUG) {
  //   console.log(
  //   'walk\nold\n  %s\nnew\n  %s',
  //   oldNode && oldNode.outerHTML,
  //   newNode && newNode.outerHTML
  // )
  // }
  if (!oldNode) {
    return newNode
  } else if (!newNode) {
    return null
  } else if (newNode.isSameNode && newNode.isSameNode(oldNode)) {
    return oldNode
  } else if (newNode.tagName !== oldNode.tagName) {
    return newNode
  } else {
    _$morph_11(newNode, oldNode)
    updateChildren(newNode, oldNode)
    return oldNode
  }
}
844235
function get ( keypath ) {
  	if ( !keypath ) return this._element.parentFragment.findContext().get( true );

  	var model = resolveReference( this._element.parentFragment, keypath );

  	return model ? model.get( true ) : undefined;
  }
430003
function tokenize() {
		var ch = walker.ch;
	
		if (ch === " " || ch === "\t") {
			return white();
		}

		if (ch === '/') {
			return comment();
		} 

		if (ch === '"' || ch === "'") {
			return str();
		}
		
		if (ch === '(') {
			return brace();
		}
	
		if (ch === '-' || ch === '.' || isDigit(ch)) { // tricky - char: minus (-1px) or dash (-moz-stuff)
			return num();
		}
	
		if (isNameChar(ch)) {
			return identifier();
		}

		if (isOp(ch)) {
			return op();
		}

		if (ch === '\r') {
			if (walker.peek() === '\n') {
				ch += walker.nextChar();
			}

			tokener(ch, 'line');
			walker.nextChar();
			return;
		}
		
		if (ch === '\n') {
			tokener(ch, 'line');
			walker.nextChar();
			return;
		}
		
		raiseError("Unrecognized character '" + ch + "'");
	}
913173
def _walker(self, path):
        """"""
        for root, dnames, fnames in _walk(self.recursion)(path):
            yield (root, dnames, fnames)
862379
function(arg, handler) {
		handler = handler ? handler : this.spirit;
		gui.Array.make(arg).forEach(function(type) {
			if (this._addchecks(type, [handler])) {
				if (!this._handlers[type]) {
					this._handlers[type] = [];
				}
				this._handlers[type].push(handler);
			}
		}, this);
		return this.spirit;
	}
142823
function wrap(walker) {
  /**
   * @param {string} path
   * @param {RegExp|string|string[]} [pattern=/./]
   * @param {number} [depth=0]
   */
  return (path, pattern = /./, depth = 0) => {
    if (pattern instanceof RegExp) {
      // nothing to do
    } else if (typeof pattern === 'string') {
      pattern = RegExp(`${escapeRegexp(pattern)}$`, 'i');
    } else if (pattern instanceof Array) {
      pattern = `(?:${pattern.map(escapeRegexp).join('|')})$`;
      pattern = RegExp(pattern, 'i');
    } else {
      pattern = /./;
    }
    return walker(path, pattern, depth);
  };
}