Bind native format jobs to their validated pdfTeX revision
This commit is contained in:
1 parent
d02777a1fc
commit
75d3667397
4 files changed
+33
-10
No files matched your search
@@ -356,7 +356,6 @@ impl Executor {
|
||||
// Compatibility level for the eight-bit native PDF interface.
|
||||
// This is independent of the Route-D build version.
|
||||
const PDFTEX_VERSION: i32 = 140;
|
||||
const PDFTEX_REVISION: &str = "22";
|
||||
|
||||
pub fn new(state: State, limits: Limits) -> Self {
|
||||
Self {
|
||||
@@ -999,7 +998,7 @@ impl Executor {
|
||||
self.print_tokens(&format!("{digest:X}"), token)?;
|
||||
}
|
||||
}
|
||||
Pdftexrevision => self.print_tokens(Self::PDFTEX_REVISION, token)?,
|
||||
Pdftexrevision => self.print_tokens(self.state.pdftex_revision(), token)?,
|
||||
Etexrevision => self.print_tokens(".6", token)?,
|
||||
Csname => {
|
||||
let name = self.csname(files)?;
|
||||
|
||||
@@ -8,9 +8,9 @@ use std::{
|
||||
sync::{Arc, Mutex, OnceLock, Weak},
|
||||
};
|
||||
|
||||
const SCHEMA: u32 = 50;
|
||||
const COMPATIBLE_SCHEMAS: [u32; 19] = [
|
||||
27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 43, 44, 45, 46, 47, 48, 49, SCHEMA,
|
||||
const SCHEMA: u32 = 51;
|
||||
const COMPATIBLE_SCHEMAS: [u32; 20] = [
|
||||
27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 43, 44, 45, 46, 47, 48, 49, 50, SCHEMA,
|
||||
];
|
||||
const ENGINE: &str = concat!("texrra-native/", env!("CARGO_PKG_VERSION"));
|
||||
|
||||
|
||||
@@ -603,6 +603,16 @@ mod ordered_map {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
|
||||
enum PdftexRevision {
|
||||
// A format created before revision identity was stored bootstrapped with 22.
|
||||
#[default]
|
||||
#[serde(rename = "22")]
|
||||
R22,
|
||||
#[serde(rename = "24")]
|
||||
R24,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
|
||||
pub struct State {
|
||||
#[serde(with = "ordered_map")]
|
||||
@@ -613,6 +623,8 @@ pub struct State {
|
||||
#[serde(with = "ordered_map")]
|
||||
pub(super) token_parameters: BTreeMap<TokenParameter, std::sync::Arc<[Token]>>,
|
||||
profile: Profile,
|
||||
#[serde(default)]
|
||||
pdftex_revision: PdftexRevision,
|
||||
initex: bool,
|
||||
#[serde(default)]
|
||||
input_profile: super::InputProfile,
|
||||
@@ -734,6 +746,7 @@ impl Default for State {
|
||||
toks: BTreeMap::new(),
|
||||
token_parameters: BTreeMap::new(),
|
||||
profile: Profile::Bootstrap,
|
||||
pdftex_revision: PdftexRevision::R24,
|
||||
initex: false,
|
||||
input_profile: super::InputProfile::default(),
|
||||
endlinechar: 13,
|
||||
@@ -1389,6 +1402,12 @@ impl State {
|
||||
pub fn profile(&self) -> Profile {
|
||||
self.profile
|
||||
}
|
||||
pub(super) fn pdftex_revision(&self) -> &'static str {
|
||||
match self.pdftex_revision {
|
||||
PdftexRevision::R22 => "22",
|
||||
PdftexRevision::R24 => "24",
|
||||
}
|
||||
}
|
||||
pub fn tokens(&self, index: u16) -> Vec<Token> {
|
||||
self.toks.get(&index).cloned().unwrap_or_default()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user