MCPcopy
hub / github.com/digitalbazaar/jsonld.js / argument

Function argument

tests/webidl/WebIDLParser.js:265–309  ·  view source on GitHub ↗
(store)

Source from the content-addressed store, hash-verified

263 };
264
265 var argument = function(store) {
266 var ret = { optional: false, variadic: false };
267 ret.extAttrs = extended_attrs(store);
268 all_ws(store, "pea");
269 var opt_token = consume(ID, "optional");
270 if (opt_token) {
271 ret.optional = true;
272 all_ws();
273 }
274 ret.idlType = type_with_extended_attributes();
275 if (!ret.idlType) {
276 if (opt_token) tokens.unshift(opt_token);
277 return;
278 }
279 var type_token = last_token;
280 if (!ret.optional) {
281 all_ws();
282 if (tokens.length >= 3 &&
283 tokens[0].type === "other" && tokens[0].value === "." &&
284 tokens[1].type === "other" && tokens[1].value === "." &&
285 tokens[2].type === "other" && tokens[2].value === "."
286 ) {
287 tokens.shift();
288 tokens.shift();
289 tokens.shift();
290 ret.variadic = true;
291 }
292 }
293 all_ws();
294 var name = consume(ID);
295 if (!name) {
296 if (opt_token) tokens.unshift(opt_token);
297 tokens.unshift(type_token);
298 return;
299 }
300 ret.name = name.value;
301 if (ret.optional) {
302 all_ws();
303 var dflt = default_();
304 if (typeof dflt !== "undefined") {
305 ret["default"] = dflt;
306 }
307 }
308 return ret;
309 };
310
311 var argument_list = function(store) {
312 var ret = [],

Callers 1

argument_listFunction · 0.85

Calls 5

extended_attrsFunction · 0.85
all_wsFunction · 0.85
consumeFunction · 0.85
default_Function · 0.85

Tested by

no test coverage detected