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

Function union_type

tests/webidl/WebIDLParser.js:237–252  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

235 };
236
237 var union_type = function() {
238 all_ws();
239 if (!consume(OTHER, "(")) return;
240 var ret = { sequence: false, generic: null, nullable: false, array: false, union: true, idlType: [] };
241 var fst = type_with_extended_attributes() || error("Union type with no content");
242 ret.idlType.push(fst);
243 while (true) {
244 all_ws();
245 if (!consume(ID, "or")) break;
246 var typ = type_with_extended_attributes() || error("No type after 'or' in union type");
247 ret.idlType.push(typ);
248 }
249 if (!consume(OTHER, ")")) error("Unterminated union type");
250 type_suffix(ret);
251 return ret;
252 };
253
254 var type = function() {
255 return single_type() || union_type();

Callers 2

typeFunction · 0.85

Calls 5

all_wsFunction · 0.85
consumeFunction · 0.85
errorFunction · 0.85
type_suffixFunction · 0.85

Tested by

no test coverage detected