def trailing_return
qasim-bend-kit@0.1.0.2 · proof/JSON_LexWhitespaceProof.bend:531
import qasim-bend-kit@0.1.0.2/proof/JSON_LexWhitespaceProof.bend as JSONLexWhitespaceProof
import Base
import qasim-bend-kit@0.1.0.2/libs/JSON.bend as J
531def trailing_return(+text: String,
532 +mode: J.LexMode,
533 +reversed: String,
534 +acc: List<&2, J.Lexeme>) -> {J.lex_scan(text ++ "\r", mode, reversed, acc) == J.lex_scan(text, mode, reversed, acc) : List<&2, J.Lexeme>}:
535 match text:
536 case SNil{}:
537 match mode:
538 case J.Outside{}: {==}
539 case J.Quoted{}: {==}
540 case J.Escaped{}: {==}
541 case SCon{head, tail}:
542 Equal.trans(List<&2, J.Lexeme>, J.lex_scan(SCon{head, tail} ++ "\r", mode, reversed, acc),
543 J.lex_scan(tail ++ "\r", after_mode(J.lex_seed_action(SCon{head, tail}, mode), mode),
544 after_reversed(J.lex_seed_action(SCon{head, tail}, mode), head, reversed),
545 after_acc(J.lex_seed_action(SCon{head, tail}, mode), head, reversed, acc)),
546 J.lex_scan(SCon{head, tail}, mode, reversed, acc),
547 lex_scan_step(head, tail ++ "\r", mode, reversed, acc),
548 Equal.trans(List<&2, J.Lexeme>,
549 J.lex_scan(tail ++ "\r", after_mode(J.lex_seed_action(SCon{head, tail}, mode), mode),
550 after_reversed(J.lex_seed_action(SCon{head, tail}, mode), head, reversed),
551 after_acc(J.lex_seed_action(SCon{head, tail}, mode), head, reversed, acc)),
552 J.lex_scan(tail, after_mode(J.lex_seed_action(SCon{head, tail}, mode), mode),
553 after_reversed(J.lex_seed_action(SCon{head, tail}, mode), head, reversed),
554 after_acc(J.lex_seed_action(SCon{head, tail}, mode), head, reversed, acc)),
555 J.lex_scan(SCon{head, tail}, mode, reversed, acc),
556 trailing_return(tail, after_mode(J.lex_seed_action(SCon{head, tail}, mode), mode),
557 after_reversed(J.lex_seed_action(SCon{head, tail}, mode), head, reversed),
558 after_acc(J.lex_seed_action(SCon{head, tail}, mode), head, reversed, acc)),
559 Equal.sym(List<&2, J.Lexeme>, J.lex_scan(SCon{head, tail}, mode, reversed, acc),
560 J.lex_scan(tail, after_mode(J.lex_seed_action(SCon{head, tail}, mode), mode),
561 after_reversed(J.lex_seed_action(SCon{head, tail}, mode), head, reversed),
562 after_acc(J.lex_seed_action(SCon{head, tail}, mode), head, reversed, acc)),
563 lex_scan_step(head, tail, mode, reversed, acc))))