2026-07-18 18:48:23 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "katom.h"
|
|
|
|
|
#include "state.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string to_string(std::vector<Katom>::const_iterator begin, std::vector<Katom>::const_iterator end, bool trim_result=false);
|
|
|
|
|
std::string to_string(const std::vector<Katom>& katoms, bool trim_result=false);
|
|
|
|
|
|
|
|
|
|
// std::vector<Katom> process_katoms(
|
|
|
|
|
// const std::string& s, State& state, const std::string& source,
|
|
|
|
|
// bool nonascii=true, bool literal=true, bool ignore=true, bool whitespace=true,
|
|
|
|
|
// bool klammers=true, bool eval=true, bool cond=true, bool read=true);
|
|
|
|
|
|
|
|
|
|
bool level_increase(const Katom& k);
|
|
|
|
|
bool level_decrease(const Katom& k);
|
|
|
|
|
|
|
|
|
|
const katom_list::iterator
|
|
|
|
|
find_katom_named(const katom_list::iterator begin, const katom_list::iterator end, std::string name);
|
|
|
|
|
|
|
|
|
|
const std::vector<Katom>::iterator
|
|
|
|
|
find_katom(const std::vector<Katom>::iterator begin, const std::vector<Katom>::iterator end, size_t index);
|
|
|
|
|
|
|
|
|
|
std::vector<std::pair<Katom, Katom>>
|
|
|
|
|
find_spans(std::vector<Katom>::iterator begin, std::vector<Katom>::iterator end,
|
Klammerset: the @@@klammerset construct, its search path, and const correctness
The @@@klammerset system command formally declares a klammerset — a
named, logically related group of klammer definitions — with an
operative, idempotent declaration (:requires and :files load in order
at the declaration point, relative to the declaring file). A bare
symbol given to ktext -k, kdesc --input, or :requires resolves to
x/x.k on the search path: the document's directory, then
KLAMMERTEXT_KLAMMERSETS, then KLAMMERTEXT_HOME; kdesc --klammerset
lists the available sets. sks/sks.k is the first declared klammerset,
so `-k sks` loads the SKS by name. The engine's lookup classes were
renamed *_set → *_registry to keep the two concepts apart, and the
whole C++ tree now follows standard const-correctness conventions.
tst/ gains klammerset_test.sh (18 cases).
(from dev 64b1abf23e56)
2026-07-30 23:50:07 +02:00
|
|
|
const std::function<bool(const Katom&)>& level_inc,
|
|
|
|
|
const std::function<bool(const Katom&)>& level_dec,
|
2026-07-18 18:48:23 +02:00
|
|
|
bool error_exit,
|
Klammerset: the @@@klammerset construct, its search path, and const correctness
The @@@klammerset system command formally declares a klammerset — a
named, logically related group of klammer definitions — with an
operative, idempotent declaration (:requires and :files load in order
at the declaration point, relative to the declaring file). A bare
symbol given to ktext -k, kdesc --input, or :requires resolves to
x/x.k on the search path: the document's directory, then
KLAMMERTEXT_KLAMMERSETS, then KLAMMERTEXT_HOME; kdesc --klammerset
lists the available sets. sks/sks.k is the first declared klammerset,
so `-k sks` loads the SKS by name. The engine's lookup classes were
renamed *_set → *_registry to keep the two concepts apart, and the
whole C++ tree now follows standard const-correctness conventions.
tst/ gains klammerset_test.sh (18 cases).
(from dev 64b1abf23e56)
2026-07-30 23:50:07 +02:00
|
|
|
const std::string& name);
|
2026-07-18 18:48:23 +02:00
|
|
|
|
|
|
|
|
std::vector<std::pair<Katom, Katom>>
|
|
|
|
|
find_spans(std::vector<Katom>& katoms,
|
Klammerset: the @@@klammerset construct, its search path, and const correctness
The @@@klammerset system command formally declares a klammerset — a
named, logically related group of klammer definitions — with an
operative, idempotent declaration (:requires and :files load in order
at the declaration point, relative to the declaring file). A bare
symbol given to ktext -k, kdesc --input, or :requires resolves to
x/x.k on the search path: the document's directory, then
KLAMMERTEXT_KLAMMERSETS, then KLAMMERTEXT_HOME; kdesc --klammerset
lists the available sets. sks/sks.k is the first declared klammerset,
so `-k sks` loads the SKS by name. The engine's lookup classes were
renamed *_set → *_registry to keep the two concepts apart, and the
whole C++ tree now follows standard const-correctness conventions.
tst/ gains klammerset_test.sh (18 cases).
(from dev 64b1abf23e56)
2026-07-30 23:50:07 +02:00
|
|
|
const std::function<bool(const Katom&)>& level_inc,
|
|
|
|
|
const std::function<bool(const Katom&)>& level_dec,
|
2026-07-18 18:48:23 +02:00
|
|
|
bool error_exit=true,
|
Klammerset: the @@@klammerset construct, its search path, and const correctness
The @@@klammerset system command formally declares a klammerset — a
named, logically related group of klammer definitions — with an
operative, idempotent declaration (:requires and :files load in order
at the declaration point, relative to the declaring file). A bare
symbol given to ktext -k, kdesc --input, or :requires resolves to
x/x.k on the search path: the document's directory, then
KLAMMERTEXT_KLAMMERSETS, then KLAMMERTEXT_HOME; kdesc --klammerset
lists the available sets. sks/sks.k is the first declared klammerset,
so `-k sks` loads the SKS by name. The engine's lookup classes were
renamed *_set → *_registry to keep the two concepts apart, and the
whole C++ tree now follows standard const-correctness conventions.
tst/ gains klammerset_test.sh (18 cases).
(from dev 64b1abf23e56)
2026-07-30 23:50:07 +02:00
|
|
|
const std::string& name="all");
|
2026-07-18 18:48:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
void describe_spans(const std::vector<Katom>& katoms);
|
|
|
|
|
|
|
|
|
|
std::pair<std::vector<Katom>::iterator, std::vector<Katom>::iterator>
|
|
|
|
|
find_span_katoms(std::vector<Katom>& katoms, const Katom& begin, const Katom& end);
|
|
|
|
|
|
|
|
|
|
std::pair<std::vector<Katom>::iterator, std::vector<Katom>::iterator>
|
|
|
|
|
find_span_katoms(
|
|
|
|
|
std::vector<Katom>::iterator kbegin, std::vector<Katom>::iterator kend, const Katom& begin, const Katom& end);
|
|
|
|
|
|
|
|
|
|
void encode_nonascii_characters(std::vector<Katom>& katoms);
|
|
|
|
|
void mark_literal_katoms(std::vector<Katom>& katoms);
|
2026-07-25 21:16:21 +02:00
|
|
|
void hide_special_katoms(std::vector<Katom>& katoms);
|
2026-07-18 18:48:23 +02:00
|
|
|
void mark_ignored_katoms(std::vector<Katom>& katoms);
|
|
|
|
|
|
|
|
|
|
void process_klammer_katoms(std::vector<Katom>& katoms);
|