MCPcopy
hub / github.com/asm-js/validator / split

Function split

lib/validate.js:35–49  ·  view source on GitHub ↗
(nodes, filters)

Source from the content-addressed store, hash-verified

33
34// ([AST], [{ name: string, type: string }]) -> { string: AST, ... }
35function split(nodes, filters) {
36 var result = {};
37 var nNodes = nodes.length, nFilters = filters.length;
38 var iNode = 0;
39 for (var iFilter = 0; iFilter < nFilters; iFilter++) {
40 var filter = filters[iFilter];
41 var next = [];
42 while (iNode < nNodes && nodes[iNode].type === filter.type) {
43 next.push(nodes[iNode]);
44 iNode++;
45 }
46 result[filter.name] = next;
47 }
48 return result;
49}
50
51// (string) -> boolean
52function hasDot(s) {

Callers 1

validate.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected