MCPcopy Index your code
hub / github.com/Effect-TS/effect / failsOnFirstLine

Function failsOnFirstLine

packages/printer/src/internal/layout.ts:414–447  ·  view source on GitHub ↗
(self: DocStream.DocStream<A>)

Source from the content-addressed store, hash-verified

412 )
413
414const failsOnFirstLine = <A>(self: DocStream.DocStream<A>): boolean => {
415 let stream = self
416 // eslint-disable-next-line no-constant-condition
417 while (1) {
418 switch (stream._tag) {
419 case "FailedStream": {
420 return true
421 }
422 case "EmptyStream": {
423 return false
424 }
425 case "CharStream": {
426 stream = stream.stream
427 break
428 }
429 case "TextStream": {
430 stream = stream.stream
431 break
432 }
433 case "LineStream": {
434 return false
435 }
436 case "PushAnnotationStream": {
437 stream = stream.stream
438 break
439 }
440 case "PopAnnotationStream": {
441 stream = stream.stream
442 break
443 }
444 }
445 }
446 throw new Error("bug")
447}

Callers 1

unboundedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected