MCPcopy Index your code
hub / github.com/witheve/Eve / next

Function next

src/commonmark.js:2019–2051  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2017};
2018
2019var next = function(){
2020 var cur = this.current;
2021 var entering = this.entering;
2022
2023 if (cur === null) {
2024 return null;
2025 }
2026
2027 var container = isContainer(cur);
2028
2029 if (entering && container) {
2030 if (cur._firstChild) {
2031 this.current = cur._firstChild;
2032 this.entering = true;
2033 } else {
2034 // stay on node but exit
2035 this.entering = false;
2036 }
2037
2038 } else if (cur === this.root) {
2039 this.current = null;
2040
2041 } else if (cur._next === null) {
2042 this.current = cur._parent;
2043 this.entering = false;
2044
2045 } else {
2046 this.current = cur._next;
2047 this.entering = true;
2048 }
2049
2050 return {entering: entering, node: cur};
2051};
2052
2053var NodeWalker = function(root) {
2054 return { current: root,

Callers

nothing calls this directly

Calls 1

isContainerFunction · 0.85

Tested by

no test coverage detected