MCPcopy
hub / github.com/parinfer/parinfer.js / parseErrorLine

Function parseErrorLine

testParsingLib.js:266–284  ·  view source on GitHub ↗
(result, inputLineNo, outputLineNo, input)

Source from the content-addressed store, hash-verified

264// ------------------------------------------------------------------------------
265
266function parseErrorLine (result, inputLineNo, outputLineNo, input) {
267 var match = input.match(/^\s*\^\s*error: ([a-z-]+)\s*$/)
268 if (!match) {
269 return false
270 }
271 if (result.error) {
272 throw error(inputLineNo, 'only one error can be specified')
273 }
274 var x = input.indexOf('^')
275 if (result.cursorLine === outputLineNo && result.cursorX < x) {
276 x--
277 }
278 result.error = {
279 name: match[1],
280 lineNo: outputLineNo,
281 x: x
282 }
283 return true
284}
285
286function parseTabStopsLine (result, inputLineNo, outputLineNo, input) {
287 var match = input.match(/^([\^>\s]+)tabStops?\s*$/)

Callers 1

parseOutputFunction · 0.85

Calls 1

errorFunction · 0.70

Tested by

no test coverage detected