Support native e-TeX middle delimiters and math segments

This commit is contained in:
gloamxun committed 2026-11-29 02:05:21 +08:00
1 parent e3be6dcd09
commit 91bb864d8c
8 files changed
+134 -27

No files matched your search

@@ -320,6 +320,7 @@ pub enum Primitive {
Delimiter,
Radical,
Left,
Middle,
Right,
Mathchar,
Char,
@@ -1624,6 +1625,7 @@ impl State {
use Primitive::*;
self.profile = Profile::EtexBootstrap;
self.install_line_penalty_primitives();
self.install_middle_command();
self.install_primitive_commands();
let hook = TokenParameter::Everyeof;
self.command_bindings_mut().insert(
@@ -1900,6 +1902,14 @@ impl State {
}
}
pub(super) fn install_middle_command(&mut self) {
self.update_profile_command(
"middle",
Meaning::Primitive(Primitive::Middle),
self.profile == Profile::EtexBootstrap,
);
}
pub(super) fn restore_legacy_etex_parameter(&mut self, parameter: Parameter) {
if self.profile == Profile::EtexBootstrap {
self.command_bindings_mut()