def atomic_lex

qasim-bend-kit@0.1.0.2 · proof/JSON_RenderLexProof.bend:251

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

251def atomic_lex(+atom: SP.AtomicValue,
252               +mode: SP.RenderMode,
253               +boundary: Boundary,
254               +acc: List<&2, J.Lexeme>) -> {J.lex_scan(SP.render_task(SP.atomic_value(atom), mode, boundary_text(boundary)), J.Outside{}, SNil{}, acc) == finish(boundary, push(SP.atomic_value(atom), mode, acc)) : List<&2, J.Lexeme>}:
255    match boundary:
256        case End{}: atomic_mode_end(atom, mode, acc)
257        case Delimited{mark, suffix}:
258            Equal.trans(List<&2, J.Lexeme>,
259                J.lex_scan(SP.render_task(SP.atomic_value(atom), mode, boundary_text(Delimited{mark, suffix})), J.Outside{}, SNil{}, acc),
260                J.lex_scan(suffix, J.Outside{}, SNil{}, J.Punctuation{SP.punctuation_char(mark)} <> List.append(&2, J.Lexeme, SP.reverse_source_task(SP.atomic_value(atom), mode), acc)),
261                finish(Delimited{mark, suffix}, push(SP.atomic_value(atom), mode, acc)),
262                SP.lex_simple_task_suffix_before_punctuation(SP.SimpleAtom{atom}, mode, SP.punctuation_char(mark), suffix, acc, SP.punctuation_action(mark, suffix)),
263                Equal.cong(List<&2, J.Lexeme>, List<&2, J.Lexeme>,
264                    x => finish(Delimited{mark, suffix}, x),
265                    List.append(&2, J.Lexeme, SP.reverse_source_task(SP.atomic_value(atom), mode), acc),
266                    push(SP.atomic_value(atom), mode, acc),
267                    Equal.sym(List<&2, J.Lexeme>,
268                        push(SP.atomic_value(atom), mode, acc),
269                        List.append(&2, J.Lexeme, SP.reverse_source_task(SP.atomic_value(atom), mode), acc),
270                        push_append(SP.atomic_value(atom), mode, acc))))

Uses (24)

Used by (1)