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

Function all_ws

tests/webidl/WebIDLParser.js:84–118  ·  view source on GitHub ↗
(store, pea)

Source from the content-addressed store, hash-verified

82 };
83
84 var all_ws = function(store, pea) { // pea == post extended attribute, tpea = same for types
85 var t = { type: "whitespace", value: "" };
86 while (true) {
87 var w = ws();
88 if (!w) break;
89 t.value += w.value;
90 }
91 if (t.value.length > 0) {
92 if (store) {
93 var w = t.value,
94 re = {
95 "ws": /^([\t\n\r ]+)/,
96 "line-comment": /^\/\/(.*)\n?/m,
97 "multiline-comment": /^\/\*((?:.|\n|\r)*?)\*\//
98 },
99 wsTypes = [];
100 for (var k in re) wsTypes.push(k);
101 while (w.length) {
102 var matched = false;
103 for (var i = 0, n = wsTypes.length; i < n; i++) {
104 var type = wsTypes[i];
105 w = w.replace(re[type], function(tok, m1) {
106 store.push({ type: type + (pea ? ("-" + pea) : ""), value: m1 });
107 matched = true;
108 return "";
109 });
110 if (matched) break;
111 }
112 if (matched) continue;
113 throw new Error("Surprising white space construct."); // this shouldn't happen
114 }
115 }
116 return t;
117 }
118 };
119
120 var integer_type = function() {
121 var ret = "";

Callers 15

integer_typeFunction · 0.85
float_typeFunction · 0.85
primitive_typeFunction · 0.85
type_suffixFunction · 0.85
single_typeFunction · 0.85
union_typeFunction · 0.85
argumentFunction · 0.85
argument_listFunction · 0.85
simple_extended_attrFunction · 0.85
extended_attrsFunction · 0.85
default_Function · 0.85
const_Function · 0.85

Calls 1

wsFunction · 0.85

Tested by

no test coverage detected