def lex_atomic_reverse_before_punctuation

qasim-bend-kit@0.1.0.2 · proof/JSON_SourceProof.bend:825

import qasim-bend-kit@0.1.0.2/proof/JSON_SourceProof.bend as JSONSourceProof
import Base
import qasim-bend-kit@0.1.0.2/libs/JSON.bend as J

825def lex_atomic_reverse_before_punctuation(+atom: AtomicValue,
826                                          +punctuation: Char,
827                                          +suffix: String,
828                                          +acc: List<&2, J.Lexeme>,
829                                          action: {J.lex_seed_action(SCon{punctuation, suffix}, J.Outside{}) == J.LexPunctuation{punctuation} : J.LexAction}) -> {J.lex_scan(J.render(atomic_value(atom), False{}, SNil{}) ++ (SCon{punctuation, SNil{}} ++ suffix), J.Outside{}, SNil{}, acc) == J.lex_scan(suffix, J.Outside{}, SNil{}, J.Punctuation{punctuation} <> List.append(&2, J.Lexeme, List.reverse(&2, J.Lexeme, J.source(atomic_value(atom), False{}, Nil{})), acc)) : List<&2, J.Lexeme>}:
830    Equal.trans(List<&2, J.Lexeme>,
831        J.lex_scan(J.render(atomic_value(atom), False{}, SNil{}) ++ (SCon{punctuation, SNil{}} ++ suffix), J.Outside{}, SNil{}, acc),
832        J.lex_scan(suffix, J.Outside{}, SNil{}, J.Punctuation{punctuation} <> List.append(&2, J.Lexeme, atomic_source(atom), acc)),
833        J.lex_scan(suffix, J.Outside{}, SNil{}, J.Punctuation{punctuation} <> List.append(&2, J.Lexeme, List.reverse(&2, J.Lexeme, J.source(atomic_value(atom), False{}, Nil{})), acc)),
834        lex_atomic_source_before_punctuation(atom, punctuation, suffix, acc, action),
835        Equal.cong(List<&2, J.Lexeme>, List<&2, J.Lexeme>, items => J.lex_scan(suffix, J.Outside{}, SNil{}, J.Punctuation{punctuation} <> List.append(&2, J.Lexeme, items, acc)),
836            atomic_source(atom),
837            List.reverse(&2, J.Lexeme, J.source(atomic_value(atom), False{}, Nil{})),
838            atomic_source_reverse(atom)))

Uses (21)

Used by (2)