MCPcopy
hub / github.com/IvanMathy/Boop / readBlockSequence

Function readBlockSequence

Boop/Boop/scripts/lib/js-yaml.js:1918–1978  ·  view source on GitHub ↗
(state, nodeIndent)

Source from the content-addressed store, hash-verified

1916}
1917
1918function readBlockSequence(state, nodeIndent) {
1919 var _line,
1920 _tag = state.tag,
1921 _anchor = state.anchor,
1922 _result = [],
1923 following,
1924 detected = false,
1925 ch;
1926
1927 if (state.anchor !== null) {
1928 state.anchorMap[state.anchor] = _result;
1929 }
1930
1931 ch = state.input.charCodeAt(state.position);
1932
1933 while (ch !== 0) {
1934
1935 if (ch !== 0x2D/* - */) {
1936 break;
1937 }
1938
1939 following = state.input.charCodeAt(state.position + 1);
1940
1941 if (!is_WS_OR_EOL(following)) {
1942 break;
1943 }
1944
1945 detected = true;
1946 state.position++;
1947
1948 if (skipSeparationSpace(state, true, -1)) {
1949 if (state.lineIndent <= nodeIndent) {
1950 _result.push(null);
1951 ch = state.input.charCodeAt(state.position);
1952 continue;
1953 }
1954 }
1955
1956 _line = state.line;
1957 composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
1958 _result.push(state.result);
1959 skipSeparationSpace(state, true, -1);
1960
1961 ch = state.input.charCodeAt(state.position);
1962
1963 if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
1964 throwError(state, 'bad indentation of a sequence entry');
1965 } else if (state.lineIndent < nodeIndent) {
1966 break;
1967 }
1968 }
1969
1970 if (detected) {
1971 state.tag = _tag;
1972 state.anchor = _anchor;
1973 state.kind = 'sequence';
1974 state.result = _result;
1975 return true;

Callers 1

composeNodeFunction · 0.85

Calls 4

is_WS_OR_EOLFunction · 0.85
skipSeparationSpaceFunction · 0.85
composeNodeFunction · 0.85
throwErrorFunction · 0.85

Tested by

no test coverage detected