(state, nodeIndent)
| 11703 | } |
| 11704 | |
| 11705 | function readFlowCollection(state, nodeIndent) { |
| 11706 | var readNext = true, |
| 11707 | _line, |
| 11708 | _tag = state.tag, |
| 11709 | _result, |
| 11710 | _anchor = state.anchor, |
| 11711 | following, |
| 11712 | terminator, |
| 11713 | isPair, |
| 11714 | isExplicitPair, |
| 11715 | isMapping, |
| 11716 | overridableKeys = {}, |
| 11717 | keyNode, |
| 11718 | keyTag, |
| 11719 | valueNode, |
| 11720 | ch; |
| 11721 | |
| 11722 | ch = state.input.charCodeAt(state.position); |
| 11723 | |
| 11724 | if (ch === 0x5B/* [ */) { |
| 11725 | terminator = 0x5D;/* ] */ |
| 11726 | isMapping = false; |
| 11727 | _result = []; |
| 11728 | } else if (ch === 0x7B/* { */) { |
| 11729 | terminator = 0x7D;/* } */ |
| 11730 | isMapping = true; |
| 11731 | _result = {}; |
| 11732 | } else { |
| 11733 | return false; |
| 11734 | } |
| 11735 | |
| 11736 | if (state.anchor !== null) { |
| 11737 | state.anchorMap[state.anchor] = _result; |
| 11738 | } |
| 11739 | |
| 11740 | ch = state.input.charCodeAt(++state.position); |
| 11741 | |
| 11742 | while (ch !== 0) { |
| 11743 | skipSeparationSpace(state, true, nodeIndent); |
| 11744 | |
| 11745 | ch = state.input.charCodeAt(state.position); |
| 11746 | |
| 11747 | if (ch === terminator) { |
| 11748 | state.position++; |
| 11749 | state.tag = _tag; |
| 11750 | state.anchor = _anchor; |
| 11751 | state.kind = isMapping ? 'mapping' : 'sequence'; |
| 11752 | state.result = _result; |
| 11753 | return true; |
| 11754 | } else if (!readNext) { |
| 11755 | throwError(state, 'missed comma between flow collection entries'); |
| 11756 | } |
| 11757 | |
| 11758 | keyTag = keyNode = valueNode = null; |
| 11759 | isPair = isExplicitPair = false; |
| 11760 | |
| 11761 | if (ch === 0x3F/* ? */) { |
| 11762 | following = state.input.charCodeAt(state.position + 1); |
no test coverage detected