MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / __hsParseAndWalk

Function __hsParseAndWalk

tools/common/tree-walker.js:47–66  ·  view source on GitHub ↗
(src)

Source from the content-addressed store, hash-verified

45}
46
47function __hsParseAndWalk(src) {
48 var result = self._hyperscript.parse(src);
49 var errors = (result && result.errors) || [];
50 var items = [];
51 for (var i = 0; i < errors.length; i++) {
52 var e = errors[i];
53 var tok = e.token || {};
54 items.push({
55 message: e.message || 'Parse error',
56 expected: e.expected || null,
57 line: tok.line || null,
58 column: tok.column || null,
59 start: (tok.start != null) ? tok.start : null,
60 end: (tok.end != null) ? tok.end : null
61 });
62 }
63 var tree = __hsWalkTree(result, new Set());
64 var ok = items.length === 0;
65 return { ok: ok, errors: items, tree: tree };
66}

Callers 1

__hsGetCompletionsFunction · 0.70

Calls 2

__hsWalkTreeFunction · 0.70
parseMethod · 0.45

Tested by

no test coverage detected