MCPcopy Index your code
hub / github.com/csev/py4e / lookup

Function lookup

tools/pythonauto/static/codemirror/codemirror.js:3688–3704  ·  view source on GitHub ↗
(map)

Source from the content-addressed store, hash-verified

3686
3687 function lookupKey(name, maps, handle) {
3688 function lookup(map) {
3689 map = getKeyMap(map);
3690 var found = map[name];
3691 if (found === false) return "stop";
3692 if (found != null && handle(found)) return true;
3693 if (map.nofallthrough) return "stop";
3694
3695 var fallthrough = map.fallthrough;
3696 if (fallthrough == null) return false;
3697 if (Object.prototype.toString.call(fallthrough) != "[object Array]")
3698 return lookup(fallthrough);
3699 for (var i = 0, e = fallthrough.length; i < e; ++i) {
3700 var done = lookup(fallthrough[i]);
3701 if (done) return done;
3702 }
3703 return false;
3704 }
3705
3706 for (var i = 0; i < maps.length; ++i) {
3707 var done = lookup(maps[i]);

Callers 1

lookupKeyFunction · 0.70

Calls 1

getKeyMapFunction · 0.70

Tested by

no test coverage detected