MCPcopy
hub / github.com/ternjs/tern / parseLabelList

Function parseLabelList

plugin/doc_comment.js:210–233  ·  view source on GitHub ↗
(scope, str, pos, close)

Source from the content-addressed store, hash-verified

208 }
209
210 function parseLabelList(scope, str, pos, close) {
211 var labels = [], types = [], madeUp = false;
212 for (var first = true; ; first = false) {
213 pos = skipSpace(str, pos);
214 if (first && str.charAt(pos) == close) break;
215 var colon = str.indexOf(":", pos);
216 if (colon < 0) return null;
217 var label = str.slice(pos, colon);
218 if (!isIdentifier(label)) return null;
219 labels.push(label);
220 pos = colon + 1;
221 var type = parseType(scope, str, pos);
222 if (!type) return null;
223 pos = type.end;
224 madeUp = madeUp || type.madeUp;
225 types.push(type.type);
226 pos = skipSpace(str, pos);
227 var next = str.charAt(pos);
228 ++pos;
229 if (next == close) break;
230 if (next != ",") return null;
231 }
232 return {labels: labels, types: types, end: pos, madeUp: madeUp};
233 }
234
235 function parseTypeAtom(scope, str, pos) {
236 var result = parseTypeInner(scope, str, pos);

Callers 1

parseTypeInnerFunction · 0.85

Calls 3

skipSpaceFunction · 0.85
isIdentifierFunction · 0.85
parseTypeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…