MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / parseAndCollect

Function parseAndCollect

src/platform/node-hyperscript.js:157–174  ·  view source on GitHub ↗
(source, offset, region)

Source from the content-addressed store, hash-verified

155 }
156
157 function parseAndCollect(source, offset, region) {
158 var result;
159 try {
160 result = _hyperscript.parse(source);
161 } catch (e) {
162 // Tokenizer can throw on unterminated strings, etc.
163 errors.push(formatError(filePath, content, {
164 message: e.message,
165 token: { start: 0, value: '', line: 1, column: 0 },
166 }, offset, region));
167 return;
168 }
169 if (result.errors?.length) {
170 for (const err of result.errors) {
171 errors.push(formatError(filePath, content, err, offset, region));
172 }
173 }
174 }
175 return errors;
176}
177

Callers 1

validateFileFunction · 0.70

Calls 2

formatErrorFunction · 0.70
parseMethod · 0.45

Tested by

no test coverage detected